mavlink / MAVSDK-Python

MAVSDK client for Python.
https://mavsdk.mavlink.io
BSD 3-Clause "New" or "Revised" License
324 stars 220 forks source link

Manual control/offboard not working #665

Open mtonnberg opened 8 months ago

mtonnberg commented 8 months ago

I have tried(a lot) to remotely control my drone using MavSDK. Either there is a bug or I have missed something. What I want to do is

I do not want to use GPS-based/location aware metrics like go forward x meters.

I have tried many different things including

If I do not have my rc activated the manualcontrol-example executes without any errors but nothing happens with the propellers when the set_manual_control_input calls are made. The drone are armed (in the script) and then disarmed while the other code is executing, again without any errors (I have not understood why it is disarmed - I do not get any errors anywhere I can find.)

With the offboard examples it is a similar thing. It executes without any errors but nothing happens on the drone.

Takeoff, land and navigationbased scripts works fine.

The virtual joysticks in QGC works so I do not see why the python version would not work.

I have read some mentions of different parameters to set but I have none of these (I'm running Mateksys F406-HDTE and Ardupilot 4.4.4). For example: COM_RC_IN_MODE

Maybe there are some Px4 exclusive parameters?

My setup

FC, Mateksys F406-HDTE <-- serial ---> RPi Zero 2W, 64 Bookwork, Python3.9, MavSdk-Python 2.1.0 <--wifi--> pc with QGC

The pythonscript is executed on the RPi.

I do not get any errors if I run the mavsdk server by it self (aside from a lot of loading unknown module, but those have the debug label)

The telemetry data from the drone is perfectly healthy. I have good (20+ satellites) gps fix. The drone is calibrated and works fine when flying with the RC.

I would like to manage to get a script that oscillates between 5% and 10% thrust (will not lift the drone but I can see/hear that the script works)

So, is this a bug or am I missing something obvious? What steps are required to be able to run the manual_control.

julianoes commented 8 months ago

Thanks for the issue. I think this hasn't been tested on ArduPilot. I'm not entirely sure what is missing.

Do you see the output of mavsdk_server, maybe that will give us a clue?

mtonnberg commented 8 months ago

No errors there as far as I can see but I get a lot of these debug-messages, maybe they can help us in the right direction? But I do not get any messages marked as errors.

....
[09:49:21|Debug] New system ID: 150 Comp ID: 64 (mavsdk_impl.cpp:737)
[09:49:21|Debug] Component Unsupported component (64) added. (system_impl.cpp:389)
[09:49:22|Debug] New system ID: 127 Comp ID: 166 (mavsdk_impl.cpp:737)
[09:49:22|Debug] Component Unsupported component (166) added. (system_impl.cpp:389)
[09:49:22|Debug] Component Unsupported component (82) added. (system_impl.cpp:389)
[09:49:22|Debug] New system ID: 159 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:49:22|Debug] New system ID: 179 Comp ID: 243 (mavsdk_impl.cpp:737)
[09:49:22|Debug] Component Unsupported component (243) added. (system_impl.cpp:389)
[09:49:22|Debug] New system ID: 172 Comp ID: 129 (mavsdk_impl.cpp:737)
[09:49:22|Debug] Component Unsupported component (129) added. (system_impl.cpp:389)
[09:49:22|Debug] New system ID: 234 Comp ID: 253 (mavsdk_impl.cpp:737)
[09:49:22|Debug] Component Unsupported component (253) added. (system_impl.cpp:389)
[09:49:23|Debug] Discovered 5 component(s) (system_impl.cpp:564)
[09:49:23|Debug] New system ID: 186 Comp ID: 9 (mavsdk_impl.cpp:737)
[09:49:23|Debug] Component Unsupported component (9) added. (system_impl.cpp:389)
[09:49:23|Debug] New system ID: 45 Comp ID: 13 (mavsdk_impl.cpp:737)
[09:49:23|Debug] Component Unsupported component (13) added. (system_impl.cpp:389)
[09:49:23|Debug] New system ID: 77 Comp ID: 6 (mavsdk_impl.cpp:737)
[09:49:23|Debug] Component Unsupported component (6) added. (system_impl.cpp:389)
[09:49:24|Debug] New system ID: 225 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:49:24|Debug] New system ID: 82 Comp ID: 83 (mavsdk_impl.cpp:737)
[09:49:24|Debug] Component Unsupported component (83) added. (system_impl.cpp:389)
[09:49:24|Debug] Component Unsupported component (30) added. (system_impl.cpp:389)
[09:49:24|Debug] Component Unsupported component (232) added. (system_impl.cpp:389)
[09:49:25|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:49:25|Debug] Component Unsupported component (244) added. (system_impl.cpp:389)
[09:49:25|Debug] Component Unsupported component (87) added. (system_impl.cpp:389)
[09:49:25|Debug] New system ID: 16 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:49:25|Debug] Component Unsupported component (112) added. (system_impl.cpp:389)
[09:49:25|Debug] Component Unsupported component (73) added. (system_impl.cpp:389)
....
julianoes commented 8 months ago

