This tutorial guides you through the necessary setup in order to run the upper body imitation on the Ainex Robot.
Before starting this tutorial, ensure you have a working ROS2 environment installed.
The MediaPipe library does not come packaged with ROS2 and need to be installed separately (preferably in a virtual environment). In this step, we will set up a virtual environment, install dependencies, and build the ROS2 workspace.
-
Create and Activate Virtual Environment: Navigate to your workspace
srcfolder and create the environment:cd src python3 -m venv .venv --system-site-packages --symlinks source .venv/bin/activate
WARNING: It is important that the virtual environment is placed correctly inside "src" and is named ".venv". If not, the launch description will not find it!
-
Install MediaPipe: With the virtual environment active, install the required libraries:
pip install mediapipe pin casadi "numpy<2" -
Build the Workspace: Return to the root of your workspace and build the packages:
cd .. colcon build -
Source the Setup Script: Overlay the workspace environment:
source install/setup.bash
Run the launch file from the root of the project:
ros2 launch bringup upper_body_imitation.launch.pystacking_smaller_02.mp4
Before starting, make sure you have a working ROS 2 environment.
The only external dependency required for this pipeline is Pinocchio, installed system-wide via robotpkg.
If you already have robotpkg configured, skip to Step 5.
sudo apt install -qqy lsb-release curlsudo mkdir -p /etc/apt/keyrings
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.asc \
| sudo tee /etc/apt/keyrings/robotpkg.ascecho "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg.asc] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" \
| sudo tee /etc/apt/sources.list.d/robotpkg.listsudo apt updatesudo apt install -qqy robotpkg-py3*-pinocchioThis installs Pinocchio and all required dependencies.
Make sure the following libraries are available:
- numpy
- scipy
- opencv
Most of these dependencies are already included in a standard ROS 2 installation.
- Build your workspace:
colcon build- Source the workspace:
source install/setup.bash- Launch the stacking pipeline:
ros2 launch bringup stacking_pipeline.launch.py gui:=false rviz:=false