Neural Network Control
PX4 supports the following mechanisms for using neural networks for multirotor control:
- MC Neural Networks ControlExperimental — A generic neural network module that you can modify to use different underlying neural network and training models and compile into the firmware.
- RAPTOR: A Neural Network Module for Adaptive Quadrotor ControlExperimental — An adaptive RL NN module that works well with different Quad configurations without additional training.
Generally you will select the former if you wish to experiment with custom neural network architectures and train them using PyTorch or TensorFlow, and the latter if you want to use a pre-trained neural-network controller that works out-of-the-box (without training for your particular platform) or if you train your own policies using RLtools.
Note that both modules are experimental and provided for experimentation. The table below provides more detail on the differences.
| Use Case | mc_raptor | mc_nn_control |
|---|---|---|
| Pre-trained policy that adapts to any quadrotor without training | ✓ RAPTOR | ✘ |
| Train policy in PyTorch/TF | ✘ | ✓ TF Lite |
| Train policy in RLtools | ✓ | ✘ |
| Use manual control (remote) with NN policy | ✘ GPS/MoCap | ✓ Manual attitude commands |
| Load policy checkpoints from SD card | ✓ Upload via MAVLink FTP | ✘ Compiled into firmware |
| Offboard setpoints | ✓ MAVLink | ✘ |
| Internal Trajectory Generator | ✓ (Position, Lissajous) | ✘ |