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

Mavlink crashes after trying to call «Arm» command #191

Open
Harvester-76 opened this issue Mar 18, 2021 · 6 comments
Open

Mavlink crashes after trying to call «Arm» command #191

Harvester-76 opened this issue Mar 18, 2021 · 6 comments

Comments

@Harvester-76
Copy link

When I call drone.arm() it completes with an error. After command completion in my «onError» callback I have the next error

Снимок экрана 2021-03-18 в 17 55 26

«The operation couldn’t be completed. (MAVSDK_Swift.Action.ActionError error 1.)»

After that my application crashes in another thread in binary file (90% that it happens somewhere inside SDK) so that I can’t even understand where exactly it happens. I suppose that there might be some problem in Mavlink communication with the drone but I need to understand what exactly happens and what seems to be wrong for SDK to work correctly.

Снимок экрана 2021-03-18 в 17 54 38

@JonasVautherin
Copy link
Collaborator

@douglaswsilva @byuarus: Would you happen to have an opinion on that? Does it look like a crash indeed, or is it because the error is not handled properly? Just to be sure 😊.

@byuarus
Copy link
Collaborator

byuarus commented Mar 18, 2021

@JonasVautherin I haven't seen the crash in drone.arm() action but I saw very similar crashes in other places during connection and initial subscription on telemetry while testing H520.
I'll add more info when I'll find repo steps in mavsdk-swift-example app.

@viona31
Copy link

viona31 commented Mar 19, 2021

@JonasVautherin Could you please tell what does "The operation couldn’t be completed. (MAVSDK_Swift.Action.ActionError error 1" error mean? Does this error correspond to MAV_RESULT_FAILED or MAV_RESULT_DENIED?

@JonasVautherin
Copy link
Collaborator

I think your log says MAVSDK_Swift.Action.ActionResult.Result.unknown. I would think it is sent from here, so somehow send_command_async() fails with an "unknown" code...

Is it a PX4 drone?

@viona31
Copy link

viona31 commented Mar 22, 2021

Is it a PX4 drone?

It's not but it uses mavlink for communication.

Firmware developer says:
For 'arm' command the drone returns https://mavlink.io/en/messages/common.html#MAV_RESULT
either MAV_RESULT_ACCEPTED or MAV_RESULT_FAILED or MAV_RESULT_DENIED.

Can either of this values lead to the error?

@JonasVautherin
Copy link
Collaborator

JonasVautherin commented Mar 22, 2021

I am sorry, at this point I think you'll have to go debug what's happening in C++. I only use PX4 myself, and in your case I don't even know what autopilot you are using.

One thing you can do is try your code against PX4 SITL and check that it works 👍.

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

4 participants