ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

rclpy is spinning your node on a single thread. While you are processing the action server request, the rclpy logic that would service node callbacks is blocked.

You can fix this by using a MultiThreadedExecutor, which uses a pool of threads to service callbacks/goal requests.

While in your move_to_callback polling loop, drop a time.sleep(0.0) to yield the thread, and then the MultiThreadedExecutor should come in and service your subscription callback

rclpy is spinning your node on a single thread. While you are processing the action server request, the rclpy logic that would service node callbacks is blocked.

You can fix this by using a MultiThreadedExecutor, which uses a pool of threads to service callbacks/goal requests.

While in your move_to_callback polling loop, drop a time.sleep(0.0) to yield the thread, and then the MultiThreadedExecutor should come in and service your subscription callback

Example usage of MultiThreadedExecutor can be found in the ros2 examples repo

rclpy is spinning your node on a single thread. While you are processing the action server request, the rclpy logic that would service node callbacks is blocked.

You can fix this by using a MultiThreadedExecutor, which uses a pool of threads to service callbacks/goal requests.

Example usage of MultiThreadedExecutor can be found in the ros2 examples repo

Edit: This step was not needed, preserving it so answer comments make sense

While in your move_to_callback polling loop, drop a time.sleep(0.0) to yield the thread, and then the MultiThreadedExecutor should come in and service your subscription callback callback

Example usage of MultiThreadedExecutor can be found in the ros2 examples repo

rclpy is spinning your node on a single thread. While you are processing the action server request, the rclpy logic that would service node callbacks is blocked.

You can fix this by using a MultiThreadedExecutor, which uses a pool of threads to service callbacks/goal requests.

Example usage of MultiThreadedExecutor can be found in the ros2 examples repo

Edit: EDIT: This step was not needed, preserving it so answer comments make sense

While in your move_to_callback polling loop, drop a time.sleep(0.0) to yield the thread, and then the MultiThreadedExecutor should come in and service your subscription callback

rclpy is spinning your node on a single thread. While you are processing the action server request, the rclpy logic that would service node callbacks is blocked.

You can fix this by using a MultiThreadedExecutor, which uses a pool of threads to service callbacks/goal requests.

Example usage of MultiThreadedExecutor can be found in the ros2 examples repo

EDIT: This step was not needed, preserving it so answer comments make sense

While in your move_to_callback polling loop, drop a time.sleep(0.0) to yield the thread, and then the MultiThreadedExecutor should come in and service your subscription callback

rclpy is spinning your node on a single thread. While you are processing the action server request, the rclpy logic that would service node callbacks is blocked.

You can fix this by using a MultiThreadedExecutor, which uses a pool of threads to service callbacks/goal requests.

Example usage of MultiThreadedExecutor can be found in the ros2 examples repo


EDIT: This step was not needed, preserving it so answer comments make sense

While in your move_to_callback polling loop, drop a time.sleep(0.0) to yield the thread, and then the MultiThreadedExecutor should come in and service your subscription callback