rosbag record -a vs. rosbag record tf ... : canTransform has different behavior
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 use rosbag 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:
- 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, why? And how to solve it?
- the info is in the bagfile, but Matlab for some reasons can access that info for a file recorded with -a, but not for a file recorded by listing the topics in command line (in this case I think I should contact Mathworks).
Thanks in advance
Asked by anturtla on 2022-11-27 12:54:37 UTC
Comments
tbh I believe you should contact Mathworks for both these questions.
No one here on ROS Answers (a generalisation and a big assumption, but still) knows how Mathworks has implemented their sw. It's all closed-source, so we can't know.
Additionally, you, or your company/organisation, have paid quite a bit of money to be allowed to use Matlab (ie: licenses). I would expect Mathworks to be there to support you, as you are a paying customer.
Asked by gvdhoorn on 2022-11-28 03:27:53 UTC
Sure, thanks, I am going to contact them. But what I was trying to understand here is if the bagfile misses the info that Matlab is searching for because of the way I record it (with
-a
option or not) or if the problem lies just in the way Matlab processes the bagfile. So my question turns out to be: are there differences in the rosbag created with-a
option with the rosbag created by listing one by one the topics of interest, especially for what concerns the/tf
topic, which is the affected one here? ThanksAsked by anturtla on 2022-11-28 03:58:30 UTC