# Camera \[Melodic]

![Camera on R1mini. Image courtesy of Omorobot](https://3827101858-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McPC4jDSGGTd1f6bAav%2F-MdX0KNA21GxtFCNhf7x%2F-MdX0rWDbELwBBNX0CiD%2Fr1camera.png?alt=media\&token=9bbddff7-1c82-4019-bff7-76b213bc34b9)

## Download package

{% hint style="info" %}
When receiving your R1mini, this package should already be downloaded. To run the camera, move to the next section titled "Run Camera".
{% endhint %}

First make sure you are in the \~/catkin\_ws/src directory. Then, download the cv-bridge by entering the below code to the terminal shell.

```
$ sudo apt install ros-melodic-cv-bridge*
```

Next, run the below code to install the Camera package from Github for the R1mini.

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

Next, move to \~/catkin\_ws. Then, build the package on your robot by running the following code. This process may take a minute or two.

```
$ catkin build jetson_camera
```

{% hint style="warning" %}
If you have an error when running the above code, continue reading this section, if not, run source \~/.bashrc in the terminal shell and move on to "Run Camera".
{% endhint %}

If there was an error, enter the below command in the terminal shell.

```
$ sudo nano /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
```

![](https://3827101858-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McPC4jDSGGTd1f6bAav%2F-Me7GwEqq8UMGF02SVjT%2F-Me7LnzPp_UlVcF54Ozp%2FIMG_1708.jpg?alt=media\&token=46c5437a-294a-4e50-b3d8-c2e306fc44ac)

Then, scroll down to line 94 and replace the line that reads set (\_include\_dirs "include;/usr/include;/usr/include/opencv") to the below line.

```
_include_dirs "include;/usr/include;/usr/local/include/opencv"
```

Next, run the below line.

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

## Run Camera

To run the camera, run the below line in the command line. You can use autocomplete by pressing "Tab".

```
$ roslaunch jetson_camera jetson_camera.launch
```

To see the view from the camera, run the below line in a new terminal tab to open rqt\_imag&#x65;*\_*&#x76;iew.

```
$ rqt_image_view
```

![Image courtesy of Omorobot.](https://3827101858-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-McPC4jDSGGTd1f6bAav%2F-Me3wPsR_lVrbye18Ll8%2F-Me4-8QiB5Oi4WwJlRuJ%2F%E3%85%8A%E1%84%86%E1%85%B3%E1%86%AE%E3%84%B1%E3%85%81.png?alt=media\&token=f381cce4-a074-4d31-a33b-8fe2629d6722)

Running rqt\_image\_view, a pop-up GUI should appear like above and display the view from the jetson camera.
