Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 103 additions & 54 deletions docs/integrations/lidars/slamtec-rplidar-s3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,38 @@ keywords:
description: >-
Learn how to connect an RPLiDAR S3 sensor to your Leo Rover for 2D mapping and
more. Detailed tutorial mechanical and software integration.
# TODO: Replace with a proper image of Leo Rover with mounted RPLIDAR S3
image: /img/robots/leo/integrations/rplidar-s3/rplidar-s3.webp
---

# SLAMTEC RPLIDAR S3 Integration

import Product from '@site/src/products/powerbox.mdx';
import Product from '@site/src/products/slamtec-rplidar-s3.mdx';
import Powerbox from '@site/src/products/powerbox.mdx';
import LiteYouTubeEmbed from 'react-lite-youtube-embed';

This tutorial will guide you through the process of connecting a LiDAR sensor to
your Leo Rover.

Light Detection and Ranging devices, or lidars for short, are mechanisms used
for mapping the environment, object detection, tracking the speed of vehicles
and in a wide range of other applications. In robotics 2D lidars, like A2M8 /
A2M12, are used for things such as indoor SLAM
([Simultaneous localization and mapping](https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping))
or safety systems.

{/* TODO: Replace with a proper image of Leo Rover with mounted RPLIDAR S3 */}
<ImageZoom
loading="eager"
src="/img/robots/leo/integrations/rplidar-s3/rplidar-s3.webp"
alt="Leo Rover with mounted SLAMTEC RPLIDAR S3"
width="536"
height="500"
figStyle={{
width: 400,
}}
/>

# SLAMTEC RPLIDAR S3 Integration

This tutorial will guide you through the process of connecting a LiDAR sensor to
your Leo Rover.

Light Detection and Ranging devices, or lidars for short, are mechanisms used
for mapping the environment, object detection, tracking the speed of vehicles
and in a wide range of other applications. In robotics 2D lidars, like A2M8 /
A2M12, are used for things such as indoor SLAM
([Simultaneous localization and mapping](https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping))
or safety systems.

## What to expect?

After finishing the tutorial you should be able to both gather the lidar data
Expand All @@ -49,15 +53,23 @@ and visualize it using RViz. Just like in the image below:
<ImageZoom
loading="eager"
src="/img/robots/leo/integrations/rplidar-a2/rviz-map-lidar.webp"
alt="RViz visualization of RPLIDAR S3 scan data on Leo Rover"
width="935"
height="578"
/>

