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

Hello Community

thank you to ljaniec's support. I found an easiest way to transport my data from non ros program to ros via mqtt without using rospy_message_converter. The message type in rospy_message_converter is very sensitive and hard to convert a complex json file. In another way, the file can be transferred with mqtt function:

  1. In MQTT Publisher

    Create the dictionary (python) and convert to json, then send to the mqtt broker

  2. In MQTT Subscriber

    Convert back the json to dictionary. Instead of using the message library from ros (e.g std_msgs, geometry_msgs) you create your own message file like the json structure you sent. Last initialize the ros message equal the dictionary value and publish it to a topic.