Controlling Quadrotor using Raspberry Pi

Dear All,

I’m new to ArduPilot and flight control as a whole and I’m working on a project to optimize the flight pattern of the quadrotors.
I want to control the motors directly (PWM or thrust) and feed back the current state of the quadrotor (position, velocity, attitude, angular velocity). I read that there is a protocol called MAVlink and this could be a good tool to help me. Thus, my question is:

Is that possible to control and receive the full state feedback using Raspberry Pi or simply any PC with ArduPilot?
If that is possible, at which control/update frequency this could be achieved?
Is there any guide to start with?

Thank you in advance for your help

Yes it is all possible.
But even better is to implement the custom controller on ArduPilot firmware. And there is documentation and examples for that.

1 Like

Thank you so much for your reply, but I didn’t find any direct documentation or any showcase for that!

Would you please help me with some URLs or any references?

Just Google for “add ArduCopter custom controller”

1 Like

Thank you so much, that’s good if I would like to integrate a controller on-board. I intend to use off board controller and send/received data to the ArduPilot and use it as a bridge. So what I’m looking for is to send the full state of the quadrotor out from the ArduPilot to another device and feed the motors directly from that external device which is the RPi here in my case.

I’m looking for documentation about this particular.

The mavlink telemetry rate would probably go as high as 100Hz.

But you probably want the controller to run at 200 or 400Hz.

So it is not going to work properly, and that is why nobody does it like that, and there’s no documentation nor examples about it.

I agree about the fast response that MAVlink is not able to achieve; however, what I’m doing is separating the position and attitude controllers. Usually, the attitude controller needs to be run at around 400Hz but for the position, it is fine to have a frequency of 100Hz or even less.

Thank you so much for your answer, I would appreciate it if you could provide any documentation for accessing the full state of the vehicle and the method to control the motors using MAVlink.

Ok, now I get it. Thanks for the explanation.

Yes, that makes sense and might work. Probably the best way going forward with your project is to use ROS2 direct bindings. There are some threads in this forum about that. And there is a recent YouTube video showing it off.