communication problem with Rplidar-A3

asked 2022-03-10 05:03:18 -0600

RH56 gravatar image

updated 2022-03-10 05:10:16 -0600

I have bought a brand new rplidar-A3 in order to navigate my self-made robot. (Ubuntu-Noetic, Ros1).

What works well: The lidar rotates, sends messages over the /scan topic, in Rviz I see the obstacles appear as red lines.

Two things go wrong, which I think are related to the lidar communication:

Problem1: When I launch the basic lidar test, I see the lidar working well in Rviz and entering: rostopic echo /scan ,I see the lidar sending its data stream. However, after a few minutes this data stream suddenly stops as if it were blocked.

My launch files for basic test with Rviz:

<launch>
  <include file="$(find rplidar)/launch/rplidar_a3.launch" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find rplidar_ros)/rviz/rplidar.rviz" />
</launch>

.

   <launch>
      <node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
      <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>  
      <param name="serial_baudrate"     type="int"    value="256000"/><!--A3 -->
      <param name="frame_id"            type="string" value="laser"/>
      <param name="inverted"            type="bool"   value="false"/>
      <param name="angle_compensate"    type="bool"   value="true"/>
      <param name="scan_mode"           type="string" value="Sensitivity"/>
      </node>
    </launch>

Problem2: When I run the lidar with my robot and the DWA planner, everything looks fine in RViz, no errors. But when I create a path using the 2D-Nav_goal arrow, and I enter rostopic echo /cmd_vel I see that the navigator produces zero velocities alternated with correct velocities, which makes the robot shock forward. This goes rather random. And after few minutes, as described in problem 1, the laser’s data stream gets blocked again. Here is just a small part of the velocity stream:

linear: 
  x: 0.25
  y: -0.10000000149011612
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: -0.3199999928474426
---
linear: 
  x: 0.0
  y: 0.0
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: 0.0
---
linear: 
  x: 0.0
  y: 0.0
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: 0.0
---
linear: 
  x: 0.25
  y: -0.10000000149011612
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: -0.3199999928474426

Data stream produced by the lidar (I am showing only fragments of 1 scanning, interrupted by ". . . . ." otherwise it is too long to show here). The range field shows correct numbers but sometimes “inf”. The intensity field shows 47.0 but sometimes zeroes:

---
header: 
  seq: 1826
  stamp: 
    secs: 1646905252
    nsecs:  58410676
  frame_id: "laser"
angle_min: -3.1415927410125732
angle_max: 3.1415927410125732
angle_increment: 0.0032287694048136473
time_increment: 4.224895019433461e-05
scan_time: 0.08221645653247833
range_min: 0.15000000596046448
range_max: 25.0
ranges: [inf, inf, inf, 1.5499999523162842, 1.5499999523162842, 1.5499999523162842, 1.5499999523162842,  . . . . . . . 
6.335999965667725, 6.328000068664551, 6.328000068664551, 6.328000068664551, 6.328000068664551, 6.4079999923706055, 6.4079999923706055, 6.791999816894531, 6.791999816894531, 6.791999816894531, 6.74399995803833, 6.71999979019165, 6.71999979019165, 6.271999835968018, 6.127999782562256, 6.127999782562256, 6.127999782562256, 6.0320000648498535, 6.039999961853027, 6.039999961853027, 6.072000026702881, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf ...
(more)
edit retag flag offensive close merge delete