ros2 / examples

Example packages for ROS 2
Apache License 2.0
691 stars 311 forks source link

Add an example about how to use wait_for_all_acked #316

Closed Barry-Xu-2018 closed 2 years ago

Barry-Xu-2018 commented 3 years ago

This commit depends on the merge of ros2/rcl#913 and ros2/rclcpp#1662.

Barry-Xu-2018 commented 3 years ago

If pre-shutdown callback is supported (https://github.com/ros2/rclcpp/issues/1706#issuecomment-872613908), I can simplify current codes.

fujitatomoya commented 3 years ago

probably it would be nice to have only specified example to introduce wait_for_acknowledgement w/o custom_shutdown_func? but i think it is still okay, any opinions?

Barry-Xu-2018 commented 3 years ago

probably it would be nice to have only specified example to introduce wait_for_acknowledgement w/o custom_shutdown_func? but i think it is still okay, any opinions?

Yes. The example want to show how to wait the confirmation of subscribers while calling shutdown.
But there is no pre-shutdown callback interface.
So I have to use custom_shutdown_func to implement it.
About 'pre-shutdown', it was discussed in https://github.com/ros2/rclcpp/issues/1706#issuecomment-872613908.
I also submitted an implementation ros2/rclcpp#1714. But this implementation need to be discussed. After this feature is implemented, we can simplify this example.

fujitatomoya commented 2 years ago

@Barry-Xu-2018 can we also have example for rclpy?

Barry-Xu-2018 commented 2 years ago

@Barry-Xu-2018 can we also have example for rclpy?

Yeah. I will consider adding this example.

fujitatomoya commented 2 years ago

we can run CI once https://github.com/ros2/rclcpp/pull/1662 is merged.

Barry-Xu-2018 commented 2 years ago

Example code for python isn't added.
It is because rclpy has this issue ros2/rclpy#532. I added comments https://github.com/ros2/rclpy/issues/532#issuecomment-972610972.

Barry-Xu-2018 commented 2 years ago

do rebase

fujitatomoya commented 2 years ago

@ros-pull-request-builder retest this please

fujitatomoya commented 2 years ago

@clalancette it appears that CI still does not have https://github.com/ros2/rclcpp/pull/1662, that leads this PR to build failure. Do you know how long it takes? i was thinking this is done by nightly build.

clalancette commented 2 years ago

@clalancette it appears that CI still does not have ros2/rclcpp#1662, that leads this PR to build failure. Do you know how long it takes? i was thinking this is done by nightly build.

So for the Rpr job to pass, we need to make an explicit source and bloom release to get PRs in. I can do one of those later today.

That said, you should be able to run a CI job from https://ci.ros2.org to verify this functionality on all platforms, and that will include the latest sources.

fujitatomoya commented 2 years ago

CI: (just checking if it can be build with mainline since there is no test for examples)

Barry-Xu-2018 commented 2 years ago

@fujitatomoya

I update code to fix build warning on macOS. Could you re-trigger CI ?

fujitatomoya commented 2 years ago
fujitatomoya commented 2 years ago

@ros-pull-request-builder retest this please

fujitatomoya commented 2 years ago

@ivanpauno @sloretz @clalancette could you help this with review?

fujitatomoya commented 2 years ago

@ros-pull-request-builder retest this please

Barry-Xu-2018 commented 2 years ago

Friendly ping @ivanpauno

fujitatomoya commented 2 years ago

@ivanpauno really appreciate for helping on this, thanks 👍