How many systems are connected? That's odd. One drone should generally be "one system" and have the same system ID.

mtonnberg commented 8 months ago

I only have one drone connected. I also use mavproxy to communicate with qgc (but mavproxy is either shut down by me before I try to run the script or, if left running, just loses the connection while the script is running and then regains the connection afterwards)

mtonnberg commented 8 months ago

I have tried another thing.

If i just run the example and let it start the mavsdk server it executes the script but nothing happens (it arms and then disarms again) If I start the mavsdk server first and then run the script, it gets stuck on the check for good telemetry health (even though I have good gps fix)

I get these errors

[09:05:40|Debug] New system ID: 253 Comp ID: 113 (mavsdk_impl.cpp:737)
[09:05:40|Debug] Component Unsupported component (113) added. (system_impl.cpp:389)
[09:05:40|Warn ] sending again after 0.508073 s, retries to do: 3  (512). (mavlink_command_sender.cpp:312)
[09:05:40|Warn ] Request was for msg ID: 242 (mavlink_command_sender.cpp:318)
[09:05:40|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:40|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:40|Warn ] sending again after 1.01195 s, retries to do: 2  (512). (mavlink_command_sender.cpp:312)
[09:05:40|Warn ] Request was for msg ID: 242 (mavlink_command_sender.cpp:318)
[09:05:41|Debug] New system ID: 112 Comp ID: 112 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (112) added. (system_impl.cpp:389)
[09:05:41|Debug] New system ID: 108 Comp ID: 84 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (84) added. (system_impl.cpp:389)
[09:05:41|Debug] New system ID: 130 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:41|Warn ] sending again after 1.5156 s, retries to do: 1  (512). (mavlink_command_sender.cpp:312)
[09:05:41|Warn ] Request was for msg ID: 242 (mavlink_command_sender.cpp:318)
[09:05:41|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:05:41|Debug] New system ID: 77 Comp ID: 205 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (205) added. (system_impl.cpp:389)
[09:05:41|Debug] New system ID: 216 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:41|Debug] New system ID: 73 Comp ID: 13 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (13) added. (system_impl.cpp:389)
[09:05:41|Debug] New system ID: 84 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:41|Debug] New system ID: 61 Comp ID: 220 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (220) added. (system_impl.cpp:389)
[09:05:41|Debug] New system ID: 118 Comp ID: 138 (mavsdk_impl.cpp:737)
[09:05:41|Debug] Component Unsupported component (138) added. (system_impl.cpp:389)
[09:05:41|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:05:41|Error] Retrying failed (512) (mavlink_command_sender.cpp:339)
[09:05:42|Debug] New system ID: 52 Comp ID: 24 (mavsdk_impl.cpp:737)
[09:05:42|Debug] Component Unsupported component (24) added. (system_impl.cpp:389)
[09:05:42|Debug] New system ID: 132 Comp ID: 57 (mavsdk_impl.cpp:737)
[09:05:42|Debug] Component Unsupported component (57) added. (system_impl.cpp:389)
[09:05:42|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:05:42|Debug] New system ID: 162 Comp ID: 222 (mavsdk_impl.cpp:737)
[09:05:42|Debug] Component Unsupported component (222) added. (system_impl.cpp:389)
[09:05:42|Debug] New system ID: 4 Comp ID: 255 (mavsdk_impl.cpp:737)
[09:05:42|Debug] Component Unsupported component (255) added. (system_impl.cpp:389)
[09:05:42|Debug] Component Unsupported component (54) added. (system_impl.cpp:389)
[09:05:42|Debug] New system ID: 79 Comp ID: 140 (mavsdk_impl.cpp:737)
[09:05:42|Debug] Component Unsupported component (140) added. (system_impl.cpp:389)
[09:05:42|Info ] heartbeats timed out (system_impl.cpp:279)
[09:05:42|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:05:42|Error] Error: Param for gyro offset_x failed. (telemetry_impl.cpp:1906)
[09:05:43|Debug] New system ID: 222 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:43|Debug] New system ID: 137 Comp ID: 138 (mavsdk_impl.cpp:737)
[09:05:43|Debug] Component Unsupported component (138) added. (system_impl.cpp:389)
[09:05:43|Debug] New system ID: 21 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:43|Debug] New system ID: 123 Comp ID: 110 (mavsdk_impl.cpp:737)
[09:05:43|Debug] Component Unsupported component (110) added. (system_impl.cpp:389)
[09:05:43|Debug] New system ID: 12 Comp ID: 126 (mavsdk_impl.cpp:737)
[09:05:43|Debug] Component Unsupported component (126) added. (system_impl.cpp:389)
[09:05:43|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:43|Debug] Component Unsupported component (254) added. (system_impl.cpp:389)
[09:05:43|Debug] New system ID: 53 Comp ID: 31 (mavsdk_impl.cpp:737)
[09:05:43|Debug] Component Unsupported component (31) added. (system_impl.cpp:389)
[09:05:43|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:44|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:44|Debug] New system ID: 169 Comp ID: 59 (mavsdk_impl.cpp:737)
[09:05:44|Debug] Component Unsupported component (59) added. (system_impl.cpp:389)
[09:05:44|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:05:44|Debug] New system ID: 9 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:44|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:44|Debug] New system ID: 3 Comp ID: 3 (mavsdk_impl.cpp:737)
[09:05:44|Debug] Component Unsupported component (3) added. (system_impl.cpp:389)
[09:05:45|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:05:45|Debug] New system ID: 182 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:45|Debug] New system ID: 228 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:45|Debug] New system ID: 55 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:45|Debug] New system ID: 82 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:45|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:05:45|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:45|Debug] New system ID: 90 Comp ID: 81 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (81) added. (system_impl.cpp:389)
[09:05:45|Debug] New system ID: 110 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:45|Debug] New system ID: 57 Comp ID: 179 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (179) added. (system_impl.cpp:389)
[09:05:45|Debug] New system ID: 107 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:45|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:46|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:05:46|Error] Error: Param for gyro offset_y failed. (telemetry_impl.cpp:1921)
[09:05:46|Debug] New system ID: 168 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:46|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:46|Debug] New system ID: 234 Comp ID: 59 (mavsdk_impl.cpp:737)
[09:05:46|Debug] Component Unsupported component (59) added. (system_impl.cpp:389)
[09:05:46|Debug] New system ID: 245 Comp ID: 129 (mavsdk_impl.cpp:737)
[09:05:46|Debug] Component Unsupported component (129) added. (system_impl.cpp:389)
[09:05:46|Debug] Component Unsupported component (83) added. (system_impl.cpp:389)
[09:05:46|Debug] New system ID: 181 Comp ID: 114 (mavsdk_impl.cpp:737)
[09:05:46|Debug] Component Unsupported component (114) added. (system_impl.cpp:389)
[09:05:46|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:47|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:47|Debug] New system ID: 47 Comp ID: 82 (mavsdk_impl.cpp:737)
[09:05:47|Debug] Component Unsupported component (82) added. (system_impl.cpp:389)
[09:05:47|Debug] New system ID: 120 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:47|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:05:47|Debug] New system ID: 92 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:48|Debug] New system ID: 93 Comp ID: 19 (mavsdk_impl.cpp:737)
[09:05:48|Debug] Component Unsupported component (19) added. (system_impl.cpp:389)
[09:05:48|Debug] New system ID: 60 Comp ID: 64 (mavsdk_impl.cpp:737)
[09:05:48|Debug] Component Unsupported component (64) added. (system_impl.cpp:389)
[09:05:48|Debug] New system ID: 109 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:48|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:48|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:05:48|Debug] New system ID: 172 Comp ID: 64 (mavsdk_impl.cpp:737)
[09:05:48|Debug] Component Unsupported component (64) added. (system_impl.cpp:389)
[09:05:48|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:05:48|Debug] New system ID: 31 Comp ID: 89 (mavsdk_impl.cpp:737)
[09:05:48|Debug] Component Unsupported component (89) added. (system_impl.cpp:389)
[09:05:48|Debug] New system ID: 100 Comp ID: 84 (mavsdk_impl.cpp:737)
[09:05:48|Debug] Component Unsupported component (84) added. (system_impl.cpp:389)
[09:05:49|Debug] New system ID: 126 Comp ID: 124 (mavsdk_impl.cpp:737)
[09:05:49|Debug] Component Unsupported component (124) added. (system_impl.cpp:389)
[09:05:49|Debug] Component Unsupported component (51) added. (system_impl.cpp:389)
[09:05:49|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:05:49|Error] Error: Param for gyro offset_z failed. (telemetry_impl.cpp:1936)
[09:05:49|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:49|Debug] New system ID: 149 Comp ID: 84 (mavsdk_impl.cpp:737)
[09:05:49|Debug] Component Unsupported component (84) added. (system_impl.cpp:389)
[09:05:49|Debug] Discovered 1 component(s) (system_impl.cpp:564)
[09:05:49|Debug] Component Unsupported component (179) added. (system_impl.cpp:389)
[09:05:49|Debug] New system ID: 205 Comp ID: 5 (mavsdk_impl.cpp:737)
[09:05:49|Debug] Component Unsupported component (5) added. (system_impl.cpp:389)
[09:05:49|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:50|Debug] New system ID: 33 Comp ID: 13 (mavsdk_impl.cpp:737)
[09:05:50|Debug] Component Unsupported component (13) added. (system_impl.cpp:389)
[09:05:50|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:50|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:05:51|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:05:51|Debug] Component Unsupported component (47) added. (system_impl.cpp:389)
[09:05:51|Debug] Component Unsupported component (84) added. (system_impl.cpp:389)
[09:05:51|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:05:51|Debug] New system ID: 28 Comp ID: 165 (mavsdk_impl.cpp:737)
[09:05:51|Debug] Component Unsupported component (165) added. (system_impl.cpp:389)
[09:05:51|Debug] Discovered 1 component(s) (system_impl.cpp:564)
[09:05:52|Debug] Component Unsupported component (208) added. (system_impl.cpp:389)
[09:05:52|Debug] New system ID: 49 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:52|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:52|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:05:52|Error] Error: Param for accel offset_x failed. (telemetry_impl.cpp:1861)
[09:05:52|Debug] New system ID: 173 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:52|Debug] New system ID: 23 Comp ID: 57 (mavsdk_impl.cpp:737)
[09:05:52|Debug] Component Unsupported component (57) added. (system_impl.cpp:389)
[09:05:52|Debug] New system ID: 153 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:52|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:52|Info ] heartbeats timed out (system_impl.cpp:279)
[09:05:52|Debug] New system ID: 184 Comp ID: 57 (mavsdk_impl.cpp:737)
[09:05:52|Debug] Component Unsupported component (57) added. (system_impl.cpp:389)
[09:05:52|Debug] New system ID: 34 Comp ID: 124 (mavsdk_impl.cpp:737)
[09:05:52|Debug] Component Unsupported component (124) added. (system_impl.cpp:389)
[09:05:52|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:52|Debug] New system ID: 232 Comp ID: 3 (mavsdk_impl.cpp:737)
[09:05:52|Debug] Component Unsupported component (3) added. (system_impl.cpp:389)
[09:05:52|Debug] Component Unsupported component (51) added. (system_impl.cpp:389)
[09:05:53|Debug] New system ID: 204 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:53|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:53|Debug] Component Unsupported component (21) added. (system_impl.cpp:389)
[09:05:53|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:53|Debug] Component Unsupported component (204) added. (system_impl.cpp:389)
[09:05:53|Debug] New system ID: 166 Comp ID: 193 (mavsdk_impl.cpp:737)
[09:05:53|Debug] Component Unsupported component (193) added. (system_impl.cpp:389)
[09:05:53|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:05:54|Debug] New system ID: 76 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:54|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:05:54|Debug] New system ID: 183 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:54|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:05:54|Info ] heartbeats timed out (system_impl.cpp:279)
[09:05:55|Debug] New system ID: 185 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:55|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:05:55|Error] Error: Param for accel offset_y failed. (telemetry_impl.cpp:1876)
[09:05:55|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:56|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:56|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:05:57|Debug] New system ID: 26 Comp ID: 132 (mavsdk_impl.cpp:737)
[09:05:57|Debug] Component Unsupported component (132) added. (system_impl.cpp:389)
[09:05:57|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:05:57|Debug] New system ID: 114 Comp ID: 143 (mavsdk_impl.cpp:737)
[09:05:57|Debug] Component Unsupported component (143) added. (system_impl.cpp:389)
[09:05:57|Debug] New system ID: 101 Comp ID: 85 (mavsdk_impl.cpp:737)
[09:05:57|Debug] Component Unsupported component (85) added. (system_impl.cpp:389)
[09:05:57|Debug] New system ID: 195 Comp ID: 20 (mavsdk_impl.cpp:737)
[09:05:57|Debug] Component Unsupported component (20) added. (system_impl.cpp:389)
[09:05:57|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:05:58|Debug] New system ID: 196 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:05:58|Debug] New system ID: 51 Comp ID: 60 (mavsdk_impl.cpp:737)
[09:05:58|Debug] Component Unsupported component (60) added. (system_impl.cpp:389)
[09:05:58|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:05:58|Error] Error: Param for accel offset_z failed. (telemetry_impl.cpp:1891)
[09:05:58|Debug] New system ID: 198 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:58|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:05:59|Warn ] sending again, retries to do: 5 (mavlink_parameter_client.cpp:1058)
[09:05:59|Debug] Component Unsupported component (160) added. (system_impl.cpp:389)
[09:05:59|Debug] New system ID: 35 Comp ID: 249 (mavsdk_impl.cpp:737)
[09:05:59|Debug] Component Unsupported component (249) added. (system_impl.cpp:389)
[09:05:59|Warn ] sending again, retries to do: 4 (mavlink_parameter_client.cpp:1058)
[09:05:59|Debug] New system ID: 5 Comp ID: 5 (mavsdk_impl.cpp:737)
[09:05:59|Debug] Component Unsupported component (5) added. (system_impl.cpp:389)
[09:05:59|Debug] Component Unsupported component (8) added. (system_impl.cpp:389)
[09:05:59|Debug] New system ID: 154 Comp ID: 61 (mavsdk_impl.cpp:737)
[09:05:59|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:06:00|Warn ] sending again, retries to do: 3 (mavlink_parameter_client.cpp:1058)
[09:06:00|Debug] Component Unsupported component (34) added. (system_impl.cpp:389)
[09:06:00|Warn ] sending again, retries to do: 2 (mavlink_parameter_client.cpp:1058)
[09:06:00|Debug] New system ID: 8 Comp ID: 38 (mavsdk_impl.cpp:737)
[09:06:00|Debug] Component Unsupported component (38) added. (system_impl.cpp:389)
[09:06:00|Debug] New system ID: 160 Comp ID: 0 (mavsdk_impl.cpp:737)
[09:06:01|Debug] Component Unsupported component (61) added. (system_impl.cpp:389)
[09:06:01|Warn ] sending again, retries to do: 1 (mavlink_parameter_client.cpp:1058)
[09:06:01|Debug] New system ID: 70 Comp ID: 235 (mavsdk_impl.cpp:737)
[09:06:01|Debug] Component Unsupported component (235) added. (system_impl.cpp:389)
[09:06:01|Debug] New system ID: 56 Comp ID: 134 (mavsdk_impl.cpp:737)
[09:06:01|Debug] Component Unsupported component (134) added. (system_impl.cpp:389)
[09:06:01|Error] retrying failed (mavlink_parameter_client.cpp:1074)
[09:06:01|Error] Error: Param for mag offset_x failed. (telemetry_impl.cpp:1816)
[09:06:01|Debug] Component Unsupported component (253) added. (system_impl.cpp:389)

