A joint space motion planner based on Model Predictive Control (MPC) to find the minimum time trajectory between the current state and target state (position and velocity), while respecting box constraints on joint position, velocity, acceleration and torque, as well as height constraint to avoid the mounting surface of the robot.
We use polyMPC as the MPC library and Ruckig as an initial guess for the solver.
Clone the repository with the submodules, then compile the examples:
git clone --recurse-submodules https://github.com/AlbericDeLajarte/mpc_motion_planner.git
cd mpc_motion_planner && mkdir build && cd build
cmake ..
make
Once compiled, you can launch the examples to test if everything works properly.
build/offline_trajectory
This generates one trajectory between two random states. The trajectory generated by Ruckig (as initial guess) and the MPC are then stored in the file analysis/optimal_solution.txt
and can be plotted using the notebook analysis/data_analysis.ipynb
To benchmark the MPC motion planner against Ruckig, you can launch:
build/mpc_benchmark
which will generate a 1000 trajectories and record limit violations and planning statistics in analysis/benchmark_data.txt
. You can use the notebook analysis/benchmark_analysis.ipynb
to analyse the data.