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

Visualize laserscan usig rviz

asked 2013-04-03 05:02:12 -0500

tommyo gravatar image

Is it possible to visualize a topic of type sensor_msgs/LaserScan using rviz? Currently it complains about not having any frame (which is true, I just have the scan data)... Is there a better way?

Thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2013-04-03 05:13:29 -0500

Ben_S gravatar image

Which laserdriver are you using? Normally every sensor message has a frame attached. (You can find out this frame by using rostopic echo /scan -n 1 --noarr)

If no transforms are published, rviz will not show that frame as a possibility in the Fixed Frame dropdown-menu. But if you just type in the frame-name by hand, rviz should be able to visualize your laserscan.

edit flag offensive delete link more

Comments

I'm not sure what you're getting at, but i found this in the output: frame_id: '' The publishing node a bridge between another system and ROS so if something needs to be added I'm open to that. Thanks.

tommyo gravatar image tommyo  ( 2013-04-03 05:24:17 -0500 )edit

Have you written this bridging node yourself? The header of the message should contain a valid frame name/id (for example laser, try setting laserscan_msg->header.frame_id) and a timestamp.

Ben_S gravatar image Ben_S  ( 2013-04-03 05:39:41 -0500 )edit

Sorry, I am kind of lost when it comes to visualization and the like. What is the simplest thing that could pass as a valid frame? At this point the scanner is just sitting on the desk with no odometry or maps available. Is it possible visualize the environment around a fixed scanner?

tommyo gravatar image tommyo  ( 2013-04-03 06:00:05 -0500 )edit

Like i mentioned, laser would be a valid frame id. You can read this about the naming conventions for frames: http://www.ros.org/wiki/geometry/CoordinateFrameConventions#Naming

Ben_S gravatar image Ben_S  ( 2013-04-03 06:06:20 -0500 )edit
1

Now I get it, and it works fine. Thank you!

tommyo gravatar image tommyo  ( 2013-04-03 08:29:56 -0500 )edit
0

answered 2021-03-18 02:30:01 -0500

  1. Start rviz
  2. Click button "Add" on the bottom left
  3. Add a "LaserScan" Item
  4. Add the topic name of your scan data to the added LaserScan item on property "Topic", e.g. /scan
  5. If there is an error message like For frame [base_scan]: Frame [base_scan] does not exist add property "fixed frame" with value base_scan (name mentioned in the error message) to Global Options on the left.
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-04-03 05:02:12 -0500

Seen: 4,120 times

Last updated: Apr 03 '13