Skip to content

Conversation

@allenh1
Copy link
Contributor

@allenh1 allenh1 commented Jan 12, 2020

Split wait_for_transform_async into two functions to allow callback to be specified

Signed-off-by: Hunter L. Allen [email protected]


@sloretz Well aware that there's likely more to be done here, but I'm not sure what so I'm opening this for visibility.

On #194 you wrote:

the result on future doesn't contain any info about the transform. It should probably have that.

Can you please clarify what information you're hoping to propagate up?

@allenh1 allenh1 added enhancement New feature or request in progress Actively being worked on (Kanban column) labels Jan 12, 2020
@allenh1 allenh1 requested a review from sloretz January 12, 2020 18:37
@allenh1 allenh1 self-assigned this Jan 12, 2020
@allenh1 allenh1 force-pushed the callback-when-transform-available-194 branch from 837a859 to 21f36ec Compare January 12, 2020 18:38
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up @allenh1 !

fut = rclpy.task.Future()
if self.can_transform_core(target_frame, source_frame, time)[0]:
# Short cut, the transform is available
fut.set_result(True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On #194 you wrote:

the result on future doesn't contain any info about the transform. It should probably have that.

Can you please clarify what information you're hoping to propagate up?

I was trying to say it would be nice if fut.result() returned the transform that was being waited for instead of True.

return fut

def wait_for_transform(target_frame, source_frame, time, callback):
return _wait_for_transform_async(target_frame, source_frame, time, callback)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding wait_for_transform(..., callback), with ros2/rclpy#460 merged I think the utility #194 is asking for can be had by making the result on the future returned by wait_for_transform_async() contain the transform data. The interface someone would use is fut = wait_for_transform_async(...); fut.add_done_callback(my_tf_callback).

@clalancette
Copy link
Contributor

@allenh1 What's the status on this one? Would you like to continue with it? If not, totally fine, but then I'll suggest we close it out. Thanks.

@allenh1
Copy link
Contributor Author

allenh1 commented Oct 28, 2020

Slipped my mind entirely.

I'd be glad to pick back up on it in the very near future, though.

@allenh1
Copy link
Contributor Author

allenh1 commented Jan 30, 2021

I'd be glad to pick back up on it in the very near future, though.

Welp, this was clearly delusional. I'm going to close this PR and free up the issue so as to not block progress here. Apologies for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request in progress Actively being worked on (Kanban column)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants