# omo\_r1mini 패키지 설치

{% hint style="info" %}
본 페이지는 ROS melodic 버전 용으로 만들어진 omo\_r1mini 패키지를 PC와 Jetson Nano에 설치하는 법을 다룹니다.
{% endhint %}

{% hint style="warning" %}
본 페이지의 내용은 여러분이 어디에 omo\_r1mini 패키지를 설치할 것인지 유의해서 따라해야 합니다.
{% endhint %}

## Github 주소

* 아래 본문에서 R1mini의 소스 코드 주소라고 하면 아래의 github 주소를 의미합니다.
* <https://github.com/omorobot/omo_r1mini>

## PC에 OMO R1mini 패키지 설치&#x20;

### PC에 ROS 설치&#x20;

* 혹시 자신의 PC의 아직 ROS가 설치되지 않은 분들은 우분투 18.04를 설치한 후 ROS melodic 버전을 설치하시기 바랍니다.

{% embed url="<https://youtu.be/FI3mEt2zCtA>" %}
PC에 ROS Melodic 설치하는 법&#x20;
{% endembed %}

### R1mini ROS melodic 패키지 github에서 받기&#x20;

![](/files/-MS5b-a0akUzB9MOEo7L)

* 워크스페이스 안의 src 폴더로 이동합니다.

![](/files/-MS5bv_fN7FzVsWyrVgn)

```
git clone https://github.com/omorobot/omo_r1mini
```

* R1mini의 소스 코드를 git clone 명령을 이용해서 받습니다.&#x20;
* 추후 소스 코드가 업데이트 되면 git pull 명령으로 업데이트 된 소스 코드를 받을 수 있습니다.

### Dependency 설치&#x20;

```
sudo apt-get install ros-melodic-tf ros-melodic-joy \
ros-melodic-teleop-twist-joy \
ros-melodic-teleop-twist-keyboard \
ros-melodic-laser-proc ros-melodic-rgbd-launch \
ros-melodic-depthimage-to-laserscan \
ros-melodic-rosserial-arduino ros-melodic-rosserial-python \
ros-melodic-rosserial-server ros-melodic-rosserial-client \
ros-melodic-rosserial-msgs ros-melodic-amcl \
ros-melodic-map-server ros-melodic-move-base \
ros-melodic-urdf ros-melodic-xacro ros-melodic-usb-cam \
ros-melodic-compressed-image-transport \
ros-melodic-rqt-image-view ros-melodic-gmapping \
ros-melodic-navigation ros-melodic-interactive-markers \
ros-melodic-ar-track-alvar ros-melodic-ar-track-alvar-msgs 
```

* 위 명령으로 R1mini를 구동하기 위한 관련 패키지를 설치합니다.

### build

![](/files/-MS5dWjZIhKH_dBwBY0s)

* 워크스페이스로 이동하여 catkin build 명령으로 패키지를 빌드합니다.

## Jetson nano에 설치&#x20;

{% hint style="info" %}
OMO R1mini는 주행용 로봇이므로 내 PC와 로봇 모두 ROS와 OMO R1mini의 ROS 패키지가 설치되어야 합니다. 로봇(R1mini)은 유저에 따라 Jetson nano일 수도 있고, Raspberry Pi일 수도 있습니다.
{% endhint %}

{% hint style="success" %}
Jetson nano 이미지를 <https://www.dropbox.com/s/955eac4ffhbajyu/jetson_210720.img?dl=0> 에서 다운로드하여  [![balenaEtcher](https://firebasestorage.googleapis.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MK7gxD_6rkqAewni4tk%2Fuploads%2FqchvUclcJPT8libiBIic%2Ffile.svg?alt=media)](https://www.balena.io/etcher) 같은 프로그램을 사용하여 sdcard에 이미지를 구워서 설치하면 아래 과정을 건너뛸 수 있습니다.
{% endhint %}

### Jetson nano에 ROS 설치&#x20;

Jetson nano에는 현재 기준 Jetpack 4.5 버전을 설치할 수 있습니다.\
Jetpack 4.5를 설치하면 Ubuntu 18.04와 CUDA 관련 드라이버가 모두 설치되어 편리합니다.\
여러분은 Jetpack 4.5를 설치한 후 아래 동영상처럼 ROS를 설치하면 됩니다&#x20;

* 만약 YOLOv3를 기동한다면, 아래 동영상처럼 Jetpack 4.5를 설치한 후 OpenCV 4버전을 제거하고 OpenCV 3.4를 설치한 후에 ROS melodic을 설치해야 합니다.

{% embed url="<https://youtu.be/PSNzSujz-Fg>" %}
Install Melodic on Jetson Nano
{% endembed %}

### UDEV 설정&#x20;

ROS는 다수의 USB 장치와 연결될 수 있는데 이때 장비 연결의 혼선을 막기 위해 UDEV 설정을 하게 됩니다. R1mini도 설정을 할 수 있도록 설정 파일을 제공합니다.

바로 omo\_r1mini\_bringup 패키지의 scripts 폴더에 udev 설정을 위한 sh 파일이 있습니다.

![](/files/-MWgzbdhvuTw8iH9NHLE)

해당 파일은 sudo 명령으로 실행합니다.&#x20;

![](/files/-MWgzzJewGn0gLR4m4y-)

그리고 아 두 명령을 실행합니다. 중간에 암호를 입력하는 곳이 있으니 조심해야 합니다.

```
systemctl stop nvgetty
systemctl disable nvgetty
```

![](/files/-MWh-CaX-1vmMsTxjuUt)

마지막으로 아 명령을 실행한 후 재부팅을 하면 됩니다.

```
udevadm trigger
```

재부팅 후 ls /dev/tty\* 명령으로 연결된 장치 목록을 보면 ttyLiDAR라는 포트가 생성된 것을 확인할 수 있습니다.

![](/files/-MWh-UuNhCJEBii_5KjK)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://omorobot.gitbook.io/manual/product/omo-r1mini/ros/ros1-melodic/install-r1mini-pkg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
