Closed carlossvg closed 3 years ago
@wjwwood I will add more comments, add a readme and probably rename the examples. Could briefly you take a look and see if you miss an example or a specific usage we want to show?
@wjwwood This PR should be ready to review.
@Mergifyio rebase
Command rebase
: success
Branch has been successfully rebased
@wjwwood I addressed your comments. You can review it again.
@wjwwood I added your suggestion. Let me know when I should clean the commit history.
We squash on merge so you don't need to clean up commit history unless you really want to. If so, do it now.
It's fine for me, we can squash as it is. Thanks for the review.
The test failures for Windows are on nightly too. I think it was just resolved with https://github.com/ros2/rclcpp/pull/1726, so I'll rerun CI:
@carlossvg there are some Windows specific compiler warnings which we'll have to resolve before merging, but otherwise lgtm.
I fixed some of the warning, but didn't follow up yet on the rest. I can do that hopefully tonight and get this merged.
This PR adds examples for how to use the new rclcpp::WaitSet classes. It is an extension of the existing PR https://github.com/ros2/examples/pull/262 created by @wjwwood.
This PR includes the following additional examples:
wait_set_subscriber.cpp
uses arclcpp::WaitSet
to wait and poll for datastatic_wait_set_subscriber.cpp
uses arclcpp::StaticWaitSet
to wait and poll for datatime_triggered_wait_set_subscriber.cpp
uses arclcpp::Waitset
and a timer to poll for data periodicallywait_set.cpp
: Simple example showing how to use the default wait-set with a dynamic storage policy and a sequential (no thread-safe) synchronization policy.static_wait_set.cpp
: Simple example showing how to use the static wait-set with a static storage policy.thread_safe_wait_set.cpp
: Simple example showing how to use the thread-safe wait-set with a thread-safe synchronization policy.wait_set_topics_and_timer.cpp
: Simple example using multiple subscriptions, publishers, and a timer.wait_set_random_order.cpp
: An example showing user-defined data handling and a random publisher.executor_random_order.cpp
run the same node logic usingSingleThreadedExecutor
to compare the data handling order.wait_set_and_executor_composition.cpp
: An example showing how to combine aSingleThreadedExecutor
and a wait-set.wait_set_topics_with_different_rate.cpp
: An example showing how to use a custom trigger condition to handle topics with different topic rates.Some of the examples may be moved to ros2/tutorials or ros2/demos.
Connects to ros2/rclcpp#1047