Skip to content

Record service requests #773

@kunaltyagi

Description

@kunaltyagi

Description

In ROS1, recording services was not implemented. However, actions were implemented on top of messages.

This made it possible to debug/enhance/test a system by recording just messages and replaying them. In ROS2, server client handshake is done over services. Would it be possible to implement a rosbag record of the sent goals?

Related Issues

ROS1: ros/ros_comm#250

Completion Criteria

Successful trigger of action by following this sequence:

  1. ros2 run action_tutorials_py fibonacci_action_server
  2. ros2 bag record -a --include-hidden # or any other flag
  3. ros2 run action_tutorials_py fibonacci_action_client
  4. Close all nodes
  5. ros2 run action_tutorials_py fibonacci_action_server
  6. ros2 bag play rosbag2_
  7. Wait to see if server responds

This sequence with ROS1 works if the goal messages are recorded. If this also works with ROS2, we can consider this feature as "ready"

Implementation Notes / Suggestions

On the interface, we can have 3 different behaviors, all of which make sense from a certain perspective:

  1. ros2 bag record --include-actions or ros2 bag record --include-services to allow replaying of service requests (most sensible, keeps concerns separate)
  2. Make it default behavior to record action goal/cancellations but not services (same behavior from ROS1)
  3. Extend the existing ros2 bag record --include-hidden-topics (better if not done this way)

Since the services and topics are implemented similarly at a RMW level, it should be possible to record the data sent via services.

On the other hand, just because all current RMW implementations use the same mechanism for topic and service communication, this might not hold true in future.

Testing Notes / Suggestions

The integrated testing for this would be quite simple:

  1. start service/action server
  2. start recording
  3. call service/action
  4. stop recording and play the bag
  5. expect a call for the service/action

I don't know how it'd be unit tested

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions