I have modified the ArduCopter-3.2.1 code for the APM2.x to implement stabilization instead of just passing through controls as in the bluerobotics fork. I just uploaded to a board today, and the results are promising… it appears to work. So far I have the ACRO and STABILIZE modes modified. Next up will be depth hold, and I also want to do a mode to maintain a constant height above bottom.
I still need to test it in the water to tune the control loops and to find the proper motor mix.
I think that using ROS on raspberry pi and offloading control to the APM is a very decent solution. I plan on using the RC_OVERRIDE message through mavlink to inject the rc signals. Without the pi, it will be more complicated to get the rc signals from topside into the APM.
The unfortunate thing about the APM2.x is that it is no longer supported or sold, you can only get clones. I got an “APM2.8” on EBay, but it came without a compass on the board, which is not necessary, but will help with control and navigation. They have moved on to PixHawk 32bit platform. I have also modified the PixHawk code. I’ll get a Pix and see how that goes.
The APM code is huge and there are a ton of checks and balances that may need to be addressed. I think I have modified the major points, but I am going to sift through everything to avoid unexpected behavior.
The apm code is in ArduCopter-3.2.1 branch, I will be modifying heavily in the coming weeks and modifying the ros package to choose flight modes.