Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to serialize/deserialize message #307

Open
styczen opened this issue Apr 8, 2024 · 1 comment
Open

How to serialize/deserialize message #307

styczen opened this issue Apr 8, 2024 · 1 comment

Comments

@styczen
Copy link

styczen commented Apr 8, 2024

Hi,

We are working on a solution which utilizes micro-ROS. Currently we do not want to use any publishers, subsribers etc. but only messages serialization and deserialization.

The idea is to serialize ROS 2 message e.g. std_msgs/msg/Float32 on the board, send it (but not using ROS 2 or micro-ROS) and deserialize on the other side using rclcpp::Serialization<T>.

I explored the codebase and found function which is responsible for publishing the data (rmw_publish).

There is the logic for something which resemble serialization but I could not figure out how to extract it and use as standalone function.

@pablogs9
Copy link
Member

pablogs9 commented Apr 9, 2024

Type support de/serialization in micro-ROS and ROS 2 is a kind of complex procedure that involves code generation. If you are familiar with it, take a look at the XRCE type support.

If not, a good idea would be to generate a micro-ROS environment so you can see the generated code and headers, for example using one of our modules: https://github.com/micro-ROS/rosidl_typesupport_microxrcedds/tree/iron/rosidl_typesupport_microxrcedds_c and then figure out of to extract the code generation procedure to match your requirements.

The micro-ROS type support works as the ROS 2 one, so the documentation is also valid: https://docs.ros.org/en/iron/Concepts/Advanced/About-Internal-Interfaces.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants