MAVSDK-Python
MAVSDK-Python copied to clipboard
When set GimbalMode.YAW_FOLLOW , there is crash!!!
I want to look at the determined roi region with fixed camera but I am getting this error.
Traceback (most recent call last):
File "C:\Users\m42se\PycharmProjects\odtu\main.py", line 86, in <module>
loop.run_until_complete(run())
File "C:\Users\m42se\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\m42se\PycharmProjects\odtu\main.py", line 23, in run
await drone.gimbal.set_mode(GimbalMode.YAW_FOLLOW)
File "C:\Users\m42se\PycharmProjects\odtu\venv\lib\site-packages\mavsdk\gimbal.py", line 484, in set_mode
raise GimbalError(result, "set_mode()", gimbal_mode)
mavsdk.gimbal.GimbalError: ERROR: 'Error'; origin: set_mode(); params: (<GimbalMode.YAW_FOLLOW: 0>,)
That's not nice :astonished:, let me check that.
So I just ran the gimbal example against PX4 SITL with the typhoon_h480 model and it all worked, this is with latest MAVSDK-Python 1.0.0 version. Can you double check that?
And if it fails, could you share the exact steps or script that I should try to reproduce it? Thank you.
We tried with the new version and we keep getting an error like this. Thanks for fast response.
ERROR MESSAGE:
Traceback (most recent call last): File "D:\Projeler\2022_ws\UORG_MAVSDK_v2.py", line 93, in <module> loop.run_until_complete(run()) File "C:\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "D:\Projeler\2022_ws\UORG_MAVSDK_v2.py", line 69, in run await drone.gimbal.set_mode(GimbalMode.YAW_FOLLOW) File "C:\Python39\lib\site-packages\mavsdk\gimbal.py", line 484, in set_mode raise GimbalError(result, "set_mode()", gimbal_mode) mavsdk.gimbal.GimbalError: ERROR: 'Error'; origin: set_mode(); params: (<GimbalMode.YAW_FOLLOW: 0>,)
SCRIPT: GIMBAL_MAVSDK.txt
Ok, and you're trying this against what, SITL? And if so, which model?
I am using MAVSDK-Puthon 1.3.0 and ArduPilot SITL with ArduCopter/+
vehicle and have the same error. Everything was configured according to the official manual.
Gimbals are probably not supported for ArduCopter yet. The mavlink protocol might be slightly different there.
Thanks, @julianoes. What do you suggest to use to test gimbal controls?
So I would expect that the gimbal v1 protocol works for ArduPilot, however, the mode command might not be implemented, or implemented in the same way. If you figure out how/if ArduPilot allows you to change the mode, then we can implement that in MAVSDK.
Note that gimbal is a bit of a sad topic, as it was - a long time ago - decided on the MAVLink call that there should be a new protocol, which I then developed but which is only implemented and accepted very slowly, if at all.