Borrar filtros
Borrar filtros

Using readMessages() on ROS bag gives incomplete TF data

2 visualizaciones (últimos 30 días)
Greg Chance
Greg Chance el 11 de Abr. de 2018
Respondida: YJ Lim el 27 de Ag. de 2018
I have read TF messages in Matlab from a recorded ROS bag but realised some of them are missing. I have recordings of the Baxter robot. I've attached a 5s sample of the bag (bag_sample_5s.bag) and the Matlab extracted messages (tfMsgs_sample.mat). Inspecting element tfMsgs{5, 1}.Transforms(10, 1).Transform.Translation gives (x,y,z) as expected but the values are not as expected.
Looking at the same rosbag in rviz and inspecting the same frame "reference/left_hand" I notice that there exists a "Position" and "Orientation" message but also a "Relative Position" and "Relative Orientation" message.
The "Position" as viewed in rviz is correct and the value I want to extract but Matlab appears to be reading the "Relative Position" which is incorrect. Given that no other messages are present in the Matlab message structure I'm puzzled at how to get to the data I need!
Any help greatly appreciated.
bag = rosbag(ROSBagPath);
tfBag = select(bag, 'Time',[start, stop],'Topic','/tf');
nMesgs = tfBag.NumMessages;
tfMsgs = readMessages(tfBag);

Respuestas (1)

YJ Lim
YJ Lim el 27 de Ag. de 2018
With live ROS connection, you can use existing rostf function (shipping in 15a - https://www.mathworks.com/help/robotics/ref/robotics.transformationtree.html?searchHighlight=rostf&s_tid=doc_srchtitle)
From rosbag file, tf extraction can only get the relative transforms before R2018a. In R2018a, we have added AvailableFrames/getTransform in rosbag selection to get tf between two coordinate frames. (https://www.mathworks.com/help/robotics/ref/bagselection.html)

Categorías

Más información sobre Network Connection and Exploration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by