Ask Your Question
1

How do you change the coordinates of the laser frame?

asked 2016-03-21 09:51:50 -0500

pgigioli gravatar image

updated 2016-03-21 11:22:25 -0500

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!!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-03-21 12:36:03 -0500

Mehdi. gravatar image

updated 2016-03-21 12:39:59 -0500

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.

edit flag offensive delete link more

Comments

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.

pgigioli gravatar image pgigioli  ( 2016-03-21 13:11:25 -0500 )edit

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.

db gravatar image db  ( 2017-11-11 18:59:11 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-03-21 09:51:50 -0500

Seen: 670 times

Last updated: Mar 21 '16