> For the complete documentation index, see [llms.txt](https://kairosiann.gitbook.io/r1mini/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kairosiann.gitbook.io/r1mini/running-r1-mini/slam-melodic.md).

# Lidar \[Melodic]

Lidar and SLAM for R1mini in ROS1 Melodic

## Running the Lidar (YDLIDAR)

![Image courtesy of Omorobot.](https://3827101858-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McPC4jDSGGTd1f6bAav%2F-MdX4_0edszXTg06ugJL%2F-MdX7Z1_eB0e3qxnuwI0%2Fyd.png?alt=media\&token=0e5ac0d6-a36a-403c-92b5-982a6d26c7e7)

#### Download package

In the command line in the \~/catkin\_ws/src directory, run the below code to clone the R1mini package to use the lidar.

```
$ git clone https://github.com/PinkWink/ydlidar
```

Next, return to \~/catkin\_ws/ and run the below two lines.

```
$ catkin build
```

```
$ source ~/.bashrc
```

#### Running the Lidar (YDLIDAR)

Run the below command to run the lidar separately. Note, when the omo\_r1min&#x69;*\_*&#x72;obot.launch command is run, the lidar will be activated too and these following steps are not necessary.

{% hint style="info" %}
Only run this command if omo\_r1mini\_robot.launch is not running. This command will also activate the lidar.
{% endhint %}

```
$ roslaunch omo_r1mini_bringup omo_r1mini_lidar.launch
```

![](https://3827101858-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McPC4jDSGGTd1f6bAav%2F-MeaNjXHw4H-pawQaykZ%2F-MeaO8chHR5GLbTtQwVl%2FScreen%20Shot%202021-07-15%20at%204.00.32%20AM.png?alt=media\&token=2f496c1f-136f-48e6-bb6e-5b1411fb53af)

The terminal output should look something like the image above. An error may occur like above, give the robot a few seconds, and you should be able to hear the lidar turn on, see the green text above, and value outputs in grey.

## Video Demonstration

View the video demonstration for this page with this link: <https://www.youtube.com/watch?v=mIlVa8JqOrg>
