Rviz2 not showing lidar points
Hello here,
I'm new to ROS and ROS2, had some time long ago with a turtle bot and did some maze stuff but basically know nothing.
I just finished the beginner part of ROS2 tutorial and currently trying to pop up a lidar, a cheap lfcd2.
I managed to read the serial and installed the official driver and packages. The publishers looks fine to me, since I can see data in /scan topic.
Then I tried to visualize it using Rviz2, but the points doesn't show up. I tried to debug it but not sure whats wrong....
I found some solution to the missing tf issue using
ros2 run tf2_ros static_transform_publisher 1 2 3 0.5 0.1 -1.0 foo bar
It looks like works and my issue on location is gone.
Everything seems fine except my points still shows
Showing [0] points from [0] messages
and topic shows okay.
I then went to check some other people's example, where it should display number of msg, not 'okay'
I can't post photo since I don't have enough points... but here's a part of the /scan data:
header:
stamp:
sec: 1600816175
nanosec: 408355311
frame_id: laser
angle_min: 0.0
angle_max: 6.2657318115234375
angle_increment: 0.01745329238474369
time_increment: 2.990000029967632e-05
scan_time: 0.0
range_min: 0.11999999731779099
range_max: 3.5
ranges:
- 0.0
- 0.2290000021457672
- 0.0
- 0.0
- 0.0
- 0.0
- 1.0720000267028809
- 0.6299999952316284
- 0.6299999952316284
- 0.5460000038146973
- 0.5389999747276306
- 0.5329999923706055
- 0.5410000085830688
- 0.5619999766349792
- 0.3529999852180481
- 0.38600000739097595
- 0.4300000071525574
- 0.4970000088214874
- 0.4909999966621399
- 0.0
- 0.5519999861717224
- 0.5509999990463257
- 0.0
- 0.9210000038146973
- 0.0
- 0.0
- 0.0
- 0.699999988079071
- '...'
intensities:
- 49.0
- 5890.0
- 49.0
- 49.0
- 48.0
- 87.0
- 1509.0
- 3279.0
- 3819.0
- 1305.0
- 2506.0
- 3994.0
- 4187.0
- 3265.0
- 317.0
- 1141.0
- 431.0
- 1263.0
- 1545.0
- 4249.0
- 918.0
- 1811.0
- 46.0
- 2475.0
- 112.0
- 40.0
- 106.0
- 6847.0
- 108.0
- 53.0
- 1880.0
- 4956.0
- 4520.0
- 764.0
- 2983.0
- 4766.0
Are you setting the RVIZ visualization frame to "laser"?
What is Visualization frame? The frame id in the msg is set to laser but i'm not sure about the Rviz part.
Under :"Global Options" there should be a "Fixed Frame" parameter. Make sure this parameter is set to
laser
.I can't change it to laser, so I tried to created a static tf called laser, and it didn't work. Besides that, I can't monitor /scan through rqt too.
ah, I think I was trapped in a stupid issue...... I changed the reliable selection to 'best effort' and the data showed up, looks like my desktop is too messy so it thinks all the points are not reliable I guess....