The robot will publish
[LaserScan messages](https://docs.ros2.org/latest/api/sensor_msgs/msg/LaserScan.html)
on the `/scan` topic.

## Prerequisites

Below is the list of all necessary tutorials and hardware components required to
complete the integration.

<LinkButton
to="/leo-rover/guides/ssh"
title="Connect via SSH"
title="Connect to Leo Rover via SSH"
description="Learn how to establish an SSH connection with your Leo Rover and access its
terminal using Putty or OpenSSH."
/>
Expand All @@ -68,55 +80,86 @@ and visualize it using RViz. Just like in the image below:
additional functionalities, building ROS packages and more."
/>

## List of components
### Referenced products

<Product />

## Hardware integration

### Mounting

If you bought the integration kit, you can use the mounting adapter included in
the kit. It is designed to mount the sensor on top of the rover's mounting plate,
providing a wide field of view with minimal obstructions.

Required components:

- RPLidar S3
- RPLidar S3 adapter plate (can be found here:
[Addon adapters](../addon-adapters#rplidar-s3-adapter))
- M5x10 Allen head screw x4
- M2.5x6 Allen head screw x4
- RPLidar S3 adapter plate (included in the integration kit)
- M5x10 Allen head screws x4
- M2.5x6 Allen head screws x4

## Mechanical integration
To mount the sensor:

We developed 3D printable models of mechanical interfaces that allow you to
mount the aforementioned sensor to the mounting plate of the rover. Locating the
sensor at the top of the robot provides a wide field of view with not many
obstacles for the laser beam to get caught on. Get the files from here:
[Addon Adapters](../addon-adapters/).
1. Align the RPLIDAR S3 with the adapter plate and secure it using 4 x M2.5x6
Allen head screws — one in each corner of the sensor base.
2. Place the assembled sensor on the top of the Leo Rover's mounting plate.
3. Fasten the adapter plate to the rover using 4 x M5x10 Allen head screws.

- With 4 x M2.5x6 Allen screws, connect the sensor to the printed interface
plate.
- Use 4 x M5x10 Allen screws to fasten the sensor to the Leo Rover.
:::tip

If you don't have the integration kit, you can also 3D print the adapter plate
yourself. Get the files from the [Addon Adapters](../addon-adapters#rplidar-s3-adapter) page.

:::

:::note

The URDF model provided in this guide assumes the sensor is mounted using our
adapter plate in the default position on top of the rover. If you mount the
sensor in a different position, you will need to adjust the origin values in the
URDF file accordingly so that the sensor is correctly positioned in the robot
model.

:::

## Wiring and electronics connection
:::info

When positioning the sensor, make sure the laser beam's 360° field of view is
not obstructed by cables, antennas, or other parts of the rover.

:::

The sensor can be connected to the robot's main computer via the USB socket
positioned at the top of the rover. If your USB cable is long it might get into
lidars field of view if it sticks up too much. try to hide it in the empty space
inside Leo Rovers back frame. Just like on the photo below:
### Wiring

The RPLIDAR S3 uses a TTL interface and comes with a TTL-to-USB adapter. To
connect it to Leo Rover 1.9, use the following chain:

1. Plug the TTL cable from the sensor into the **TTL-to-USB adapter** (included
with the lidar).
2. Connect the **micro USB to USB-A cable** (included with the lidar) to the
micro USB port on the adapter.
3. Use the **USB-A to USB-C adapter** (included with Leo Rover) to connect the
cable to the **USB-C port** on top of the rover.

<ImageZoom
src="/img/robots/leo/integrations/rplidar-a2/leo-with-rplidar-s3.webp"
alt="Leo Rover with RPLIDAR S3 wired via USB"
width="1200"
height="800"
figStyle={{
width: 500,
}}
/>

:::info

When mounting the sensor, you should be particularly careful not to obstruct the
field of view by other parts of the Rover.
If the cable is long, try to tuck it into the empty space inside Leo Rover's
back frame to keep it away from the lidar's field of view.

:::

USB connection provides power to the sensor and allows the data transfer. This
means that no external power sources are necessary. Some lidars might need
external power connections, that's when [Powerbox](/leo-rover/addons/powerbox)
might come in handy.
This connection provides both power and data transfer to the sensor, so no
external power source is necessary. However, if you want a cleaner and more
reliable connection, we recommend using the Powerbox addon:

<Product />
<Powerbox />

With everything connected, you are ready to try out your new sensor.

Expand Down Expand Up @@ -169,6 +212,14 @@ In `/etc/ros/robot.launch.xml`:
<include file="/etc/ros/laser.launch.xml"/>
```

The last step is to either reboot the robot or restart the nodes.

```bash
ros-nodes-restart
```

### Modifying the URDF model

Your robot should be aware of where the sensor is located and what space it
occupies. You can ensure it does that by creating a URDF model of the sensor.

Expand Down Expand Up @@ -241,7 +292,7 @@ occupies. You can ensure it does that by creating a URDF model of the sensor.
</robot>
```

And including it in the description that is uploaded at boot.
And include it in the description that is uploaded at boot.

```xml title="/etc/ros/urdf/robot.urdf.xacro"
<xacro:include filename="/etc/ros/urdf/laser.urdf"/>
Expand All @@ -255,13 +306,7 @@ STL or COLLADA format.

:::

The last step is to either reboot the robot or restart the nodes.

```bash
ros-nodes-restart
```

## Examples
## Example usage

### Reading and visualizing the data

Expand Down Expand Up @@ -308,6 +353,7 @@ topic. Choose the **LaserScan** display and click **Ok**.

<ImageZoom
src="/img/robots/leo/integrations/hokuyo-lidar/rviz-laser-scan.webp"
alt="Adding LaserScan topic in RViz"
width="1362"
height="727"
/>
Expand All @@ -322,6 +368,7 @@ which you can use to change the displayed laser.

<ImageZoom
src="/img/robots/leo/integrations/hokuyo-lidar/rviz-laser-color.webp"
alt="Changing LaserScan color in RViz"
width="1362"
height="727"
/>
Expand All @@ -336,6 +383,7 @@ display.

<ImageZoom
src="/img/robots/leo/integrations/hokuyo-lidar/rviz-add-camera.webp"
alt="Adding Camera display in RViz"
width="1364"
height="730"
/>
Expand All @@ -344,6 +392,7 @@ Be sure to select `/camera/image_color` as the Image Topic.

<ImageZoom
src="/img/robots/leo/integrations/hokuyo-lidar/rviz-camera-topic.webp"
alt="Selecting camera image topic in RViz"
width="1365"
height="729"
/>
Expand All @@ -360,13 +409,13 @@ Here's an example end result:
/>
</div>

## What next?
## What's next?

Lidars are commonly used in projects involving
[autonomous navigation](/leo-rover/advanced-guides/autonomous-navigation), you
might be interested in a tutorial about it.

They are however, not the only way of teaching a Leo Rover how to move on it's
They are however, not the only way of teaching a Leo Rover how to move on its
own. Check out our [line follower](/leo-rover/1.8/leo-examples/line-follower)
tutorial if you want to learn more. You can also check our
[Integrations page](/integrations) for more instructions.
11 changes: 11 additions & 0 deletions src/products/slamtec-rplidar-s3.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import ProductPreview from '@site/src/components/ProductPreview';

{/* TODO: Replace imageSrc with a proper product image when available */}
<ProductPreview
shopUrl="https://fictionlab.pl/shop/slamtec-rplidar-s3/"
imageSrc="/img/robots/leo/integrations/rplidar-s3/rplidar-s3.webp"
width={536}
height={500}
title="SLAMTEC RPLIDAR S3"
description="High-performance 2D LiDAR sensor with 360° scanning, ideal for indoor SLAM, obstacle detection, and autonomous navigation on mobile robots."
/>
Loading