Skip to content

Installation

Carlos Agüero edited this page Oct 5, 2022 · 22 revisions

There are two options to install and use the LRAUV:

  1. Build From Source
  2. Generate and use a container

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.

NOTE: The latest source in this repository will need specific changes on some of the gazebo libraries. Instead of the Gazebo Garden collection file it is recommended to use the following one when getting the sources:

wget https://raw.githubusercontent.com/osrf/lrauv/main/docker/base/gz-garden.yaml

If you compile Gazebo from source, you should also export your PYTHONPATH to find the Python wrappers:

export PYTHONPATH=$PYTHONPATH:<path to your workspace>/install/lib/python

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

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 Gazebo and the workspace:

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