"Debugging tf problems" tutorial not working for me

asked 2018-04-13 08:30:26 -0600

OperationCrossbow gravatar image

updated 2018-04-13 10:31:46 -0600

ROS Kinetic & Ubuntu 16.04

The tutorial about debugging /tf has some major issues, or my brain does. Probably the latter. ( http://wiki.ros.org/tf/Tutorials/Debu... )

First, I start the start_debug_demo.launch file. A turtle sim comes up, with a live and dead turtle, and a

"turtle3" passed to lookupTransform argument target_frame does not exist

error, as expected. Except my error looks like

"turtle3" passed to lookupTransform argument target_frame does not exist.

My first clue.

In learning_tf /src I create the turtle_tf_listener.debug.cpp file. Somehow the tutorial also forgets to mention that I need to put add_executable(...) in the CMakeLists.txt . But I put it in.

I'm not sure why it's expected that this cpp would erase the error. The error existed before the creation of this turtle_tf_listener_debug.cpp file. It's clear this cpp file is completely unattached to the launch file.

According to the tutorial, you mention "turtle3" in this cpp file. Then you change it to "turtle2" and hooray, the "turtle3 doesn't exist" error is gone. Except, no it isn't. I already put "turtle2" in this cpp file. Doesn't change the error. As expected, the start_debug_demo.launch is not in contact with this cpp file. I investigate:

I go to $roscd turtle_tf to look inside. Doesn't have /src or /nodes. Just /rviz and /cmake and /launch.

I look inside /opt/ros/kinetic/share/turtle_tf/launch which has the start_debug_demo.launch. I open it with gedit.

<node name="turtle_pointer" pkg="turtle_tf" type="turtle_tf_listener_debug" respawn="false" output="screen"  </node>

Sure enough, it doesn't even mention learning/tf/src 's cpp file. If I change it to

<node name="turtle_pointer" pkg="learning_tf" type="turtle_tf_listener_debug" respawn="false" output="screen"  </node>

I do the catkin_make, the source bash, re-run roscore, and try again, I still get errors about "turtle3" not existing. But where am I mentioning "turtle3"? Not in the launch file. Not in the cpp file for the nodes. And there's no alternative turtle_tf_listener_debug.cpp files that I can find. Only the one I created. Rqt_graph doesn't show any "turtle3". view_frames of course doesn't show any "turtle3" either.

The CMakeLists.txt from learning_tf package (created in the tutorials):

cmake_minimum_required(VERSION 2.8.3)

project(learning_tf)

find_package(catkin REQUIRED

COMPONENTS roscpp rospy tf

turtlesim) catkin_package( # INCLUDE_DIRS include # LIBRARIES learning_tf # CATKIN_DEPENDS roscpp rospy tf turtlesim # DEPENDS system_lib ) include_directories( # include ${catkin_INCLUDE_DIRS} )

add_executable(turtle_tf_listener_debug src/turtle_tf_listener_debug.cpp)

target_link_libraries(turtle_tf_listener_debug ${catkin_LIBRARIES})

add_executable(turtle_tf_message_filter src/turtle_tf_message_filter.cpp)

target_link_libraries(turtle_tf_message_filter ${catkin_LIBRARIES})

/opt/ros/kinetic/share/turtle_tf does not contain a CMakeLists.txt but does containt a /cmake/turtle_tfCongif-version.cmake

According to the tutorial, I should be witnissing timestamp errors now. But I'm still getting "turtle3" errors. What did I do wrong? Where are these coming from?

edit retag flag offensive close merge delete

Comments

Sounds like there is some mix-up between the learning_tf package and turtle_tf package. Try copying the debug launch file to learning_tf (and changing turtle_tf to learning_tf in it) and launching it after removing the turtle_tf package (use sudo apt-get remove ros-your_dist-turtle-tf to remove).

stevejp gravatar imagestevejp ( 2018-04-13 09:47:09 -0600 )edit

@stevejp I thought so too. Except, in the tutorial it's supposed to be the turtle_tf package that you use. If you look at the tutorial, it's all about turtle_tf and learning_tf things. I did try adjusting the launch file to search the learning_tf, as I mentioned, but the problem persists, somehow.

OperationCrossbow gravatar imageOperationCrossbow ( 2018-04-13 09:51:50 -0600 )edit

Okay if you've completely removed turtle_tf and still have the problem, then something is wrong with your setup. If you've fixed the .cpp code and still see the error, then it isn't building correctly. Can you please add your CMakeList file to the original post?

stevejp gravatar imagestevejp ( 2018-04-13 10:06:13 -0600 )edit

@stevejp But if the first line of the tutorial is $ roslaunch turtle_tf start_debug_demo.launch, then removing the turtle_tf package isn't going to work, is it?

Besides, turtle_tf is in my /opt/ros folder. I'm not sure I'm supposed to delete folders in there. Had to use 'sudo' just to edit launch.

OperationCrossbow gravatar imageOperationCrossbow ( 2018-04-13 10:23:51 -0600 )edit

Alright don't worry about that - but if you can post your CMake file that would be useful.

stevejp gravatar imagestevejp ( 2018-04-13 10:27:46 -0600 )edit

@stevejp Sorry, took a while. Updated.

OperationCrossbow gravatar imageOperationCrossbow ( 2018-04-13 10:47:16 -0600 )edit