I cannot see why the behavior would differ, I only have one mavsdk server installed and one version of mavproxy

mtonnberg commented 8 months ago

I have successfully removed all of the weird debug messages by explicitly setting both sysid and compid to 1. Both when I start the mavsdk-server and in the python code. However, the commands still do not work

julianoes commented 8 months ago

Ok good. So now the question is whether or how manual control works with ArduPilot.

arpitpara commented 8 months ago

will giving commands in mavproxy shell directly will help? Try giving 'arm throttle' and 'takeoff' commands.

mtonnberg commented 8 months ago

Commands(like arm, takeoff, status gps_raw_int) directly in mavproxy work. Though I do not know how the Mavlink command to do manual/joystick input looks like (I've tried to find an example but haven't found any good one). If you know how the command looks like to increase the thrust to 30% for example I can test it (without props :D ).

Also the joystick in QGC works (and QGC commmunicates over udp to the zero/mavproxy).

mtonnberg commented 8 months ago

About "So now the question is whether or how manual control works with ArduPilot". Do you know about any firmware for a 30x30mm stack that works better with mavsdk than Ardupilot?

Jai-GAY commented 7 months ago

Try giving 'arm throttle' and 'takeoff' commands.

Pi4B Ubuntu 22.04 64-bit Arducopter v4.2.3, GUIDE_NoGPS mode takeoff FAILED Action failed Name: mavsdk Version: 2.1.0 Summary: Python wrapper for MAVSDK Home-page: https://github.com/mavlink/MAVSDK-Python Author: Author-email: License: UNKNOWN Location: /home/pi/.local/lib/python3.10/site-packages Requires: aiogrpc, grpcio, protobuf Required-by: $ await drone.action_server.set_allow_takeoff(True) does not help at all. Does anything to do with AllowableFlightModes? How to use and any example?

