-
Notifications
You must be signed in to change notification settings - Fork 1
get_started
Welcome to the Machines in Motion Lab !! In this page you will learn how to get started with using the codebase in the lab.
The most commonly used packages used in the lab are :
- Pinocchio - A rigid body dynamic library used to for robot math.
- Crocoddyl - A efficient robot optimization package
it will be best to install them by following the links first !
After installing these packages, the next step will be to take a look at mim_robots. Mim_robots contains APIs to easily setup simulations with robots used in the lab (such as Solo12, Kuka IIWA ...). It allows you to switch between different simulators based on your preference.
A nice place to start with croccoddyl is this repository . The minimal_examples_crocoddyl provides simple examples on how to setup an optimization problem with crocoddyl for the Kuka Robot.
Easy starting point to setup non linear MPC automatically from templated config files is croco_mpc_utils. It contains APIs that make problem constructions easy. The same principles can be used for other robots as well. This setup can also be used to run MPC on the robots.
There are two places one can start to look
- mim_solvers - This package contains efficiently implemented SQPs that exploit sparsity for optimal control problems. The also contain several solver options underneath to switch between based on preference.
- BiconMP - Its a fast non linear optimization package for MPC. The details on how to use it are in the repository.
Note : The recommendation is to use mim_solvers over biconvexMP because it more generic and powerful .
Check the links in the wiki for robot hardware. They provide information on how to work with the robots in the lab !
The goal of this section is to setup a new machine and environment to run experiments on the KUKA.
This setup is currently used for KUKA demos on the gold
desktop. The main idea is to have ROS 2 globally installed while building / installing a colcon workspace inside a dedicated conda environment.
-
Install Ubuntu 22.04 and create an Ubuntu pro account to setup the real-time kernel using
pro enable realtime-kernel
. You can get more information here. -
Install ROS 2 humble (desktop install + development tools + additional libraries required to build the workspace).
sudo apt install ros-humble-desktop
sudo apt install ros-dev-tools
sudo apt install python3-colcon-common-extensions
sudo apt-get install libcereal-dev
sudo apt-get libncurses5-dev
sudo apt-get freeglut3-dev
Note that this could be greatly simplified as most of those libraries will be installed again by conda in each specific environment.
It would be nice to try to replace the previous commands by sudo apt install ros-humble-ros-base
- Install miniconda
- Create a conda environment and activate it
conda create -n demo
conda activate demo
- Setup the conda environment. Note that we install
cmake
andcolcon
inside the conda environment and use those to build the colcon workspace. This is a good practice. Indeed, using colcon / cmake from the global ROS2 install (i.e. outside the conda environment) results in a messy installation of python libraries in conda. Also, we need to impose the version of cmake to 3.23 (instead of more recent version found by conda) because some CMake macros used in un-maintained repos are unavailable. Finally, the version of python is imposed by the dynamic graph manager which finds python outside the conda environment.
conda install python==3.10
conda install mim-solvers -c conda-forge
conda install cmake==3.23 setuptools=69.5.1 pkg-config colcon-common-extensions -c conda-forge
conda install catkin_pkg empy lark -c conda-forge
conda install ncurses -c conda-forge
conda install websockets
conda install matplotlib
conda install -c conda-forge robot_descriptions
pip install pybullet
-
Create your workspace, e.g.
mkdir workspace_demo
-
Clone the source code inside the workspace (either by hand or using treep). The provided demo workspace on
gold
contains all necessary repos to run constrained MPC experiments (SQP paper) and the polishing task in MPC using online estimation (ICRA). -
Build and install with colcon:
colcon build --merge-install --install-base $CONDA_PREFIX --cmake-args -DCMAKE_BUILD_TYPE=Release -DPYBIND11_TEST=OFF -DBUILD_TESTING=OFF
One can use cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release
with make [-j6] && make install
to build packages one by one.
- sudo -s
- source /opt/ros/humble/setup.bash
- source /home/kuka/miniconda3/envs/test/setup.bash
- ros2 run dg_kuka dgm_iiwa_main
- In a seperate terminal, apply step 1, 2 and 3 and run your python script. Here is an example.
Error during colcon build
--- stderr: real_time_tools
/usr/bin/ld: cannot find -ledit: No such file or directory
/usr/bin/ld: cannot find -lXmu: No such file or directory
Fix:
apt install xmu headers
apt install libedit headers
All our open source software are licensed against the BSD 3-clause license.
Copyright 2016-2020, New York University and Max Planck Gesellschaft.
- Home Page
- Contribute to the wiki
- Logo
- Introduction
- Our Codebase
- Build Our Codebase
- Build tools introduction
- Build chain tutorials
- Dependencies
- Building our software stack
- Troubleshooting
- Robot Tutorials
- Programming
- ODRI Robots
- MicroDrivers
- Solo12
- Bolt
- NYUFinger
- Kuka
- Debugging