Ask Your Question
0

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

asked 2018-04-17 15:53:21 -0500

rayvburn gravatar image

[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:

image description

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".

image description

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).

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-18 03:09:22 -0500

gvdhoorn gravatar image

updated 2018-04-18 04:24:52 -0500

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:

image description

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
edit flag offensive delete link more

Comments

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.

rayvburn gravatar imagerayvburn ( 2018-04-18 04:12:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-04-17 15:53:21 -0500

Seen: 1,324 times

Last updated: Apr 18 '18