Hi,
I’m programming a simple ground station that is controlling my hexacopter (pixhawk connected to raspberry connected to server via 4G dongle). I’m controling it with gamepad connected to phone connected to server.
Everything is done except that I crashed yesterday when I was testing the mavlink manual_control_send(). First it was flying great in loiter mode. No flyaway, no altitude drop. At the end of the day I pushed the pitch forward (~80%) and the copter started to slowly loose altitude, stopped reacting to gamepad control and by the time I switched to RTL via RC it was already close to ground. It crashed and flipped.
I think the raspberry disconnected or shutdown so that’s why the gamepad control stopped. But I don’t know why it continued to loose altitude. Currently FS_GCS_ENABLE is set to 0 (no action)
In the pictures you can see that RC3 value returned to trim and the copter kept loosing altitude. The RC2 pitch also returned to trim (actually little backward) but the copter was still moving forward.
I know my RC trim values are not in the middle range (these are just my RC middle positions). When using manual_control_send() x,y,r is -1000 to 1000 and z is 0 to 1000. I do convert my gamepad stick range to match the RC trim values (for example I call the manual_control_send(target, 15, 162, 539, 75, 0) when all sticks are in middle on gamepad). But maybe if the GCS disconnects something changes regarding manual control?
Log file: http://www.pgcentrum.sk/log-2018-04-12.bin
Graphs: