[ROS Q&A] 122 – How to show laser data on Rviz

laser_data_on_Rviz_capture

Written by Ricardo Tellez

15/05/2018

 

In this video, we are going to answer a question found at ROS answers (https://goo.gl/ws2Whw). The person is asking why he cannot show the laser data of a fake laser given that he is publishing the proper frame and even a static transform from the laser to map.
Very simple and surprise answer!

Step 1. Create project

Instead of installing and configuring a ROS environment locally, we can easily reproduce this question in ROS Development Studio. You can register an account for free now! After signing up and creating a new project, we can clone the repo provided in the question into the workspace. Open a Shell window in the Tools tab and type the following command:

$ cd catkin_ws/src 

$ git clone https://github.com/erenaud3/fakeLaserScan 

You can use IDE tools to check the source tree.

 

Step 2. Compile and Run

It seems the code is mostly correct. Let’s compile it first by typing the following command in the shell.

$ roscd; cd ..

$ catkin_make

$ source devel/setup.bash

Then we launch the fakeLaserScan.launch file in the package.

$ roslaunch beginner_tutorials fakeLaserScan.launch

Step 3. Check if the topic is publishing correctly

To check if the node we just launched really publishing something, we open another shell and type

$ rostopic echo -n1 /fakeScan

The fakeScan topic is publishing.

Let’s check it further with Rviz by typing.

$ rosrun rviz rviz

1.In order to see Rviz running in the RDS, open the Graphical Tools in the Tools Tab.

2.Add a LaserScan visualization.

3. The visualization is not showing due to some problems with the frame.

4. Let’s change the fixed frame to the fake_laser_frame

Now everything looks fine but the laserscan still not showing.

How come?

It turns out, in this particular example, it’s not showing simply because the size of the visualization is too small to be seen. Let’s change the size.

Takeaway Today:

  1. You can check if one topic is publishing correctly by typing rostopic echo /TOPICNAME
  2. If you want to check the topic in RViz, remember to select correct topic type, correct frame and choose a proper size!

 

If you want to learn more about ROS, we have ROS courses for different levels available in Robot Ignite Academy. You can preview any of them for free.

 

Edit by Tony Huang

[irp posts=”7406″ name=”ROS Q&A | How to merge data from two different lasers”]

// RELATED LINKS
▸ ROS answers question: https://goo.gl/ws2Whw
▸ ROS Development Studio: https://goo.gl/Mx18Zn
▸ Robot Ignite Academy: https://goo.gl/XFkCpk
▸ ROS Navigation in 5 days online course: https://goo.gl/AV4hv4

Topics: laser | RViz
Masterclass 2023 batch2 blog banner

Check Out These Related Posts

129. ros2ai

129. ros2ai

I would like to dedicate this episode to all the ROS Developers who believe that ChatGPT or...

read more

0 Comments

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This