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

What you want is a custom message interface. This requires building an interface package and defining your custom .msg file. It is not recommended to convert complex datatypes into strings end then decode.

The custom interfaces are explained in this tutorial https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.html

You could store one single dictionary key value pair as a separate custom message like so

# DictEntry.msg
string key
string value

And then make your Box datatype holding a list of these DictEntrys

# BoxDict
DictEntry[] data