# Installation of NXP Gazebo

## Setting up SSH keys

{% hint style="info" %}
To use NXP Gazebo, you will need to have a GitHub account. The installation scripts require a GitHub account with an SSH key.
{% endhint %}

### Creating an SSH key

To create an SSH key, run the following in a terminal:

```
$ ssh-keygen
```

Follow the prompt. We suggest just pressing enter until you reach the end. It will be easier if you just use the default path for the id\_rsa file and if you go without a passphrase (though you're welcome to use one!). You should get the output below. Note that the RSA key is not shown here for security reasons:

![](/files/-MXE8XtvCrWVrVwaVWGU)

Next, you'll want to install `xclip`. This program will allow you to copy the contents of the id\_rsa.pub file to your clipboard so you can paste it into GitHub. To install `xclip`, run the following command:

```
$ sudo apt install xclip git
```

Once you've installed xclip, you need to copy the id\_rsa.pub file to your clipboard. To do so, run the following command:

```
$ xclip -sel clip < ~/.ssh/id_rsa.pub
```

### Adding your SSH key to GitHub

Now, log into your GitHub account and paste your SSH key. The SSH key field is located in your account settings under "SSH and GPG keys". Add a new SSH key by pressing "New SSH key" and pasting your SSH key in the box. Make sure to give it a name!

![Black Box added for security](/files/-MXICy5LoBDejoPLh7z6)

Once you've done this, you're ready to begin installation.

## Installing ROS2

To run NXP Gazebo, you must have ROS2 installed. This is an easy process - just follow the commands below:

```
$ mkdir ~/git
$ cd ~/git
$ git clone git@github.com:rudislabs/nxp_install.git
$ chmod a+x nxp_install/install.sh
$ ./nxp_install/install.sh
```

And then source ROS2 by running the following command:

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

## Installing NXP Gazebo

### Cloning and running sim\_gazebo\_bringup

Installing NXP Gazebo has become much easier over time. With this new install process, you'll be up and running with NXP Gazebo in record time!

First, we need to create a ROS2 workspace directory to store the installation files. Go to your home folder and create a new folder called "ros2ws", and a folder inside of that called "src":

```
$ cd ~
$ mkdir -p ros2ws/src && cd ros2ws/src
```

Once you are in the directory `~/ros2ws/src`, it's time to clone the bringup repo. The bringup repo contains code that sets up the workspace for you automatically. To clone it, run the following command:

```
$ git clone git@github.com:rudislabs/sim_ignition_bringup.git
```

When git prompts you to continue connecting with your RSA fingerprint, type yes:

![](/files/-MXIEXUGb9YGWZkKnd1y)

Next, we are going to run `sim_ignition_bringup`. To do this, run the following commands:

```
$ cd ~/ros2ws
$ colcon build --packages-select sim_ignition_bringup --symlink-install
$ echo "source /home/$USER/ros2ws/install/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
```

Now that we have the bringup package set up, we can start installing all of the NXP Gazebo packages. Run the following command:

```
$ ros2 launch sim_ignition_bringup sim_ignition.launch.py
```

## You're finished installing NXP Gazebo!

![](https://thumbs.gfycat.com/CheerySizzlingGuillemot-mobile.mp4)

Now that you have successfully installed NXP Gazebo, you can return to the Milestone 1 page. Use the link below to do so.

{% content-ref url="/pages/-McKP3HsUZtcLlcuNLLi" %}
[Milestone 1 - Intro to NXP Gazebo and ROS](/nxp-cup/gazebo/milestone-1-intro-to-nxp-gazebo-and-ros.md)
{% endcontent-ref %}


---

# 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://nxp.gitbook.io/nxp-cup/gazebo/milestone-1-intro-to-nxp-gazebo-and-ros/installation-of-nxp-gazebo-1.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.
