Efficient optimal control solvers for robotic systems.
sudo apt install libeigen3-dev
git clone https://github.com/mayataka/robotoc
cd robotoc
robotoc
asmkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make install -j$(nproc)
NOTE: if you want to maximize the performance, use CMake option
cmake .. -DCMAKE_BUILD_TYPE=Release -DOPTIMIZE_FOR_NATIVE=ON
sudo apt update && sudo apt install robotpkg-py38-qt5-gepetto-viewer-corba -y
and/or meshcat-python by
pip install meshcat
cmake .. -DBUILD_PYTHON_INTERFACE=OFF
ls -l /usr/local/bin | grep g++
Then set the full path in the cmake as
cmake .. -DCMAKE_CXX_COMPILER=FULL_PATH_TO_GPLUSPLUS
You can link your executables to robotoc
by writing CMakeLists.txt
, e.g., as
find_package(robotoc REQUIRED)
add_executable(
YOUR_EXECTABLE
YOUR_EXECTABLE.cpp
)
target_link_libraries(
YOUR_EXECTABLE
PRIVATE
robotoc::robotoc
)
Suppose that the Python version is 3.8. The Python bindings will then be installed at ROBOTOC_INSTALL_DIR/lib/python3.8/site-packages
where ROBOTOC_INSTALL_DIR
is the install directory of robotoc
configured in CMake (e.g., by -DCMAKE_INSTALL_PREFIX
).
To use the installed Python library, it is convenient to set the environment variable as
export PYTHONPATH=ROBOTOC_INSTALL_DIR/lib/python3.8/site-packages:$PYTHONPATH
e.g., in ~/.bashrc
. Note that if you use another Python version than python3.8
, please adapt it.
The following three solvers are provided:
OCPSolver
: Solves the OCP for rigid-body systems (possibly with contacts) by using Riccati recursion. Can optimize the switching times and the trajectories simultaneously.UnconstrOCPSolver
: Solves the OCP for "unconstrained" rigid-body systems by using Riccati recursion.UnconstrParNMPCSolver
: Solves the OCP for "unconstrained" rigid-body systems by using ParNMPC algorithm.where "unconstrained" rigid-body systems are systems without any contacts or a floating-base.
Examples of these solvers are found in examples
directory.
Further explanations are found at https://mayataka.github.io/robotoc/page_examples.html.
OCPSolver
can solve the switching time optimization (STO) problem, which optimizes the trajectory and the contact timings simultaneously.anymal/python/jumping_sto.py
and icub/python/jumping_sto.py
).
MPCCrawl
: MPC with OCPSolver
for the crawl gait of quadrupedal robots.MPCTrot
: MPC with OCPSolver
for the trot gait of quadrupedal robots.MPCPace
: MPC with OCPSolver
for the pace gait of quadrupedal robots.MPCFlyingTrot
: MPC with OCPSolver
for the flying trot gait of quadrupedal robots.MPCJump
: MPC with OCPSolver
for the jump motion of quadrupedal or bipedal robots.MPCBipedWalk
: MPC with OCPSolver
for the walking motion of bipedal robots.a1/mpc
, anymal/mpc
, and icub/mpc
.pip install pybullet
)a1/mpc/trot_terrain.py
) and bipedal walking (icub/mpc/walk.py
).
More detailed documentation is available at https://mayataka.github.io/robotoc/.
Our tutorials on robotoc is available at robotoc_tutorial.
OCPSolver
:@misc{katayama2021sto,
title={Structure-exploiting {N}ewton-type method for optimal control of switched systems},
author={Sotaro Katayama and Toshiyuki Ohtsuka},
url={arXiv:2112.07232},
eprint={2112.07232},
archivePrefix={arXiv}
year={2021}}
OCPSolver
without the switching time optimization (STO):@inproceedings{katayama2022lifted,
title={Lifted contact dynamics for efficient optimal control of rigid body systems with contacts},
author={Sotaro Katayama and Toshiyuki Ohtsuka},
booktitle={{2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2022) (to appear)}},
year={2022}}
UnconstrOCPSolver
and UnconstrParNMPCSolver
(the repository name was idocp
in this paper (https://github.com/mayataka/idocp)):@inproceedings{katayama2021idocp,
title={Efficient solution method based on inverse dynamics for optimal control problems of rigid body systems},
author={Sotaro Katayama and Toshiyuki Ohtsuka},
booktitle={{2021 IEEE International Conference on Robotics and Automation (ICRA)}},
pages={2070--2076},
year={2021}}