As per the ROS conventions: https://www.ros.org/reps/rep-0105.html#relationship-between-frames, the 'odom' frame should be the parent of 'base_link' frame. This means the transform between these two frames is 'odom->base_link'
However, while I was going through some of the existing code (that is developed using ROS) on GitHub, I came across a couple of instances in which the transform being published has the reversed frame order: 'base_link->odom', where <>.header.frame_id is 'base_link and <>.child_frame_id is 'odom'.
The two examples are:
So, I have a couple of questions:
Is the transform in the above examples correct (or acceptable)?
How important is it to follow the frame order suggested by the REP 105 in the tf tree? Should it always be followed? If yes, why? If no, why?
Would really appreciate if someone could help me to understand the tf tree order.
Thank you!
Originally posted by skros on ROS Answers with karma: 3 on 2020-04-17
Post score: 0
Original comments
Comment by gvdhoorn on 2020-04-18:
Just a comment:
while I was going through some of the existing code (that is developed using ROS) on GitHub
the wording here makes it sound like you have analysed the TF/TF2 implementation (ie: the libraries themselves) or some other piece of code part of the code (which would imply it's part of some official distribution and has been specially vetted).
From the rest of your question text it appears that's not the case; you've come across two community contributed packages where the authors seem to have made a mistake (and also note: the first package hasn't been touched since 2013 and the second is from 2015).
I realise these are still valid examples of where authors of nodes may have implemented this transform incorrectly, so valid examples of what you'd be interested in when applying static analysis to this sort of code. But it would be good to acknowledge the fact those pieces of code are "from the stone-ages" though.