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

Why is takeoff called here? I saw that takeoff is set in the create_mission_raw function. For APM, do you need to set takeoff in the mission and also call takeoff outside? Why? #2288

Open
wenii opened this issue Apr 24, 2024 · 6 comments
Labels

Comments

@wenii
Copy link

wenii commented Apr 24, 2024

ASSERT_EQ(mission_raw.start_mission(), MissionRaw::Result::Success);

@julianoes
Copy link
Collaborator

It's true, we could probably do this without the explicit takeoff call. Can you make a pull request to remove it?

@wenii
Copy link
Author

wenii commented May 6, 2024

"I tried both with the APM SITL simulator and a real drone. If there's no TAKE_OFF command in create_mission_raw, it won't take off. Also, keeping the TAKE_OFF command in the mission plan without explicitly calling the takeoff function won't make it take off either."

@wenii
Copy link
Author

wenii commented May 6, 2024

If that's the case, it's fine as long as it can take off and execute the mission. After all, the MAVSDK's compatibility with APM isn't perfect. Now, I'm facing another issue where I can't execute multiple mission plans. For instance, if I upload a mission plan and it finishes executing, then I upload another one, the second mission plan doesn't execute. There are no error reports; the drone just keeps hovering at the end of the first mission's route.

@julianoes
Copy link
Collaborator

Hm, so it doesn't reset current to 0? Can you explicitly to set_current to reset to 0?

@wenii
Copy link
Author

wenii commented May 8, 2024

Yes, later I found that setting set_current to 0 after uploading a new mission allows the new mission to take effect before the completion of the first mission. However, if the first mission has already been completed and a new mission is uploaded afterward, the new mission still may not execute. Then, I set the command of the last mission_item in the first mission to MAV_CMD_NAV_LOITER_UNLIM. This allows the second mission to execute seamlessly.

@julianoes
Copy link
Collaborator

I'm a bit confused why it doesn't reset the current on re-upload, that's odd.

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

No branches or pull requests

2 participants