/acados_vendor_ros2

Ros2 vendor for the Acados NMPC solver.

Primary LanguageCMakeApache License 2.0Apache-2.0

acados_vendor_ros2

Simple ros2 vendor for Acados.

version CI (humble) Build tests (jazzy) Build tests (rolling)

Installation

mkdir ros2_ws/src
cd ros2_ws/src
git clone https://github.com/ICube-Robotics/acados_vendor_ros2.git

# Download the source and install the c interface (lib "acados")
cd ..
rosdep install --ignore-src --from-paths . -y -r
colcon build

NOTE: If the ament_cmake_vendor_package is missing, you can install it manually:

sudo apt install ros-<ROS_DISTRO>-ament-cmake-vendor-package

Usage

For a C++ project

package.xml :

...
<depend>acados_vendor_ros2</depend>
...

CMakeLists.txt :

...
find_package(acados_vendor_ros2)
...
ament_target_dependencies(<the_target> PUBLIC acados_vendor_ros2)
...

xxx.cpp :

#include "acados_c/ocp_nlp_interface.h"
...
ocp_nlp_plan_t* plan_ptr = ocp_nlp_plan_create(N);
...

For a Python project

package.xml :

...
<depend>acados_vendor_ros2</depend>
...

setup.py : Nothing special.

XXX.py :

from acados_template import AcadosModel, AcadosOcp
...
model = AcadosModel()
...