Maneuver-Oriented dynamics-aware Joint Iterative Trajectory Optimization
A sampling-based Model Predictive Control (MPC) framework for robotic systems with collision avoidance. MOJITO combines population-based optimization (Cross-Entropy Method) with dynamics-aware trajectory generation and FCL-based 3D collision detection.
- Sampling-Based MPC: Uses Cross-Entropy Method (CEM) for trajectory optimization
- 3D Collision Avoidance: FCL (Flexible Collision Library) integration with soft proximity gradients
- Time-Normalized Costs: Physics timestep-invariant cost functions to model Integration of cost in the optimal control problem
- Multiple Input Functions: Supports spline interpolation and piecewise-constant control parameterization
- Flexible Dynamics: Uses the University of Alabama's LAGER repository: gncpy for dynamics modeling
src/
ConfigurationSpace/ # 3D configuration space with FCL collision detection
Controls/ # NBBMPC controller and input function classes
Optimizers/ # Cross-Entropy Method and optimizer base classes
Utils/ # Geometry utilities (quaternions, rotations)
Vehicles/ # Vehicle abstraction layer for dynamics and collision geometry
This project uses a dev container for consistent development environments.
- Install Docker Desktop
- Install the Dev Containers extension in VS Code
- Open this folder in VS Code
- When prompted, click "Reopen in Container" or navigate through the command pallete
- The container will build and install all dependencies including PyTorch
You can also build and run the container directly using Docker:
# Build the container
docker build -t mojito-dev -f .devcontainer/Dockerfile .
# Run the container with interactive shell
docker run -it --rm -v $(pwd):/workspace mojito-devThe dev container includes:
- Python 3.11
- Free Collision Library
- Python extensions for VS Code
There is currently not clear support on local setup. Refer to the dockerfile in the devcontainer folder for the necessary dependencies.
This project uses gncpy as a git submodule.
If using the devcontainer, add the appropriate installation step to the Dockerfile or requirements.txt.
For new clones, use:
git clone --recurse-submodules https://github.com/AndrewC2023/MOJITO.gitOr if you've already cloned without submodules:
git submodule update --init --recursiveTo update the gncpy dependency to the latest version:
git submodule update --remote dependencies/gncpyWhen adding new features
- Checkout a new brach with the name of your feature
- Develop and test it
- Create a pull/merge request with the feature and test(s) for review
*Note: When implementing new dynamics or cost functions:
- Ensure all running costs multiply by
dtfor time normalization - Test with multiple
physics_dtvalues to verify cost consistency - Document coordinate frame conventions (NED vs ENU and body frame convensions)
This project in general needs a lot of work and research to find better solutions and apply good well known current solutions. This framework hopes to be a place where MPC and search algorithm reseach can be done. It is likely that at some point in the future the work here will be movesd to gncpy at which point it will be noted that this repository is stale.