Exercise 2.5 source frame does not exist

I’ve created a broadcaster for the “fixed” carrot. Since it is always ahead of robot 2, I assumed it would cause the robot to “chase” it endlessly. I start both the original broadcaster (with the 2 robots and the coke can) and my fixed carrot broadcaster. I can see the fixed_carrot tf in RVIZ, so I know the publisher is working. However, when I do rosrun tf tf_echo , I do see the expected transform, but I also get an error message initially:

Exception thrown:“fixed_carrot” passed to lookupTransform argument source_frame does not exist.
The current list of frames is:
Frame turtle1 exists with parent world.
Frame turtle2 exists with parent world.
Frame coke_can exists with parent world.

When I try to run the tf_listener and pass in fixed_carrot as the frame to be followed, nothing happens - the “try” fails, so no cmd_vel is published for robot2. I’m guessing that has to do with the error I see in tf_echo.

My fixed_carrot publisher is the same as the example, except the values for the br.sendTransform are different to match what’s needed for the exercise.

Any hints?


Just tested the moving_carrot. Same deal - I can see the tf in RVIZ moving as expected around the coke_can, but nothing happens in Gazebo.


Have a try downloading this code solutions for the course: GIT Solutions TF

And execute in two different webshells the following:

roslaunch tf_course_solutions_pkg ex_2_5_solution.launch

rosrun tf_course_solutions_pkg fixed_extra_frame_pub_ex2_4.py

Hope this clears up things. Compare your code with this one and see whats wrong ;). If the issue continues dont hesitate to contact again ;).

It’s working now, but I didn’t change anything. The examples solutions look pretty much like the ones I had written as well. So no idea why it didn’t work before, but I’m happy it’s working now.

Thanks for the response though.

All the best,

1 Like