Robotics StackExchange | Archived questions

How to get and send serialized Request and Response in rclcpp ROS2

There are sample ROS2 codes for serialized publisher and subscriber:

https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/topics/listener_serialized_message.cpp https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/topics/talker_serialized_message.cpp

They demonstrate how to receive and publish serialize message for topics.

I want to do something similar in my service and client code using rclcpp (ROS2).

  1. In rclcpp, is there a way to send and receive serialize Request and Response?

  2. If 1 is not possible, is there an API to call ros middle-ware (rmw) to perform serialization and de-serialization?

Thanks,

Shuo

Asked by shuodo on 2020-05-26 14:48:54 UTC

Comments

Answers