We are using latest ROS2 Foxy build. When testing lidar it returns data intermittently. For example it returns the correct distance to the object, then the next message a second later the distance is infinity. This carries on and does not settle. Occasionally, we get valid distance data on consecutive readings but mostly the correct reading is only every other time.
This feels like a driver or a timing issue. Any help is greatly appreciated, thank you.
Can i get more details how were you testing lidar? To make sure it is a problem with lidar you can run rplidar_ros package. For ROSbot Pro
ros2 launch rplidar_a3.launch.py. To view results in rviz you also have to broadcast transform for lidar frame:
ros2 run tf2_ros static_transform_publisher 0.0 0.0 0.08 3.14 0.0 0.0 base_link laser
Okay, thank you. I will pass on the answer to our teacher and let you know.
We try to launch rplidar: but package not found error:
husarion@cseerosbot5:~$ source husarion_ws/install/setup.bash
husarion@cseerosbot5:~$ ros2 launch rplidar_a3.launch.py
Package ‘rplidar_a3.launch.py’ not found: “package ‘rplidar_a3.launch.py’ not found, searching: [’/home/husarion/husarion_ws/install/rplidar_ros’, ‘/home/husarion/husarion_ws/install/rosbot_description’, ‘/home/husarion/husarion_ws/install/astra_camera’, ‘/opt/ros/foxy’]”
I guess we need to install it?
Okay, I can run the rplidar_a3.launch.py launch file from the rplidar_ros source launch directory. Please ignore previous message.
I will ask the teacher to try further tests on the lidar data and I let you know.