ROS tool box's cantransform() and gettransform() still trigger on a stale tf.
Afficher commentaires plus anciens
I am using Apriltag_ros, and this publishes a tf transform between the camera and the Apriltag. I have collected a number of datasets to use to do landmark slam, and i wish to use this tf transforms to get the relitive location of the apriltags. To extract this camera -> tag transform i use canTransfom() to see if the transfom is avalible and then gettransform() to extract the relitive location.
This works well until the apriltags are no longer detected and the camera -> tag tf stops being published and goes stale. However cantransform remains true, and getransform() seems to just extract the last published transform.
Is there anyway to prevent this? Thanks a lot for any help you can provide me with.
Réponses (1)
Josh Chen
le 13 Déc 2023
0 votes
Hi Mattew,
It sounds like this might be related to the 'BufferTime'. By default, the buffer time for buffering transformations is 10. Can you try specifying the buffer time to a smaller value and see if it helps?
Thanks,
Josh
4 commentaires
Matthew Coombes
le 13 Déc 2023
Josh Chen
le 13 Déc 2023
Oh sorry the for confusion, when looking at your original post, I thought you are referring to rostf.
If you are extracting from a bag file, there is actually a new API - rosbagreader. Can you try and see if this gives you the expected behavior?
Or if it's okay to share a dummy bag file to reproduce this issue, I can help take a closer look on my end.
Matthew Coombes
le 13 Déc 2023
Josh Chen
le 18 Déc 2023
I just tried this on my side as well, looks like rosbagreader also doesn't give the option to set the buffer range.
Well, I guess one thing you can try to replace 'canTransform' is to write a function to read all '/tf' messages from the bag file, based on difference between odomObjs{i}.Header.Stamp the msg.Transforms.Header.Stamp information, return boolean to indicate whether such transform is valid.
Catégories
En savoir plus sur SLAM dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!