Skip to content

Slamtec RPLIDAR C1

Some cars use a Slamtec RPLIDAR C1 instead of the Hokuyo. It's a 360-degree lidar that plugs into a USB port and needs no network setup.

Using the RPLIDAR C1

The lidar pane in the teleop and navigation plans picks the driver by itself. When a USB serial device (/dev/ttyUSB*) is plugged in, it starts rplidar_ros on it at 460800 baud. Otherwise it uses the Hokuyo. Both publish the scan on /scan, in the laser frame, so nothing else changes.

The driver is built from Slamtec's source rather than installed from ROS's packages: the packaged version stops at the start of every scan with this lidar.

The container reaches the lidar through /dev/ttyUSB0 and the dialout group, both listed in packages/ut_automata/airfield.yaml (see Device groups). A car without the lidar just skips that device.

Scan direction

The C1's scan starts (0 degrees) on the side opposite the arrow on its top. Mounted with that arrow facing the front of the car, as on utav19, the scan comes in turned around: things in front of the car show up behind it, and the car can't localize. The Hokuyo doesn't have this problem.

To fix it, turn the lidar's frame around by setting rpy="0 0 3.14159265" on the laser_connect joint in ~/roboracer_ws/packages/av_description/urdf/roboracer.urdf.xml:

<joint name="laser_connect" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 3.14159265" />
  <parent link="hokuyo"/>
  <child link="laser"/>
</joint>

Then rebuild the package with scripts/build av_description. To check, put something in front of the car: in Foxglove's 3D view it should appear in front of base_link (positive X).

This depends on which lidar the car has, so keep it as a local change rather than committing it. Set it back to 0 0 0 if the car goes back to a Hokuyo.