Extracting definition of customized messages from bag files
TL;DR: How can write a node that subscribes to topics under customized messages that's published from a bag when I don't have access to the definition of the customized messages (the .msg files)?
I have a bag file containing topics in customized messages, for example dbw_mkz_msgs/SteeringReport
.
While I don't have access to the dbw_mkz_msgs
or the definition of dbw_mkz_msgs/SteeringReport
, I can use tools such as rqt_bag
or rostopic echo -b
to view them (their fields and values to be more specific). I can even use the rosbag
python api to edit them and write to another bag.
However, what I cannot do is write a node that subscribes to one of these topics in dbw_mkz_msgs/SteeringReport
since I cannot from dbw_mkz_msgs.msgs import SteeringReport
. Is there a way to extract the definition of a customized message from a bag file?
In python, have a look at the
get_type_and_topic_info()
function on the bag, http://wiki.ros.org/rosbag/Cookbook#G... and http://docs.ros.org/jade/api/rosbag/h...Thanks for you response, @ahendrix. However, it seems like get_type_and_topic_info() will give me the type of the message (a string
dbw_mkz_msg/SteeringReport
), and its md5hash. It still doesn't give me theSteeringReport()
class that I would get if I had access to thedbw_mkz_msgs
package.