Low level flight control with neural network

Hi guys,
I’m looking to implement low level control of a quadrotor or fixed wing aircraft using a neural net that takes in the state estimation from the EKF (plus lidar and whatever other state information we choose to use), and outputs motor rpm signals. What is the best way of making this work using PX4, ROS, and Gazebo? I’m using PyTorch for the network, and ideally I’d be running the full experiment using a python script.

Any ideas on the best way to go about this?

Offboard control using a raspberry pi maybe