Skip to content

Develop

Raffaello Bonghi edited this page Sep 6, 2022 · 11 revisions

Before working locally on Nanosaur and editing all scripts working with Docker, there are some steps.

Setup the environment on the host

Install in developer mode nanosaur on your jetson

nanosaur install developer

REMEMBER: you don't need to build these packages from your host

Run docker container

Now you can run and connect to the docker container and edit the source code directly from your host. All changes will appear inside the container.

nanosaur run

After this command, you will be able to edit and rebuild all sourcecode inside the container. If you leave the container, you can press CTRL-D. The Docker container will be destroyed, but all packages modifications will be on the host.

If you want to rebuild a nanosaur docker image follow this link

Work inside the container

The nanosaur packages are in /opt/ros_ws. From this folder, you can work with all ros2 command features.

Hints

  • Rebuild all packages: colcon build --symlink-install
  • Build only a selected package: colcon build --symlink-install --packages-select [PKG_NAME]
  • Run nanosaur: ros2 launch nanosaur_bringup bringup.launch.py

What is mean nanosaur run?

When you run the command on your NVIDIA Jetson nanosaur run this is equivalent to the line below:

docker run --runtime nvidia -it --rm  --network host --device /dev/i2c-0 --device /dev/i2c-1 --device /dev/input -v /tmp/argus_socket:/tmp/argus_socket -v /run/jtop.sock:/run/jtop.sock -v $HOME/nanosaur_ws/src:/opt/ros_ws/src/ nanosaur/nanosaur:latest bash

Option explained:

  • -it means run in interactive mode
  • --rm will delete the container when finished
  • --runtime nvidia will use the NVIDIA container runtime while running the l4t-base container
  • --network host To read all topics outside the container need to share the same network to the host
  • --device load a device in a container, such as the I2C devices and joystick
  • -v is the mounting directory

Reference