Main in System server b4 System server done Pi4B Waiting for drone to connect... -- Connected to drone! Version: [flight_sw_major: 4, flight_sw_minor: 2, flight_sw_patch: 3, flight_sw_vendor_major: 56, flight_sw_vendor_minor: 52, flight_sw_vendor_patch: 97, os_sw_major: 0, os_sw_minor: 0, os_sw_patch: 0, flight_sw_git_hash: 376130633 , os_sw_git_hash: 663466323230383 , flight_sw_version_type: RELEASE] Flight mode: UNKNOWN -- Arming Arming error: None Battery: 9600.0 Battery_v: 16.33100128173828 Is_armed: True arm_event.is_set() = True set_takeoff_altitude: None Battery: 9600.0 Battery_v: 16.33500099182129 Is_armed: True Battery: 9600.0 Battery_v: 16.32900047302246 Is_armed: True -- Taking off print_battery CancelledError print_status_text CancelledError print_altitude CancelledError print_is_armed CancelledError print_flight_mode CancelledError Traceback (most recent call last): File "/home/pi/backup/mavsdk/mavsdk_test_20240315.py", line 214, in asyncio.run(run()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete File "/home/pi/backup/mavsdk/mavsdk_test_20240315.py", line 84, in run actionerr = await drone.action.takeoff() File "/home/pi/.local/lib/python3.10/site-packages/mavsdk/action.py", line 376, in takeoff raise ActionError(result, "takeoff()") mavsdk.action.ActionError: FAILED: 'Failed'; origin: takeoff(); params: ()

arpitpara commented 7 months ago

In my opinion, takeoff and land only works with GPS mode, if you're working in GPS denied environment, then you should try working on Offboard mode.

Jai-GAY commented 7 months ago

takeoff and land only works with GPS mode

Yes, I went out to test. the takeoff returns no error, the only problem is if health.is_global_position_ok and health.is_home_position_ok: keeps failing even though MissionPlanner reports GPS healthy, Ardupilot acquired home position. I have to comment off the check for now.

Main in System server b4 System server done Pi4B Waiting for drone to connect... -- Connected to drone! Version: [flight_sw_major: 4, flight_sw_minor: 2, flight_sw_patch: 3, flight_sw_vendor_major: 56, flight_sw_vendor_minor: 52, flight_sw_vendor_patch: 97, os_sw_major: 0, os_sw_minor: 0, os_sw_patch: 0, flight_sw_git_hash: 376130633 , os_sw_git_hash: 663466323230383 , flight_sw_version_type: RELEASE] Flight mode: LAND Waiting for drone to have a global position estimate... Battery: 9200.0 Battery_v: 15.653000831604004 -- Global position state NOT good for flying. -- Arming Battery: 9200.0 Battery_v: 15.672000885009766 Is_armed: False Is_armed: False Flight mode: HOLD Arming error: None Status: WARNING: Terrain: clamping offset 76 to 15 Battery: 9200.0 Battery_v: 15.643000602722168 Is_armed: True arm_event.is_set() = True set_takeoff_altitude: None Battery: 9200.0 Battery_v: 15.646000862121582 Is_armed: True Battery: 9200.0 Battery_v: 15.445000648498535 Is_armed: True -- Taking off Is_armed: True Flight mode: OFFBOARD takeoff error: None Battery: 9200.0 Battery_v: 15.259000778198242 arm_event.is_set() = True -- Hover 10s Is_armed: True Battery: 9200.0 Battery_v: 15.267001152038574 Is_armed: True Status: WARNING: EKF3 IMU0 MAG0 ground mag anomaly, yaw re-aligned Status: WARNING: EKF3 IMU2 MAG0 ground mag anomaly, yaw re-aligned Status: WARNING: EKF3 IMU1 MAG0 ground mag anomaly, yaw re-aligned Battery: 9200.0 Battery_v: 15.320000648498535 Is_armed: True Battery: 9200.0 Battery_v: 15.305000305175781 Is_armed: True Battery: 9200.0 Battery_v: 15.334000587463379 Is_armed: True Battery: 9200.0 Battery_v: 15.329000473022461 Is_armed: True Battery: 9200.0 Battery_v: 15.313000679016113 Is_armed: True Battery: 9100.0 Battery_v: 15.296000480651855 Is_armed: True Battery: 9100.0 Battery_v: 15.292000770568848 Is_armed: True Battery: 9100.0 Battery_v: 15.295001029968262 Is_armed: True Battery: 9100.0 Battery_v: 15.295001029968262 -- Landing Is_armed: True -- wait termination_task Is_armed: True Flight mode: LAND Battery: 9100.0 Battery_v: 15.348000526428223 Is_armed: True Battery: 9100.0 Battery_v: 15.357000350952148 Is_armed: True Battery: 9100.0 Battery_v: 15.330000877380371 Is_armed: True Battery: 9100.0 Battery_v: 15.368000984191895 Is_armed: True Battery: 9100.0 Battery_v: 15.4010009765625 Is_armed: True Battery: 9100.0 Battery_v: 15.437000274658203 Is_armed: True Battery: 9100.0 Battery_v: 15.43600082397461 Is_armed: True Battery: 9100.0 Battery_v: 15.509000778198242 print_altitude CancelledError print_flight_mode CancelledError -- disarm Is_armed: False print_is_armed CancelledError Battery: 9100.0 Battery_v: 15.50200080871582 Battery: 9100.0 Battery_v: 15.50300121307373 Battery: 9100.0 Battery_v: 15.647000312805176 print_status_text CancelledError Battery: 9100.0 Battery_v: 15.653000831604004 Battery: 9100.0 Battery_v: 15.65000057220459 Battery: 9100.0 Battery_v: 15.654000282287598 print_battery CancelledError -- run ended Main out

arpitpara commented 7 months ago

Try changing mode to STABILIZED, this might help, you might have to do it again and again before running the script. Check in QGC for any errors before running.

mtonnberg commented 7 months ago

In my opinion, takeoff and land only works with GPS mode, if you're working in GPS denied environment, then you should try working on Offboard mode.

I would like to run without GPS but during the current tests I do have GPS. Also, I have tried the offboard scripts as well.

mtonnberg commented 7 months ago

@arpitpara @julianoes Any ideas/proposals on how I can check if it is Ardupilot that is the problem? I could flash the FC to INav instead, do you think that is a test worth doing?

julianoes commented 7 months ago

I would dig into whatever source code (e.g. ArduPilot) and check what's happening.