Skip to content

Installation

Marco A. Gutiérrez edited this page Jul 15, 2022 · 22 revisions

There are two options to install and use the LRAUV, you can install it natively on your machine by building the repository from source or you can generate a docker container and work with it instead.

Build From Source

Install Prerequisites

Ideally you want to be running Ubuntu Focal or Jammy on an amd64 architecture.

Gazebo Garden

Gazebo is the toolbox of development libraries for simulation that is used to simulate LRAUV. Gazebo Garden is the version used by LRAUV and needs to be installed first. Instructions on how to compile and install it from source can be found here.

Alternatively, unstable binary packages for Gazebo Garden can also be installed from the nightly Gazebo repositories. Gazebo nightlies are packages released every night which can be used for different purposes like testing the last feature added to gazebo code. The nighly packages repository is designed to work together with the stable repository, so both need to be added:

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list'
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -

After this just update and install the Gazebo Garden metapackage:

sudo apt-get update
sudo apt-get install gz-garden

Colcon

Colcon is the command line tool used to help easily compile and test all the packages in the LRAUV repository.

First, the ROS2 repositories that contain the colcon binary packages need to be enabled:

sudo sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

Then just update an install the colcon packages:

sudo apt-get update
sudo apt-get install python3-colcon*

Extra dependencies

sudo apt-get install libpcl-dev

Get the sources and build

mkdir ~/lrauv_ws/
cd ~/lrauv_ws/
git clone https://github.com/osrf/lrauv.git
colcon build

Developers may want to build tests. Note that this would take longer:

colcon build --cmake-args "-DBUILD_TESTING=ON"

You can pass --cmake-args ' -DENABLE_PROFILER=1' to use the profiler. See more on this tutorial

Generate and use a container for this repository

Optionally, you may choose to build this repository using Docker, for convenience. Make sure you have a recent version of Docker and nvidia-docker installed. Next, simply run the following command:

docker/build_and_run_docker.sh

To join in a separate terminal, remember to source Ignition and the workspace:

docker/join.sh mbari_lrauv
. /home/ign_ws/install/setup.bash
. /home/colcon_ws/install/setup.bash