ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
747 stars 914 forks source link

rosbag record -a vs. rosbag record <topics> : canTransform has different behavior #2303

Open AnlageM opened 1 year ago

AnlageM commented 1 year ago

Good evening,

I am using rosbag from Command line in ROS Noetic. When I record the data using rosbag record -a, I can normally analyze data with Matlab using the function canTransform/getTransform to retrieve the transform between two random reference frames.

I decided to try to obtain a smaller bagfile by neglecting topic I don't need. With the same setup, and following the same launch orders, I tried to userosbag record tf tf_static <other topics from rostopic list>. In this case, the bagfile object in matlab seems to have the same structure, but it misses the field "AvailableFrames": then, canTransform always result in a 0, which means no transform exists between the reference frames, even if the parent/child transforms seem to be correctly strored in the bagfile object. Moreover, the same problem happens when I use rosbag record <whole rostopic list output> in the command line, so I don't think it is a matter of missing relevant topics for the canTransform/getTransform function.

Any idea about possible reasons?

I think there are two cases:

  1. the info which is supposed to fill the Matlab BagSelection object property "AvailableFrames" is missing in the bagfile itself when it is recorded without -a option: in this case, whythis happens? And how to solve it?

  2. the info is in the bagfile, but Matlab for some reasons can access that info for a file recorded with -a option, but not for a file recorded by listing the topics in command line (if this is the case, I will I contact Mathworks).

Thanks in advance