Getting started

Installation

Required setup : Ubuntu 22.04 LTS

1. Install the ROS2 distribution (current dev. based on ros2 humble). See the official documentation for ROS2 installation steps.

  1. Source the ROS2 environment:

source /opt/ros/humble/setup.bash
  1. Prepare the workspace and install dependencies

sudo apt install python3-colcon-common-extensions
cd ~/ros2_ws
cd src
git clone https://github.com/ICube-Robotics/acados_solver_ros2.git
vcs import . < acados_solver_ros2/acados_solver_ros2.repos
rosdep install --ignore-src --from-paths . -y -r

pip install future-fstrings  # Python retro-compatibility
  1. Build stack and source

cd ~/ros2_ws
colcon build && colcon build
source install/setup.bash

Example test code

At this point, you should be able to export the example solver plugin acados::MockAcadosSolver.

First, export the Acados solver plugin:

cd ~/ros2_ws
source install/setup.bash

cd src/acados_solver_ros2/acados_solver_plugins_example/script
python3 -m demo_export_plugin_to_custom_pkg

# Note: if used for the first time, Acados will ask you to install "Tera renderer"
#   -> press "y" to accept

Then build the newly generated plugin and run the example program that solves a NMPC problem for a pendulum system:

cd ~/ros2_ws
colcon build
source install/setup.bash

ros2 run acados_solver_plugins_example test_mock_plugin