MoveIt 2 Source Build - Linux

Installing MoveIt 2 from source is the first step in contributing new features, optimizations, and bug fixes back to the open source project. Thanks for getting involved!

MoveIt is mainly supported on Linux, and the following build instructions support in particular:

  • Ubuntu 20.04 / ROS 2 Foxy Fitzroy (LTS)
  • Ubuntu 20.04 / ROS 2 Galactic Geochelone
  • Ubuntu 22.04 / ROS 2 Humble Hawksbill (Recommended LTS)
  • Ubuntu 22.04 / ROS 2 Rolling Ridley (Continuously Updated)

In the future, we would like to expand our source build instructions to more OS’s, please contribute instruction write-ups to this repo.

These instructions assume you are running on Ubuntu 22.04 (Humble, Rolling), or Ubuntu 20.04 (Foxy, Galactic).

Prerequisites

Install

Install ROS 2 Foxy, Galactic, Humble, or Rolling following the installation instructions. We recommend Humble for stable latest LTS distribution needs, and Rolling for contributing to MoveIt 2. Currently the main branch of MoveIt 2 is supported on both Rolling and also Humble, but since it’s used for latest development, it’s unstable. For stable versions, please use the distro branches foxy, galactic, or humble.

Use the desktop installation and don’t forget to source the setup script.

Make sure you have the latest versions of packages installed:

sudo apt update
sudo apt dist-upgrade
rosdep update

Source installation requires various ROS2 build tools and optionally clang-format:

sudo apt install -y \
  build-essential \
  cmake \
  git \
  libbullet-dev \
  python3-colcon-common-extensions \
  python3-flake8 \
  python3-pip \
  python3-pytest-cov \
  python3-rosdep \
  python3-setuptools \
  python3-vcstool \
  wget \
  clang-format-10 && \
# install some pip packages needed for testing
python3 -m pip install -U \
  argcomplete \
  flake8-blind-except \
  flake8-builtins \
  flake8-class-newline \
  flake8-comprehensions \
  flake8-deprecated \
  flake8-docstrings \
  flake8-import-order \
  flake8-quotes \
  pytest-repeat \
  pytest-rerunfailures \
  pytest

Create Workspace and Source

Create a colcon workspace:

export COLCON_WS=~/ws_moveit2/
mkdir -p $COLCON_WS/src
cd $COLCON_WS/src

Download Source Code

Download the repository and install any dependencies. Issue the relevant commands for your ROS distribution.

Foxy, Galactic, Humble - stable

git clone https://github.com/ros-planning/moveit2.git -b $ROS_DISTRO
for repo in moveit2/moveit2.repos $(f="moveit2/moveit2_$ROS_DISTRO.repos"; test -r $f && echo $f); do vcs import < "$repo"; done
rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y

Rolling, Humble - unstable

git clone https://github.com/ros-planning/moveit2.git -b main
for repo in moveit2/moveit2.repos $(f="moveit2/moveit2_$ROS_DISTRO.repos"; test -r $f && echo $f); do vcs import < "$repo"; done
rosdep install -r --from-paths . --ignore-src --rosdistro $ROS_DISTRO -y

Build MoveIt

The rest of the commands are same for every distribution.

Configure and build the workspace:

cd $COLCON_WS
colcon build --event-handlers desktop_notification- status- --cmake-args -DCMAKE_BUILD_TYPE=Release

Source the Colcon Workspace

Setup your environment - you can do this every time you work with this particular source install of the code, or you can add this to your .bashrc (recommended):

source $COLCON_WS/install/setup.bash

Quick Start

Check out the MoveIt 2 Tutorials on how to get started with simple demo packages.

MoveIt 2 Tutorials