Ask Your Question
0

Laser Scan display doesn't shows data from a sensor_msgs/LaserScan message.

asked 2018-04-06 05:48:58 -0500

stefanvan gravatar image

updated 2018-04-07 07:52:58 -0500

Based on this page, I have set a subscription to the /scan topic in rviz. Why isn't my rviz interface showing some lines like what this video's rviz shows? image descriptionimage description

edit retag flag offensive close merge delete

Comments

Could you please provide the output of the rostopic list?

dljubic gravatar image dljubic  ( 2018-04-07 07:10:29 -0500 )edit

@dljubic I just uploaded the picture you said.

stefanvan gravatar image stefanvan  ( 2018-04-07 07:53:39 -0500 )edit
1

Have you checked if something is published on the topic?

ce_guy gravatar image ce_guy  ( 2018-04-07 08:22:30 -0500 )edit

@jn-chen please don't post an image for text. Images are not searchable and people cannot copy and paste the text from the image.

jayess gravatar image jayess  ( 2018-04-07 20:09:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-07 14:10:28 -0500

dljubic gravatar image

I will provide a general answer that could be helpful in this situation along with many other, similar situations.

If nothing is happening (or nothing is to be seen like in your case), first check rostopic list. If the topic that is causing you the problems present on the list, try rostopic echo <topic> or in your case rostopic echo /scan.
If nothing is published on the topic, you should then dorostopic info <topic> and check which node is responsible for the messages published to the topic.

Then, you should do rosnode info <node>, and set the node as the one responsible for publishing on the topic. Next, you should see if the node needs some data in order to publish to the problematic topic. What I want to say is, maybe the node publishing the /scan needs more information before it actually sends messages to the topic.

As a suggestion, you should always know exactly which node publishes which topics and how. Usually, problems like this are results of not really being sure why is something published and how exactly your nodes work.

Please check all the thing I've said and let me know if it helps.

If you have any further questions, feel free to ask and I will edit my answer.

edit flag offensive delete link more

Comments

@dljubic I just tried using rostopic echo /scan, then a lot of 0.0 were shown on the terminal.

Here is the output of rostopic info /scan:

Type: sensor_msgs/LaserScan

Publishers: * /gazebo ( http://dauker-asus:42515/ )

Subscribers: None

stefanvan gravatar image stefanvan  ( 2018-04-07 23:42:47 -0500 )edit
  1. In rviz, go on Add->By topic and find the scan topic. Try to add that topic and see if anything changes.
  2. Furthermore, be careful where you put the laser in gazebo. Maybe its position is such that it measures all the distances to be zero. Change the position of the laser and echo/scan again.
dljubic gravatar image dljubic  ( 2018-04-08 00:55:30 -0500 )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

1 follower

Stats

Asked: 2018-04-06 05:48:58 -0500

Seen: 1,819 times

Last updated: Apr 07 '18