Ask Your Question

Not getting laser scan runing libgazebo_ros_gpu_laser plugin

asked 2019-06-23 01:11:11 -0600

logan.ydid gravatar image

updated 2019-06-23 12:35:53 -0600

Hello all,

I have been following the tutorials in the book Programming Robots with ROS and I am on the part on page 306 where we create a simulation of the robots laser scanner in gazebo. My goal is to use what I learn from the book to be able to make my own autonomous robot for school. The computer I will be using in my final robot doesn't seem to be powerful enough to run gazebo and rviz. Thus I am trying to split all the code up so that the robot computer runs all the navigation and everything that would be on the robot itself while the simulation is running on my beefier machine. i am running ROS Kinetic and Ubuntu on both

With that said the problem I am running into is that when I run the simulation I can't see any data from the laser scanner in rviz. To investigate, I ran rostopic echo /scan and this is what I got back

  seq: 7178
    secs: 180
    nsecs: 212000000
  frame_id: "hokuyo_link"
angle_min: -1.57079994678
angle_max: 1.57079994678
angle_increment: 0.00436940183863
time_increment: 0.0
scan_time: 0.0
range_min: 0.10000000149
range_max: 30.0
ranges: [-inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf, -inf ...
edit retag flag offensive close merge delete


Did you ever get it to work? What computer and GPU were you running it on?

tropic gravatar image tropic  ( 2020-10-15 16:52:29 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-23 23:10:30 -0600

cassini.huygens gravatar image

If I understand you well you are trying to see the output of your 2D laser scan. Is your world empty? if so there is not object to reflect back the laser points therefore your laser /scan message will include nothing but infinity distance measured by the laser (there is no object to return back any laser points). Also as a good rule of thumb, when you visualize it in rviz make sure you are on the right tf tree. (i.e. base_link)

edit flag offensive delete link more


thank you for your reply! the tutorial says to start in an empty world and place items in front of the robot to see the laser lines in RViz. i also tried placing the robot in the willowGarage example world (commented in my code). in both instances the output from rostopic was as seen above. what do you meen by make sure youre on the right tf tree?

logan.ydid gravatar image logan.ydid  ( 2019-06-25 21:03:18 -0600 )edit

Display->Global Option->Fixed Frame: make sure in this section in rviz, you are on your base_link frame of your robot. What's your rosrun rqt_tf_tree rqt_tf_tree? so you can see all inf being printed at your terminal when your rostopic echo the laser topic?

cassini.huygens gravatar image cassini.huygens  ( 2019-06-26 16:44:13 -0600 )edit

My rviz configuration is as you said. I ran tf_ tree (see image here) the hokuyo_link is coming off of the base_link but I notice there are 0 transforms. What does this mean? And yes no matter what I do to the robot in gazebo I show all inf in rostopic.

logan.ydid gravatar image logan.ydid  ( 2019-06-26 19:41:26 -0600 )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



Asked: 2019-06-23 01:11:11 -0600

Seen: 235 times

Last updated: Jun 23 '19