Ask Your Question

Showing LaserScans with different frames in rviz

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

aga gravatar image

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

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

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

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:

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:

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

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

aga gravatar image

Thanks a lot!

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

1 follower


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

Seen: 973 times

Last updated: Jun 29 '15