Metadata-Version: 2.5
Name: raddo
Version: 0.1.6
Summary: RApidly Adapting Data-Driven Opimization (RADDO). JAX-based trajectory generator with Moreau-based QP solver with an emphasis on adaptation and attitude dynamics
Project-URL: Homepage, https://github.com/JHU-ACEL/raddo
Author-email: Patrick Schwartz <pschwa24@jh.edu>
Maintainer-email: Patrick Schwartz <pschwa24@jh.edu>
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python
Requires-Python: >=3.12
Requires-Dist: equinox>=0.13.8
Requires-Dist: jax>=0.11.2
Requires-Dist: moreau>=0.4.0
Requires-Dist: numpy>=2.5.3
Requires-Dist: optax>=0.2.8
Provides-Extra: cuda12
Requires-Dist: jax[cuda12]>=0.11.2; extra == 'cuda12'
Requires-Dist: moreau[cuda12]>=0.4.0; extra == 'cuda12'
Provides-Extra: cuda13
Requires-Dist: jax[cuda13]>=0.11.2; extra == 'cuda13'
Requires-Dist: moreau[cuda13]>=0.4.0; extra == 'cuda13'
Provides-Extra: extras
Requires-Dist: marimo>=0.24.2; extra == 'extras'
Requires-Dist: matplotlib>=3.11.2; extra == 'extras'
Requires-Dist: pandas>=3.0.6; extra == 'extras'
Requires-Dist: planetmagfields>=1.7.0; extra == 'extras'
Requires-Dist: seaborn>=0.13.2; extra == 'extras'
Requires-Dist: wandb>=0.30.0; extra == 'extras'
Description-Content-Type: text/markdown

# Rapidly Adapting Data-Drive Optimization (RADDO) 

RADDO is a JAX-based, GPU-accelerated library for trajectory generation, model predictive control, and online-adaptation.
This library was built for [Learning-Based Adaptive MPC for Magnetorquer-Only Satellite Attitude Control](https://arxiv.org/abs/2610.20280) which was accepted to the International Conference on Space Robotics (iSpaRo) 2026.

## Learning-Based Adaptive MPC for Magnetorquer-Only Satellite Attitude Control
<img width="6832" height="4143" alt="hero" src="https://github.com/user-attachments/assets/b51ff63d-21c4-4f67-a356-42faa18d1b24" />

## Quick start
Explore our example notebook [![Open in molab](https://molab.marimo.io/molab-shield.svg)](https://molab.marimo.io/notebooks/nb_t72gztgSo1gxbaNYBMLueL).

[Marimo](https://marimo.io/) offers a sandboxed environment with access to a GPU, so you will not need to install anything. If you do not want to run it in [molab](https://molab.marimo.io/notebooks), you can just run the following locally
```
uvx marimo edit --sandbox Intro_to_RADDO.py
```

## Other ways to work with library
1. pip install into your own environment
```
pip install raddo # or raddo[cuda13]
```
2. Pull our pre-built Docker images
```
docker pull ghcr.io/jhu-acel/raddo:latest
docker pull ghcr.io/jhu-acel/raddo:dev # optional: editable pip install to make changes
```
3. Clone this repository
```
git clone https://github.com/JHU-ACEL/raddo
```
and then run 
```
docker compose up cli # base install
docker compose up dev # editable pip install
```
Then open the marimo notebook that started by going to `localhost:8888`.
To attach to the docker container command line, run 
```
docker exec -it -u docker raddo-cli-1 bash
```

## Examples
- `Intro_to_RADDO.py` demonstrates the basic functionality of the library
- `Magnetorquer_Control.py` is a more comprehensive example for the magnetorquer-only attitude control problem of a satellite with online adaptation
- `B_field_Pretraining.py` shows the training pipeline for training the magnetic field models offline.

## Details
- [Just-in-time (JIT) compilation](https://docs.jax.dev/en/latest/jit-compilation.html)
 - Makes use of the [Equinox](https://docs.kidger.site/equinox/) library for Object-Oriented programming while maintaining JIT-compatibility
- Quadratic Program (QP) Controller built on [Moreau](https://docs.moreau.so/)
  - Differentiable, fast QP solves
- Attitude-Aware QP Solver
 - The QP Solver is set up to natively handle quaternion attitude dynamics
 - Based off of ["Planning with Attitude"](https://roboticexplorationlab.org/papers/planning_with_attitude.pdf)
- SQP Controller
- Sampling-based MPC controllers (MPPI/CEM)
- Quick start
 - [marimo](https://marimo.io/) notebooks offer their own [sandboxed environments](https://docs.marimo.io/guides/package_management/sandboxes/), so you don't need to install any of your own dependencies
   - To get started run `uvx marimo edit --sandbox Intro_to_RADDO.py`
   - You can also open it in [molab](https://molab.marimo.io/) which provides GPU access
- Modular design
 - It is designed to be as general as possible so that you can use it for your own project.
 - You can use your own dynamics and/or write your own controllers.
- Differentiable
 - The whole pipeline is differentiable similar to [TurboMPC](https://arxiv.org/pdf/2606.24039) and [DiffMPC](https://github.com/ToyotaResearchInstitute/diffmpc).
 -  This allows you to use gradient descent to learn better cost weights, dynamics parameters, etc
    - This is not something we have experimented with yet.
 - The structure of the Dynamics class is heavily based on [DiffMPC](https://github.com/ToyotaResearchInstitute/diffmpc).

## Cite
```
@article{SchwartzCauligi2026,
  title={Learning-Based Adaptive MPC for Magnetorquer-Only Satellite Attitude Control}, 
  author={Patrick Schwartz and Abhishek Cauligi},
  journal={International Conference on Space Robotics 2026},
  year={2026},
  url={https://arxiv.org/abs/2610.20280}
```
