BTW, I’m not sure that rclcpp::Rate spins while it sleeps. It hasn’t in times gone by. Generally, you will break things in ROS2 if you sleep instead of spin; your buffers will overflow, etc. We usually use the timeouts on the spin methods instead.
ROS Resources: ROS Homepage | Media and Trademarks | Documentation | ROS Index | How to Get Help | Q&A Help Site | Discussion Forum | Service Status |
BTW, I’m not sure that rclcpp::Rate spins while it sleeps. It hasn’t in times gone by. Generally, you will break things in ROS2 if you sleep instead of spin; your buffers will overflow, etc. We usually use the timeouts on the spin methods instead.