Python bindings for MINCO (Minimum Control Effort) trajectory optimization library - A high-performance trajectory planning framework for multirotor and fixed-wing aircraft.
MINCO-Python is a Python-first trajectory optimization library that provides efficient trajectory planning capabilities for unmanned aerial vehicles. Based on the MINCO framework, this project removes ROS dependencies and exposes a clean Python interface while maintaining the high-performance C++ backend.
- π Python-First Design: Native Python interface with NumPy integration
- β‘ High Performance: C++20 backend with O(N) banded system solvers
- π― CasADi Integration: Automatic differentiation for flatness models
- π§ Configurable: YAML-based configuration system
- π Visualization: Built-in matplotlib support with interactive plotting
- π§ͺ Well-Tested: Comprehensive test suite with validation examples
C++ Backend:
minco.hpp- Banded system solver with O(N) complexitygcopter.hpp- GCOPTER trajectory optimizer with geometric controlflatness.hpp- Differential flatness mapping for multirotor dynamicstrajectory.hpp- Piecewise polynomial trajectory representation
Python Bindings:
- Complete pybind11 bindings with NumPy array support
- Automatic Python type stub generation (.pyi files)
- CasADi automatic differentiation integration
Configuration System:
- YAML configuration files for aircraft parameters
- Customizable flatness model definitions
- LBFGS optimizer parameter tuning
- Python 3.13+
- C++20 compatible compiler
- Eigen3 library
- yaml-cpp library
# Install required C++ libraries
sudo apt install libyaml-cpp-dev libeigen-devcurl -LsSf https://astral.sh/uv/install.sh | sh# Install all Python dependencies
uv syncIt would automatically building the cpp project.
# Generate pybind11 type hints for better IDE support
uv run pybind11-stubgen mincoThe generated stub files will be automatically placed alongside the compiled module.
import numpy as np
import minco
# Create a simple trajectory
trajectory = minco.Trajectory()
# Generate trajectory points
points = np.array([[0, 1, 2, 3],
[0, 1, 0, 1],
[1, 1, 1, 1]])
# Optimize trajectory
trajectory.optimize(points)Run the test suite:
# Run all tests
uv run pytest
# Run specific test
uv run pytest tests/test_gcopter_casadi_visualization.py- Flatness Tests: Validate differential flatness implementations
- GCOPTER Tests: Test trajectory optimization with various constraints
- Visualization Tests: Interactive trajectory plotting and validation
- CasADi Tests: Automatic differentiation and gradient computation
- LBFGS β SQCQP: Upgrade optimization algorithm
- Enhanced API: More natural Python interface design
- Fixed-Wing Support: Add fixed-wing/VTOL differential flatness models
- Real-time Planning: Real-time trajectory generation capabilities
Configuration files are located in the config/ directory:
default_gcopter.yaml- Main trajectory optimization parametersdefault_flatness_config.yaml- Flatness model parameterslbfgs.yaml- Optimizer configurationcasadi_quadrotor_flatness.yaml- CasADi flatness model
-
Cost Function Configuration (
costfunc_config)- Weight matrices for position, velocity, acceleration
- Physical constraints (velocity, thrust limits)
- Smoothness factors
-
LBFGS Optimizer Configuration (
lbfgs_config)- Convergence tolerances
- Maximum iterations
- Line search parameters
The library includes built-in trajectory generators for:
- π΅ Circular trajectories
- 8-Shaped trajectories
- Square trajectories
- Custom waypoint-based trajectories
- Multirotor UAV trajectory planning
- Learning-based control research
- Aircraft dynamics simulation
- Trajectory optimization algorithm validation
- Real-time motion planning
minco-python/
βββ src/minco_trajectory/ # C++ source code
β βββ include/ # Header files
β βββ src/ # Implementation
β βββ src/bindings/ # Python bindings
βββ tests/ # Test suite
βββ config/ # Configuration files
βββ docs/ # Documentation
βββ tools/ # Build utilities
The project uses differential flatness theory to transform complex 3D trajectory planning problems into simpler flat space optimization. The flatness mapping handles:
- Forward mapping: flat variables β physical states (position, velocity, acceleration)
- Backward mapping: physical state gradients β flat variable gradients
Trajectory optimization is performed using LBFGS with:
- Piecewise polynomial trajectory representation
- Physical constraints (velocity, acceleration, thrust limits)
- Smoothness regularization terms
- Boundary condition enforcement
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Based on the MINCO framework from ZJU FAST Lab
- Built with Eigen for linear algebra
- Python bindings powered by pybind11
- Symbolic computation with CasADi
If you use this library in your research, please cite:
@software{minco_python,
title={MINCO-Python: Python Bindings for Minimum Control Effort Trajectory Optimization},
author={Erchao Rong},
year={2025},
url={https://github.com/WarriorHanamy/minco-python}
}