This repository contains the needed code to reproduce the experiments presented in the paper Full-Body Torque-Level Nonlinear Model Predictive Control for Aerial Manipulation.
- Install the EagleMPC library at this tag and its dependencies.
The experiments to test the MPC controllers have been run in a simulated environment involving Gazebo and ROS Noetic. Make sure both are installed intro your computer.
Then, you need to clone and download the ROS packages in EagleMPC-ROS. Follow the installation instructions from the repository.
To run the different experiments you first need to clone this repository into your computer.
cd <choose-your-path>
git clone https://github.com/PepMS/fbtl_nmpc_experiments.git
To run a trajectory optimization experiment you need to do 2 steps:
- Modify the trajectory
.yaml
file with your paths. For example, open thehexacopter370_flying_arm_3_eagle_catch.yaml
and change theurdf
and thefollow
fields. Substitute the text between<>
with the actual paths to the respective libraries.
trajectory:
robot:
name: "hexacopter_370_flying_arm_3"
urdf: "<path-to-example-robot-data>/example-robot-data/robots/hexacopter370_description/urdf/hexacopter370_flying_arm_3.urdf"
follow: "<path-to-ros-ws>/src/eagle_mpc_ros/eagle_mpc_yaml/multicopter/hexacopter370.yaml"
- Execute the selected Python script (with the
display
option in case that you want to visualize this in the Gepetto-Viewer). For example, for the Eagle's Catch case:
cd <choose-your-path>/fbtl_nmpc_experiments/trajectory-optimization
python3 eagle_catch.py display
To run an nMPC experiment. For example, the 4-Displacement experiment.
- Modify the file
mpc/displacement/hexacopter370_flying_arm_3_mpc.yaml
, which is placed inside the same folder as the Python script. Then, substitute the text between<>
with the actual paths to the respective libraries.trajectory: robot: name: "hexacopter_370_flying_arm_3" urdf: "<path-to-example-robot-data>/example-robot-data/robots/hexacopter370_description/urdf/hexacopter370_flying_arm_3.urdf" follow: "<path-to-ros-ws>/src/eagle_mpc_ros/eagle_mpc_yaml/multicopter/hexacopter370.yaml"
- Analogously, modify the
yaml
file associated to the trajectory, either4-displacement
(hexacopter370_flying_arm_3_displacement.yaml
for the Carrot and Rail case andhexacopter370_flying_arm_3_displacement_w.yaml
for the Weighted controller) or theeagle_catch
(hexacopter370_flying_arm_3_eagle_catch_nc.yaml
). These are placed inside theeagle_mpc_yaml
ROS package. - Open the script of the experiment you want to run. For example
mpc/displacement/displacement.py
- Set the variables in the section
# -----VARIABLES-----
to match your settings.mpcController
allows you to select among the nMPC controllers (Weighted, Rail and Carrot)controller_settings_path
is the path of the.yaml
file contained in the same folder of the Python scriptcontroller_settings_destination
is the location of theeagle_mpc_yaml
ROS package- For the disturbance case, you can also set the properties of the simulated disturbance