Robotics StackExchange | Archived questions

rviz couldn't display laserscan data correctly

I use gazebo as my simulation tool to generate data, and rviz to visualize the data, as I put camera or pointcloud into rviz it works well, but when it comes to laserscan it dosen't. I try to look into the information of the topic of laserscan, it tells me the topic was subscribed by rviz already, I don't know where the problem is? Furthermore, I use "rostopic echo /scan" to check out the data of the topic, then ranges are all -inf and intensities are all 1.0, was that normal? What should I do? Thank you in advance

Asked by jintongxing on 2018-05-17 06:19:25 UTC

Comments

If all the range measurements of the laser scan are -inf then there are not valid measurements so there will be nothing to show in RVIZ. Is there anything blocking it's view in Gazebo or has it accidentally been placed inside an object?

Asked by PeteBlackerThe3rd on 2018-05-17 09:04:55 UTC

No, I tried to move the robot, it still has no response as the pointcloud and camera performs well....

Asked by jintongxing on 2018-05-17 09:09:05 UTC

What sensors do you actually have in Gazebo? Where is the point cloud coming from, and where is the laser scan coming from?

Asked by PeteBlackerThe3rd on 2018-05-17 09:11:18 UTC

I use xbot robot with camera and lidar, the point cloud subscribes the topic /camera/depth/image_raw and laser scan comes from /scan

Asked by jintongxing on 2018-05-17 21:55:33 UTC

Answers

Okay, if viewing the /scan topic using rostopic echo shows that all the range measurements are inf then there is no valid scan data. So RVIZ is doing exactly what it should do by showing nothing.

Something is not setup correctly in Gazebo in this case, do you see any lidar rays being shown in the Gazebo GUI? I recommend you to double check the setup of the lidar sensor and to check it's not inside any other geometry.

Asked by PeteBlackerThe3rd on 2018-05-18 04:54:25 UTC

Comments

I think you are close to the real truth. Under the gazebo/world/model/xbot-u, I found "base_footprint""yaw_platform""pitch_platform"""left_wheel""right_wheel""base_to_yaw_platform""yaw_to_pitch_platform""left_wheel_hinge""right_wheel_hinge" only, then could you please tell me how can I check lidar?

Asked by jintongxing on 2018-05-18 10:28:31 UTC

I got my model from here https://github.com/DroidAITech/ROS-Academy-for-Beginners.git

Asked by jintongxing on 2018-05-18 21:59:02 UTC

Okay, now I have solved this problem by changing a file of my robot model, THANKS.

Asked by jintongxing on 2018-05-19 08:04:34 UTC

Glad you've got it working. Can you accept this answer if it helped you solve the problem, thanks.

Asked by PeteBlackerThe3rd on 2018-05-20 17:09:15 UTC