SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
101 stars 84 forks source link

Can't visualize point cloud in Rviz2 with Picoscan 100/150 #325

Closed bertulli closed 2 months ago

bertulli commented 4 months ago

Hi all, I'm trying to test and integrate a PicoScan150 LiDAR into my application. To see if the driver is receiving data correctly, I'd like to visualize in Rviz the laser scan. After successfully building the driver repo on Linux with ROS2 Humble, I ran ros2 launch sick_scan_xd sick_picoscan.launch.py hostname:=192.168.0.1 udp_receiver_ip:=192.168.0.8. I can see the point cloud if I connect to the webserver at 192.168.0.1, and after launching the node I can see with ros2 topic echo /scan_fullframe the data being transmitted. However, I can't figure out how to visualize the scan in Rviz2. I tried changing "Global Options > Fixed frame" to "world", but what should I add then? A LaserScan, PointCloud or PointCloud2 display? On which topic? Thanks

rostest commented 4 months ago

Thanks for your feedback. To visualize a point cloud, just start rviz2 (or ros2 run rviz2 rviz2) and add a topic with PointCloud2 messages, e.g. cloud_all_fields_fullframe:

image

The sick_scan_xd driver publishes several point clouds that can be customized in the launchfile. The point cloud on topic cloud_all_fields_fullframe publishes all scan data (fields x, y, z, intensity, range, azimuth, elevation, layer_idx, echo_idx, reflectorbit) of a 360 degree full frame. Use Channel Name to colorize the pointcloud with a field of your choice, e.g. intensity, range, azimuth or elevation angle. ros2 topic list displays a list of all available topics.

Set "Global Options > Fixed frame" to the frame id of the point cloud, which is "world" by default and can be configured in the launchfile. See https://github.com/SICKAG/sick_scan_xd/blob/develop/doc/sick_scan_segment_xd.md#customized-pointclouds for details.

bertulli commented 4 months ago

Thank you for your quick answer, now it works! If you like, I can do a quick PR to add these info in the docs