Rviz use last tf (transform) message for creating visualization
I have a map frame, a camera frame and a robot frame. The transform between map frame and the camera frame is fixed and gets published occasionally, ~10 seconds irregular intervals. The transform between the camera and the robot gets published at ~30Hz. The Rviz visualization of the robot's pose is with reference to the map frame and it gets updated only after it receives a new /tf message for transform between map and camera. I want Rviz to use whatever previous transform is available from the tf tree to create the visualization. Thank you in advance :)
How are you punishing the tf between map and camera? Have you considered using a static transform publisher node?
All transforms are being published based on the detection of Aruco markers using the aruco_ros package (https://github.com/pal-robotics/aruco...) - one marker on the robot and one marker on the floor (map frame).
The issue was that sometimes one marker got covered or the lighting condition inhibited tracking. I managed to put the marker on the floor to an alternate position and improved the lighting, which solved the problem for me.
Thanks for your suggestion as well, I can create a node that reads up the transform at the start and then publishes it at a constant rate later on (I hope I understood it right). Might come handy later on.
This sounds similar to a setup we had once, where the transform between the camera and the marker is fixed. We made a node which averaged 5 seconds of poses and then published that fixed transform for the rest of the experiment.
Hope this fixes your problem
Thank you! :D If you like you may post that as an answer