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

# Running of AIM 2024 software stack

Guide to run simulation setup for NXP AIM CHALLENGE.

To run the simulation, run the following commands in a new Terminal Window

```
$ ros2 launch b3rb_gz_bringup sil.launch.py world:=Raceway_1
```

Running this will launch the gazebo simulation and Xterm window as follows:

![](https://1677675178-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWeiLnwrIKZJWLFsXhf%2Fuploads%2Fgit-blob-92988ef447b360263f6b0ab8eb9c31a17f3fe501%2Fsample_world_0.png?alt=media)

![](https://1677675178-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWeiLnwrIKZJWLFsXhf%2Fuploads%2Fgit-blob-a971ca30b9c891cc13a704083a1885e14a2811c3%2Fsample_world_1.png?alt=media)

![](https://1677675178-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWeiLnwrIKZJWLFsXhf%2Fuploads%2Fgit-blob-25fb9b2f9417feecaf0072364b559af78a850a22%2Fsample_world_2.png?alt=media)

On a different terminal run the following code:

```
$ source ~/cognipilot/cranium/install/setup.bash
$ ros2 run b3rb_ros_line_follower vectors
```

On a different terminal run the following code:

```
$ source ~/cognipilot/cranium/install/setup.bash
$ ros2 run b3rb_ros_line_follower runner
```

On a different terminal run the following code:

```
$ source ~/cognipilot/cranium/install/setup.bash
$ ros2 run b3rb_ros_line_follower detect
```

***Running the above 3 commands should make the buggy move autonomously now in simulation.***

{% hint style="danger" %}
If on execution of any \_*ros2 run b3rb\_ros\_line\_follower* gives error like below, it means that sourcing of setup.bash was unsuccesful
{% endhint %}

![](https://1677675178-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWeiLnwrIKZJWLFsXhf%2Fuploads%2Fgit-blob-f64537d9b1ecc4c2dc5e752f9327c5560fd5350e%2Fline_follower_fail.png?alt=media)

## Troubleshooting

If after successful installation done on step-6, one is still facing issue on executing ros2 run b3rb\_ros\_line\_follower vectors/detect/runner commands, then please make sure that the packaage installed in /cognipilot/cranium/src for br3b\_ros\_line\_follower is same as this folder: <https://github.com/NXPHoverGames/NXP\\_AIM\\_INDIA\\_2024/tree/main/b3rb\\_ros\\_line\\_follower>

There seems issue from github side, where it is clonning previous unstable commit files and will cause issue. Please repalce the content with the content available on github and re-build the setup and try running again.

If issue is still not resolved try this approach: Please clone the setup from <https://github.com/NXPHoverGames/NXP\\_AIM\\_INDIA\\_2024/tree/main> and manually follow steps given here: <https://github.com/NXPHoverGames/NXP\\_AIM\\_INDIA\\_2024/tree/main?tab=readme-ov-file#execution-steps>
