Offboard mode neural network

I need your advice regarding offboard mode.

So I am planing to replace the pid angular rate controller with an AI neural network controller. I got some advice that I can go with ROS2 and offboard mode.

I read the px4 controller architecture and I found that the inner loop attitude controller receive the angular velocity and send the pitch roll yaw torques to the mixer ( I hope this is right wat I understand )

When I started the offboard mode, I set the offboard control message to be true for thrust/torque and all the others like position velocity, etc, are False

Now the question is , if I send the torque thrust command , does that mean all the other fields like position controller , velocity controller and the outer attitude loop controller will be controlled by px4 firmware or I should create algorithm to control them .

Also any other suggestion to replace the pid in the angular rate controller with neural network other than offboard mode ?

1 Like

I am doing a similar work. Have you succeeded in this?

Hi, I’ve been working on this as well. I use the ROS2 API internally through uORB messages to create a new flight mode.

My work includes a module for exactly this purpose, replacing classical PX4 controllers with neural networks for other people to use, I have flight tested it and it works on two different platforms. Right now merging it is blocked by another PR, but it will be part of PX4 main pretty soon. In the meantime there are several resources around I have created to replicate this or use it for other purposes:

Please reach out to me if you have any specific questions

1 Like