Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goto example returns action error #633

Open
yunpengye opened this issue Nov 1, 2023 · 7 comments
Open

goto example returns action error #633

yunpengye opened this issue Nov 1, 2023 · 7 comments

Comments

@yunpengye
Copy link

I tried the goto.py in the examples but returns a action error

Tried in SITL Gazebo

python3 goto.py 
Waiting for drone to connect...
-- Connected to drone!
Waiting for drone to have a global position estimate...
-- Global position state is good enough for flying.
Fetching amsl altitude at home location....
-- Arming
-- Taking off
Traceback (most recent call last):
  File "goto.py", line 47, in <module>
    asyncio.run(run())
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "goto.py", line 38, in run
    await drone.action.goto_location(47.397606, 8.543060, flying_alt, 0)
  File "/home/yunpeng/.local/lib/python3.8/site-packages/mavsdk/action.py", line 548, in goto_location
    raise ActionError(result, "goto_location()", latitude_deg, longitude_deg, absolute_altitude_m, yaw_deg)
mavsdk.action.ActionError: UNSUPPORTED: 'Unsupported'; origin: goto_location(); params: (47.397606, 8.54306, 508.1050109863281, 0)
@Jaeyoung-Lim
Copy link

I can confirm that this is a problem. The vehicle actually reaches the target point, but mavsdk returns an error

@JonasVautherin @julianoes Any clues on how we can solve this?

@JonasVautherin
Copy link
Collaborator

JonasVautherin commented Nov 1, 2023

Seems like it throws UNSUPPORTED, which from the implementation seems to come either from here or from here, which is translated from here 🤔.

Could it be that PX4 returned MAV_RESULT_UNSUPPORTED for some reason?

@Jaeyoung-Lim
Copy link

Jaeyoung-Lim commented Nov 2, 2023

@JonasVautherin Looked a bit into PX4 side, and indeed PX4 returns MAV_RESULT_UNSUPPORTED

It is complaining that the mode switch was not requested: https://github.com/PX4/PX4-Autopilot/blob/d6dbf38a1ba376cde9e65c10430e6feb52f6fdd5/src/modules/commander/Commander.cpp#L723

It seems like the check was introduced in PX4/PX4-Autopilot#22078, so looks like a real regression to me

@Jaeyoung-Lim
Copy link

Jaeyoung-Lim commented Nov 2, 2023

@JonasVautherin I have made a fix here: mavlink/MAVSDK#2170

@farhad-ibrahimzade
Copy link

Hey all, thank you for opening this issue. I seem to be getting the same result when I run goto.py in examples. I have looked at the fix here, but I am not sure how to proceed to fix the error. Can you please explain how to implement the fix in MAVSDK Python?

@farhad-ibrahimzade
Copy link

@JonasVautherin I have made a fix here: mavlink/MAVSDK#2170

Thank you for this. Could you please walk me through how to implement the fix in mavsdk python?

@julianoes
Copy link
Collaborator

So the fix is in main, and not the current released v1.4 MAVSDK version. So I assume we have to wait until v2 is released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants