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

Revision history [back]

I tested your code on ROS Galactic and found it working. Therefore, I suggest using Galactic or Humble if you want to stay updated. However, please note that I have not tested your code in Humble.

Below are the results reported in the terminal:

  • Server:

    $ ros2 run examples_rclpy_minimal_service service
    [INFO] [1666000409.550238114] [minimal_action_server]: Received goal request
    [INFO] [1666000409.551262021] [minimal_action_server]: Executing goal...
    [INFO] [1666000409.551549517] [minimal_action_server]: Publishing feedback: array('i', [0, 1, 1])
    [INFO] [1666000410.552772896] [minimal_action_server]: Publishing feedback: array('i', [0, 1, 1, 2])
    [INFO] [1666000411.561754895] [minimal_action_server]: Received cancel request
    [INFO] [1666000411.562464815] [minimal_action_server]: Publishing feedback: array('i', [0, 1, 1, 2, 3])
    [INFO] [1666000412.566019658] [minimal_action_server]: Goal canceled
    
  • Client:

    $ ros2 run examples_rclpy_minimal_client client
    [INFO] [1666000409.539484246] [minimal_action_client]: Waiting for action server...
    [INFO] [1666000409.539845804] [minimal_action_client]: Sending goal request...
    [INFO] [1666000409.550877363] [minimal_action_client]: Goal accepted :)
    [INFO] [1666000409.551996243] [minimal_action_client]: Received feedback: array('i', [0, 1, 1])
    [INFO] [1666000410.553445095] [minimal_action_client]: Received feedback: array('i', [0, 1, 1, 2])
    [INFO] [1666000411.552878882] [minimal_action_client]: Canceling goal
    [INFO] [1666000411.563110901] [minimal_action_client]: Received feedback: array('i', [0, 1, 1, 2, 3])
    [INFO] [1666000411.563414815] [minimal_action_client]: Goal successfully canceled