ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The String msg documentation shows that std_msgs/String has only data field.

"Message type std_msgs/String does not have a field position"

suggests that your program doesn't construct the ROS message like it should (with string in the data field of message).

When I did something similar, I have used this converter:

https://github.com/uos/rospy_message_converter

between JSON and ROS messages. Maybe you could use it to form everything correctly with similar steps - between MQTT and ROS: get MQTT message as string, loads it into JSON/Python dictionary, convert it to ROS message, publish. The only problem would be the ROS1 version used (I used it with Noetic).