Introduction to tf tutorial: Second turtle does not follow the first one. (No errors)
I've been following http://wiki.ros.org/tf/Tutorials/Introduction%20to%20tf - 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:
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! :-)
Asked by RJ722 on 2018-08-25 03:59:21 UTC
Answers
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.
Asked by RJ722 on 2018-08-28 07:54:00 UTC
Comments
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.Asked by gvdhoorn on 2018-08-25 04:06:24 UTC
Hey @gvdhoorn, Thanks for the edit! Also, I've attached the GIF directly to the question, would be careful next time onwards. :-)
Asked by RJ722 on 2018-08-25 05:50:18 UTC
It seems to work perfectly after a reboot, should I answer this question saying the same?
Asked by RJ722 on 2018-08-26 05:24:35 UTC
I wouldn't call it a solution, but yes, go ahead and answer your own question with that information.
Asked by gvdhoorn on 2018-08-26 08:19:02 UTC
Btw: +1 on the question content. In the future: don't make it too verbose, but do please keep all the relevant information in.
Asked by gvdhoorn on 2018-08-26 08:19:36 UTC
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! :-)
Asked by RJ722 on 2018-08-28 07:56:54 UTC