Ask Your Question
1

Introduction to tf tutorial: Second turtle does not follow the first one. (No errors)

asked 2018-08-25 03:59:21 -0600

RJ722 gravatar image

updated 2018-08-25 05:56:42 -0600

gvdhoorn gravatar image

I've been following http://wiki.ros.org/tf/Tutorials/Intr... - I started with installing everything with the following command:

$ sudo apt-get install ros-kinetic-ros-tutorials ros-kinetic-geometry-tutorials ros-kinetic-rviz ros-kinetic-rosbash ros-kinetic-rqt-tf-tree

Luckily everything was already installed and I got this output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-kinetic-geometry-tutorials is already the newest version (0.2.2-0xenial-20180809-184418-0800).
ros-kinetic-ros-tutorials is already the newest version (0.7.1-0xenial-20180809-153903-0800).
ros-kinetic-rosbash is already the newest version (1.14.3-0xenial-20180809-134025-0800).
ros-kinetic-rqt-tf-tree is already the newest version (0.5.8-0xenial-20180809-162041-0800).
ros-kinetic-rviz is already the newest version (1.12.16-0xenial-20180809-192423-0800).
The following package was automatically installed and is no longer required:
  python-libxml2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Now, when I launch roslaunch turtle_tf turtle_tf_demo.launch - I get no errors or warnings:

... logging to /home/snowden/.ros/log/3f67ef12-a810-11e8-bcd4-8ca982221578/roslaunch-snowden-Inspiron-N5010-17760.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://snowden-Inspiron-N5010:41377/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.13
 * /scale_angular: 2.0
 * /scale_linear: 2.0
 * /turtle1_tf_broadcaster/turtle: turtle1
 * /turtle2_tf_broadcaster/turtle: turtle2

NODES
  /
    sim (turtlesim/turtlesim_node)
    teleop (turtlesim/turtle_teleop_key)
    turtle1_tf_broadcaster (turtle_tf/turtle_tf_broadcaster.py)
    turtle2_tf_broadcaster (turtle_tf/turtle_tf_broadcaster.py)
    turtle_pointer (turtle_tf/turtle_tf_listener.py)

ROS_MASTER_URI=http://localhost:11311

process[sim-1]: started with pid [17777]
process[teleop-2]: started with pid [17778]
process[turtle1_tf_broadcaster-3]: started with pid [17779]
process[turtle2_tf_broadcaster-4]: started with pid [17786]
process[turtle_pointer-5]: started with pid [17795]
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.

After a brief moment, the second turtle revolves a little bit:

C:\fakepath\turtle.gif

According to the tutorial, if I start moving the first turtle, the second turtle should follow it, but as visible in the GIF, nothing happens, it just stays as is. FWIW, my turtle_tf_demo.launch file looks like this:

<launch>
  <!-- Turtlesim Node-->
  <node pkg="turtlesim" type="turtlesim_node" name="sim"/>

  <node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>
  <!-- Axes -->
  <param name="scale_linear" value="2" type="double"/>
  <param name="scale_angular" value="2" type="double"/>

  <node name="turtle1_tf2_broadcaster" pkg="turtle_tf2" type="turtle_tf2_broadcaster.py" respawn="false" output="screen" >
    <param name="turtle" type="string" value="turtle1" />
  </node>
  <node name="turtle2_tf2_broadcaster" pkg="turtle_tf2" type="turtle_tf2_broadcaster.py" respawn="false" output="screen" >
    <param name="turtle" type="string" value="turtle2" />
  </node>
  <node name="turtle_pointer" pkg="turtle_tf2" type="turtle_tf2_listener.py" respawn="false" output="screen" >
  </node>
</launch>

I'm running ROS Kinetic on Xubuntu 16.04 LTS (xenial). Here is the output of env | grep 'ROS':

ROS_DISTRO=kinetic
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
ROS_PACKAGE_PATH=/home/snowden/catkin_ws/src/beginner_tutorials:/home/snowden/catkin_ws/src/husky_highlevel_controller:/home/snowden/catkin_ws/src/ros_best_practices/ros_package_template:/home/snowden/catkin_ws/src/teleop_twist_keyboard:/opt/ros/kinetic/share
ROS_VERSION=1
ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=/home/snowden/catkin_ws/devel/share/common-lisp

Also, I'd be around if you need any more info.

Is there something wrong on my side?

Thanks in advance! :-)

edit retag flag offensive close merge delete

Comments

1

Thanks for being considerate of post length (and using a pastebin like site), but we try to keep Q&As stand-alone here on ROS Answers. I've already inserted all code/xml/console output into your question, and could I ask you to attach the screenshots and gif directly to your question? Thanks.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-25 04:06:24 -0600 )edit
1

Hey @gvdhoorn, Thanks for the edit! Also, I've attached the GIF directly to the question, would be careful next time onwards. :-)

RJ722 gravatar imageRJ722 ( 2018-08-25 05:50:18 -0600 )edit

It seems to work perfectly after a reboot, should I answer this question saying the same?

RJ722 gravatar imageRJ722 ( 2018-08-26 05:24:35 -0600 )edit

I wouldn't call it a solution, but yes, go ahead and answer your own question with that information.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-26 08:19:02 -0600 )edit

Btw: +1 on the question content. In the future: don't make it too verbose, but do please keep all the relevant information in.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-26 08:19:36 -0600 )edit

I am quite new to ROS, so decided to put in everything (because who knows that I might have been the one who was screwing this up), but yes, as I gain more experience, hopefully I'd get better. Thanks for helping me out, it is much appreciated! :-)

RJ722 gravatar imageRJ722 ( 2018-08-28 07:56:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-28 07:54:00 -0600

RJ722 gravatar image

So, as weird as it may sound, rebooting the machine actually fixes this problem.

Also, I think that it is worth mentioning that I installed ros-kinetic-tf2-tools before the reboot, but it didn't fix the problem, the reboot did.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2018-08-25 03:59:21 -0600

Seen: 219 times

Last updated: Aug 28 '18