0
$\begingroup$

Rosanswers logo

I'm using a turtlebot 2 with an ASUS XTION laser and I noticed that in RVIZ my laser is represented as being mounted on the back of the robot but in reality the laser is on the front of the robot. How do I change the transformation from base link to laser to adjust the coordinates of the laser frame? Do I have to write a custom tf publisher or is there a default setting somewhere that I can adjust?

EDIT: I tried running the static_transform publisher in command line using:

rosrun tf static_transform_publish 0.0 0.0 0.3966 0.0 0.0 0.0 /base_link /camera_rgb_frame 100

which seems to work except when looking at RVIZ, it seems like this transform is competing with another transform being published by either my amcl or gmapping node. How can I override the transform or choose which one to use in a launch file?

Thanks!!


Originally posted by pgigioli on ROS Answers with karma: 354 on 2016-03-21

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The competing is expected. In ROS robots are defined in a description file, most of the time stored as .urdf file in a <robot_name>_description package. When you launch your robot, the robot_state_publisher will read those files and publish a tf tree. If you publish an additional transform between two parent-child nodes of that tree, there will be competition.

In the case of the Turtlebot the package you need is the turtlebot_description package. In the folder urdf/sensors you can find the files containing the coordinates of the xtion. Check which urdf your launch file is loading as there seems to be 2 description files for the xtion.

You can find those description files on your computer by typing

roscd turtlebot_description

I think it is not recommended to change stuff in /opt/ros/indigo/share/turtlebot_description where your turtlebot packages would be stored if you installed them using apt-get. You could clone the package in your catkin workspace and compile/install it by yourself and make the changes there.


Originally posted by Mehdi. with karma: 3339 on 2016-03-21

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by pgigioli on 2016-03-21:
Thank you, this worked! Unfortunately, it did not fix the problem I was having. I am still getting a "Scan Mathcing Failed, using odometry" error when gmapping but that is for another question.

Comment by db on 2017-11-11:
Thank you very much, I was having this problem and couldn't even find if it was an issue with Openni2 or TF or what.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.