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

Cannot send set position command in NED #225

Open
adrian-carrio opened this issue Oct 7, 2024 · 6 comments
Open

Cannot send set position command in NED #225

adrian-carrio opened this issue Oct 7, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@adrian-carrio
Copy link

Describe the bug

Hello,

I am trying to fly a Mavic Air 2S in an indoor environment using local coordinates. I am able to take off and land autonomously without a problem using mavlink commands with python scripts. However, when I send a command like the one below the drone does not move at all. I have tried with various bit masks without success.

set_position_target_local_ned_encode(
0,
0, 0,
mavutil.mavlink.MAV_FRAME_LOCAL_NED,
bit_mask,
x, y, z,
0, 0, 0,
0, 0, 0,
0, 0)

Any help is very much appreciated.

Steps To Reproduce

No response

Screenshots

No response

Drone Model

Mavic Air 2S

Smartphone Model

No response

Additional context

No response

@adrian-carrio adrian-carrio added the bug Something isn't working label Oct 7, 2024
@kripper
Copy link
Collaborator

kripper commented Oct 7, 2024

It's probably not implemented (check the android logs).
You can implement it or check the code and use an alternative command.

@adrian-carrio
Copy link
Author

It is indeed implemented, simply not working. Has anyone been able to send this command?
Also, using the virtual sticks demo app from DJI's SDK I can access the local pose but I cannot access the local pose using mavlink. Has anyone been successful here? Thank you

@kripper
Copy link
Collaborator

kripper commented Oct 24, 2024

It's probably not correctly implemented.
Pull requests are welcome.

@kripper
Copy link
Collaborator

kripper commented Oct 24, 2024

Should be quite easy to fix though.

BTW, I implemented it here and it probably was working for my use cases.

Use RD in test mode and debug using Android Studio.

@adrian-carrio
Copy link
Author

Thank you. Do you know whether it could work without GPS signal? Is there some way to know this other than trial & error?

@kripper
Copy link
Collaborator

kripper commented Oct 25, 2024

We use the SDK to get the "GPS location", but the firmware is probably returning a EKF filtered location merging GPS + accelerometer + CV and other inputs.

Depending on your model and firmware, your aircraft may even reject to take off if the signal is too weak, or fly in a less stable flying mode with less precision. Check the SDK documentation for more details.

RD is also checking the signal and rejecting takeoff if the GPS signal is too weak.

GPS is normally weak or takes some time to calibrate when not open air.

The GPS signal is displayed on RD and there are messages on the log (logcat).

In theory, you could modify RD and implement a
ORB SLAM algorithm to navigate only using the camera input without GPS if that's what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants