MAVSDK-Python icon indicating copy to clipboard operation
MAVSDK-Python copied to clipboard

When set GimbalMode.YAW_FOLLOW , there is crash!!!

Open msasen opened this issue 2 years ago • 8 comments

Ekran Görüntüsü (8)

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>,)

msasen avatar Mar 17 '22 22:03 msasen

That's not nice :astonished:, let me check that.

julianoes avatar Mar 18 '22 00:03 julianoes

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.

julianoes avatar Mar 18 '22 00:03 julianoes

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

irfansamur avatar Mar 21 '22 13:03 irfansamur

Ok, and you're trying this against what, SITL? And if so, which model?

julianoes avatar Mar 23 '22 04:03 julianoes

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.

Sitin avatar Jun 21 '22 12:06 Sitin

Gimbals are probably not supported for ArduCopter yet. The mavlink protocol might be slightly different there.

julianoes avatar Jun 21 '22 16:06 julianoes

Thanks, @julianoes. What do you suggest to use to test gimbal controls?

Sitin avatar Jun 21 '22 16:06 Sitin

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.

julianoes avatar Jun 22 '22 05:06 julianoes