ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
What do you mean with "implements serializable"? The Marker type is of course serializable. All ROS message types are serializable. Here an example:
import roslib roslib.load_manifest("visualization_msgs") import visualization_msgs.msg m=visualization_msgs.msg.Marker() a=str(m)
In [55]: a Out[55]: "header: \n seq: 0\n stamp: \n secs: 0\n nsecs: 0\n frame_id: ''\nns: ad\nid: 0\ntype: 0\naction: 0\npose: \n position: \n x: 0.0\n y: 0.0\n z: 0.0\n orientation: \n x: 0.0\n y: 0.0\n z: 0.0\n w: 0.0\nscale: \n x: 0.0\n y: 0.0\n z: 0.0\ncolor: \n r: 0.0\n g: 0.0\n b: 0.0\n a: 0.0\nlifetime: \n secs: 0\n nsecs: 0\nframe_locked: False\npoints: []\ncolors: []\ntext: asdfadf\nmesh_resource: adfa\nmesh_use_embedded_materials: False"
Here serialized in the yaml format in a string variable. You can also use the methods m.serialize and m.serialize_numpy
2 | No.2 Revision |
What do you mean with "implements serializable"? The Marker type is of course serializable. All ROS message types are serializable. Here an example:
Here serialized in the yaml format in a string variable. You can also use the methods m.serialize and m.serialize_numpy
3 | No.3 Revision |
What do you mean with "implements serializable"? The Marker type is of course serializable. All ROS message types are serializable. Here an example:
import roslib roslib.load_manifest("visualization_msgs") import visualization_msgs.msg m=visualization_msgs.msg.Marker() a=str(m) In [55]: a Out[55]: "header: \n seq: 0\n stamp: \n secs: 0\n nsecs: 0\n frame_id: ''\nns: ad\nid: 0\ntype: 0\naction: 0\npose: \n position: \n x: 0.0\n y: 0.0\n z: 0.0\n orientation: \n x: 0.0\n y: 0.0\n z: 0.0\n w: 0.0\nscale: \n x: 0.0\n y: 0.0\n z: 0.0\ncolor: \n r: 0.0\n g: 0.0\n b: 0.0\n a: 0.0\nlifetime: \n secs: 0\n nsecs: 0\nframe_locked: False\npoints: []\ncolors: []\ntext: asdfadf\nmesh_resource: adfa\nmesh_use_embedded_materials: False"
Here the message has been serialized in the yaml format in and stored a string variable. You can also use the methods m.serialize the methods "Marker.serialize" and m.serialize_numpy"Marker.serialize_numpy" in conjunction with the io.StringIO class