Skip to main content

Moveit2-ROS2(Foxy) Installation Guide That’s Working

Installation of Moveit2 can be found from it official website bu in this guide is written due to the reason that I face a lot of difficulty following the guide and took me a lot of time surfing through forum and blog written by other experts in making the installation work from scratch especially for a beginner. One of the main references in making the Moveit2 installation working for me is by referring to a blog written by Edison.

Step 1: System Requirement

Before installing Moveit2 for ROS2 (Foxy), get your system ready with basic requirements:

Step 2: Update and Upgrade ROS2 package and dependency

Before starting with the installation, it is necessary to update and upgrade all the available packages inside of your system.

sudo apt update
sudo apt upgrade

On top of that, some of the dependency for ROS2 and the additional package that is required by the MoveIt2 installation needs to be downloaded and install.

rosdep update
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

Step 3: Create a workspace for Moveit2 and download the source

There are a few corrections that had been made for the Foxy branch. It is important to get the right version repository of your ROS2 in order to avoid any errors when you start building the workspace.

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

wget https://github.com/ros-planning/moveit2/blob/foxy/moveit2.repos
wget https://github.com/ros-planning/moveit2_tutorials/blob/foxy-branch/moveit2_tutorials.repos
vcs import < moveit2/moveit2.repos
vcs import < moveit2_tutorials/moveit2_tutorials.repos

Step 4: Build MoveIt2 Colcon workspace and source it

Install all necessary package dependencies from Debian that is necessary before proceeding further

rosdep install -r --from-paths . --ignore-src --rosdistro foxy -y

Build the workspace

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

Source the colcon workspace and do it once and for all.

echo 'source ~/ws_moveit2/install/setup.bash' >> ~/.bashrc

Step 5(optional): Test your installation set up

Open a new terminal and run the below tutorial to test your installation

cd ~/ws_moveit2
ros2 launch run_move_group run_move_group.launch.py

If you come across any error, please contact me through my social media and I will reply to you as soon as possible.

MoveIt2, ROS2

Leave a Reply

Your email address will not be published. Required fields are marked *