Robotics StackExchange | Archived questions

communication problem with Rplidar-A3

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 basic rplidar 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-Navgoal arrow, and I enter `rostopic echo /cmdvel` 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, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, 1.0779999494552612, 1.0779999494552612, 1.0779999494552612, 1.0779999494552612, 1.0779999494552612, 1.0779999494552612, 1.065999984741211, 1.065999984741211, 1.0579999685287476, 1.0579999685287476, 1.0540000200271606, 1.0499999523162842, 1.0499999523162842, 1.0479999780654907, 
. . . . . . . . .

intensities: [0.0, 0.0, 0.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, . . . . . . .
47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 47.0, 
. . . . . . .

Anyone with lidar and Ros knowledge can help me out? Thanks a lot.

Asked by RH56 on 2022-03-10 06:03:18 UTC

Comments

Answers