Hello all,
I get the following error message when parsing a bag file with rosbag API when there is a message of type Int16MultiArray: "Cannot locate message [MultiArrayLayout]: unknown package [std_msgs] on search path [{}]."
Here is the code to parse the bag:
import roslib; roslib.load_manifest('rosbag'); roslib.load_manifest('std_msgs');
from std_msgs.msg import Int32, String, Int16MultiArray
from std_msgs.msg import MultiArrayLayout, MultiArrayDimension
for topic, msg, t in bag:
#do stuff here
As you can see, I include the type that I need (Int16MultiArray) and also it's subtypes (MultiArrayLayout and MultiArrayDimension), but I still get the error. Below is some stack trace.
Traceback (most recent call last):
File "PowerTransferSensorPositionAnalysis.py", line 163, in <module>
main()
File "PowerTransferSensorPositionAnalysis.py", line 53, in main
for topic, msg, t in bag:
File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosbag/bag.py", line 2062, in read_messages
yield self.seek_and_read_message_data_record((entry.chunk_pos, entry.offset), raw)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosbag/bag.py", line 2198, in seek_and_read_message_data_record
msg_type = _get_message_type(connection_info)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/rosbag/bag.py", line 1309, in _get_message_type
message_type = genpy.dynamic.generate_dynamic(info.datatype, info.msg_def)[info.datatype]
File "/opt/ros/fuerte/lib/python2.7/dist-packages/genpy/dynamic.py", line 151, in generate_dynamic
for l in msg_generator(msg_context, spec, search_path):
File "/opt/ros/fuerte/lib/python2.7/dist-packages/genpy/generator.py", line 725, in msg_generator
genmsg.msg_loader.load_depends(msg_context, spec, search_path)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 344, in load_depends
return load_msg_depends(msg_context, spec, msg_search_path)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 313, in load_msg_depends
depspec = load_msg_by_type(msg_context, resolved_type, search_path)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 119, in load_msg_by_type
file_path = get_msg_file(package_name, base_type, search_path)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/genmsg/msg_loader.py", line 78, in get_msg_file
% (base_type, package, search_path))
Thanks for the help
Edit: I should also note that the same error happens when opening the bag with rxbag.
Originally posted by amittleider on ROS Answers with karma: 227 on 2013-03-13
Post score: 0
Original comments
Comment by btakac on 2013-04-02:
Hello! I have a very similar problem, with the same traceback. On Fuerte on Ubuntu 12.04 LTS. Final msg: MsgNotFound: Cannot locate message [Header]: unknown package [std_msgs] on search path [{}]
Is there known solution?
Comment by amittleider on 2013-04-07:
I still have not found a solution (but haven't been looking too hard). It is quite an annoying problem for me.. I had to hack the feature in for now by converting them to a string, publishing, then parsing the string on the other side.
Comment by PeterMilani on 2013-06-21:
Are you using ROSJAva, I get this error for messages published from ROSJava nodes. I am thinking to implement a cpp node to rebroadcast these messages to rosbag and see if it makes a difference