Install locally
This page describes how to install GISNav locally on a development computer. With a local non-containerized installation of GISNav it is easier re-test the software without having to rebuild a Docker image and re-deploy a container every time changes are made to the source code.
Deploy with Docker Compose
If you are only interested in running and not developing GISNav, you may want to look at the Docker Compose services instead.
System requirements
These system requirements are intended for SITL simulation on a standalone development computer.
Operating system
The development computer should be running Ubuntu 22.04 (Jammy Jellyfish). Other Ubuntu and Linux releases may also work with some modifications, but are currently untested and therefore unsupported.
Hardware
It is strongly recommended that the development computer have an NVIDIA GPU with CUDA Toolkit and latest drivers installed.
No hard dependency on NVIDIA
The GISNav ROS 2 package itself depends on Torch and should not have a direct dependency on NVIDIA products. GPUs from other vendors may work but also have not been tested. Some of the GISNav Docker Compose services on the other hand may have a direct dependency on NVIDIA.
You can inspect your NVIDIA driver and CUDA versions with the nvidia-smi
command line utility. If you don't have it installed, follow the NVIDIA CUDA Installation Guide for Linux. The output of the nvidia-smi
command should look something like below:
hmakelin@hmakelin-MS-7D48:~/colcon_ws$ nvidia-smi
Sat May 4 08:37:42 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.171.04 Driver Version: 535.171.04 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4060 Off | 00000000:01:00.0 On | N/A |
| 0% 42C P8 N/A / 115W | 506MiB / 8188MiB | 23% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 1918 G /usr/lib/xorg/Xorg 228MiB |
| 0 N/A N/A 2320 G /usr/bin/gnome-shell 35MiB |
| 0 N/A N/A 4528 G ...irefox/4173/usr/lib/firefox/firefox 162MiB |
| 0 N/A N/A 118428 G ...erProcess --variations-seed-version 47MiB |
| 0 N/A N/A 148095 G ...erProcess --variations-seed-version 20MiB |
+---------------------------------------------------------------------------------------+
Install ROS 2 Humble
GISNav is a ROS 2 package, and the supported version is ROS 2 Humble. Install ROS 2 Humble by following the official install instructions.
Setup colcon
workspace
Colcon is a ROS build tool and needed to build GISNav and some of its dependencies from source code.
Create workspace
Create a colcon workspace:
mkdir -p ~/colcon_ws/src
Clone GISNav and dependencies
Clone latest version of GISNav and dependencies to colcon workspace:
cd ~/colcon_ws/src
git clone --branch v0.68.1 https://github.com/hmakelin/gisnav.git
git clone --branch 2.8.0 https://github.com/mavlink/mavros.git
git clone --branch release/1.14 https://github.com/px4/px4_msgs.git
Source workspace
For convenience, source your workspace in your bash profile if you do a lot of development work:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "source ~/colcon_ws/install/setup.bash" >> ~/.bashrc
source ~/.bashrc
Alternatively, simply source it in your current shell:
source /opt/ros/humble/setup.bash
source ~/colcon_ws/install/setup.bash
Test that you have sourced your workspace by listing available packages:
ros2 pkg list
If you see a list of packages, your workspace is probably active.
Install system dependencies
Install system dependencies for your workspace with the following commands:
cd ~/colcon_ws/src
rosdep update
rosdep install --from-paths . -y -r --ignore-src
ROS EOL distros
If you want to use a ROS distribution that has reached end-of-life like Foxy, you can provide the --include-eol-distros
option to rosdep update
.
Install Python dependencies
Warning: Python virtual environments
If you want to use a Python virtual environment for your Python dependencies, check out this issue first. We do not provide instructions here as the workspace might not play nicely with the virtual environment.
GISNav's Python dependencies are divided into core, extended, and development dependencies. You must at least install the core dependencies.
If you know you are not going to use a specific extension such as
NMEANode
, you can skip installing the corresponding Python extra.NMEANode
is required for the mock GPS demo and enables downstream integration of GISNav as a secondary GPS device via the NMEA protocol.The development dependencies are required for various development tasks such as generating documentation and running tests. You do not need to install them if you do not plan to do any development work on GISNav.
Install the required and optional Python dependencies with the following commands:
cd ~/colcon_ws/src/gisnav
pip3 install ./gisnav
cd ~/colcon_ws/src/gisnav
pip3 install ./gisnav[nmea_node,uorb_node]
cd ~/colcon_ws/src/gisnav
pip3 install ./gisnav[dev]
Build workspace
Build the colcon workspace. If you have previously built your workspace and only made changes to GISNav, you may want to only re-build GISNav:
cd ~/colcon_ws
colcon build
cd ~/colcon_ws
colcon build --packages-select gisnav gisnav_msgs
If it's your first time building the workspace, remember to also source the install/setup.bash
script to ensure all your newly built executables and libraries are on the path:
cd ~/colcon_ws
source install/setup.bash
Once GISNav is installed, you can try deploying the development services.