# RViz error:Transform [sender=unknown_publisher] - For frame [X]: Frame [X] does not exist

[ROS Kinetic, Ubuntu 16.04]

Hello, I have a problem with sensor frames in rviz. I have created a static trasform broadcaster that publishes all static transforms of my robot (did it according to http://wiki.ros.org/tf2/Tutorials ). Map->odom tf is created temporarily as static, until I integrate some SLAM module. Now map and odom coordinate systems are placed in the same position. Odom->base link is published by ros_controllers node. The tf tree looks as follows:

However when I start a visualization in rviz I can't see any sensor_msgs::Range data (from any of my 3 sonars) but I can choose corresponding topics. Rviz shows error (example, shows similar for other sonars):

"Transform [sender=unknown_publisher] - For frame [base_sonarF]: Frame [base_sonarF] does not exist".

I am really confused as you can see on the tf_tree that the system recognizes transforms I'm publishing. Is it rviz error or I did something wrong? In my URDF file I didn't create any joints for sonars, only for wheels and base, if that matters. When I'm echoing sonar topics everything seems to be right, especially distances from obstacles.

I've found same issue in other questions but none of the solutions worked (like adding marker in rviz, making sonar's frame a fixed frame).

edit retag close merge delete

Sort by » oldest newest most voted

This is most likely caused by the fact that your TF frame is called base_SonarF, while you specify a frame_id in your Range message of base_sonarF. Note that lowecase s in your frame_id and the uppercase S in your TF frame:

Names are case-sensitive in ROS, so RViz is correct: there is no base_sonarF frame.

Suggestion: never use capitals in any names names of TF frames, links, joints, parameters, launch files, C++/Python/something else source files, and some others in ROS. The wiki/Names page states that it is allowed (valid characters include [a-z|A-Z]), but I typically avoid them as it can lead to situations exactly like the one you have run into here: it's too easy to make mistakes, leading to runtime errors that you find hard to diagnose.

Not using any capitals allows you -- and your (future) users -- to instantly form / use intuition as to how names are structured. Don't underestimate how valuable that can be.

You are of course free to do what you want -- as long as you stay within the actual requirements to names in ROS, but if I may suggest:

• no capitals, ever
• and what wiki/Names prescribes
more

You are totally right, my frames were named differently despite they related to the same. Also thank you for your kind tips, I will definitely keep them in mind. Thank you very much, problem solved.

( 2018-04-18 04:12:51 -0600 )edit