ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Showing LaserScans with different frames in rviz

asked 2015-06-10 11:51:09 -0500

aga gravatar image

updated 2015-06-10 11:52:21 -0500

Hi all,

I have searched via google for several hours and still haven't found how to do a thing that appeaes very basic to me...

I have two laser scanners and correspondingly two LaserScans in rviz. These scanners have a known transformation defining their position to each other and provide complementary scans.

What I am trying to do is to view both LaserScans in rviz in a common frame (e.g. frame of the first scanner), so I want the LaserScan from the second scanner to be first transformed by a given tf transform to the frame of the first scanner. But the only thing I can do is to show both scans in a common frame defined in Global Options. As my second scanner has a differnt positon and accordingly a differnt view this does not make any sense...

The only possible solution appears to be to transform both scans to point clouds using the transformations but this can be a bit slow if you deal with larger scans.

I wonder if there is really no possibility to define an own reference frame for each LaserScan? If you add Axes to the view you can choose an own reference frame, so the Axes origin can be placed independently...

Thanks in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2015-06-10 12:50:22 -0500

William gravatar image

All you need to do is publish each laser scan message with a different "frame_id" set in the message, see the "header" of this message:

http://docs.ros.org/api/sensor_msgs/h...

Then you need to publish a static transform between the two frame_id's you chose, and you can use the static_transform_publisher for that, see:

http://wiki.ros.org/tf#static_transfo...

Then in rviz set the "fixed frame" to that of parent link. In this case the parent link is the "link1_parent" in the example in the previous link. tf is a tree structure so you always have parent child relationships between links. Another option would be to define a "world" link and then provide static transforms to each of the laser links, where the world link might be at the same position and orientation as one of the laser links. You can use the tf view in rviz to see how you've got it setup and remember to always set the fixed frame to the most parent link in your tf tree.

Hope that helps.

edit flag offensive delete link more
0

answered 2015-06-29 03:04:15 -0500

aga gravatar image

Thanks a lot!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-06-10 11:51:09 -0500

Seen: 1,468 times

Last updated: Jun 29 '15