2 from rospy_message_converter
import message_converter
6 Takes in the message type and a JSON-formatted string and returns a ROS 10 message_type = "std_msgs/String" 11 json_message = '{"data": "Hello, Robot"}' 12 ros_message = convert_json_to_ros_message(message_type, json_message) 14 dictionary = json.loads(json_message)
15 return message_converter.convert_dictionary_to_ros_message(message_type, dictionary)
19 Takes in a ROS message and returns a JSON-formatted string. 22 ros_message = std_msgs.msg.String(data="Hello, Robot") 23 json_message = convert_ros_message_to_json(ros_message) 25 dictionary = message_converter.convert_ros_message_to_dictionary(message)
26 json_message = json.dumps(dictionary)
def convert_json_to_ros_message(message_type, json_message)
def convert_ros_message_to_json(message)