Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 475

Rosbag Python API: why do messages from a rosbag have mangled __class__?

$
0
0
I find that messages loaded from a rosbag via the Python API, have a weird __class__ attribute: import rosbag from sensor_msgs.msg import PointCloud2 # Round-trip a PointCloud2 message to a rosbag and back bag = rosbag.Bag('test.bag', 'w') try: scan = PointCloud2() print("__class__should be: \n{}".format(scan.__class__)) bag.write('scan', msg) finally: bag.close() bag = rosbag.Bag('test.bag') for topic, msg, t in bag.read_messages(topics=['scan']): print("But it comes out as: \n{}".format(msg.__class__)) bag.close() The output: __class__should be: But it comes out as: Is this a bug, or a feature? ROS Indigo, Ubuntu 14, Python 2.7

Viewing all articles
Browse latest Browse all 475

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>