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

mission: write next mission item into pos_sp_triplet->current if current mission item did not have position #13971

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ndepal
Copy link
Contributor

@ndepal ndepal commented Jan 17, 2020

Fixes #13668

I was only able to reproduce the issue described when the drone is already flying.

The problem is that, if a new mission begins and it's first item is a command, Mission::set_mission_items() will not write to pos_sp_triplet->current, but that was marked invalid by reset_triplets().

FlightTaskAuto then goes into failsafe.

https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L564-L567

Additionally, depending on timing, the takeoff state machine uses NAN constraints to update its state, causing the state machine to fail to progress, which then makes it impossible to detect landing (we will make have a separate PR to guard against that: #13973).

https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L598

@ndepal ndepal requested review from dagar and MaEtUgR January 17, 2020 17:49
@dagar
Copy link
Member

dagar commented Jan 17, 2020

Thanks for fixing this and the daily reminder that navigator complexity is really becoming untenable.

I understand the specific fix you described, it's just not clear to me how we ensure navigator isn't filled with more of these cases.

@dagar
Copy link
Member

dagar commented Jan 17, 2020

@dagar dagar added the bug label Jan 17, 2020
@ndepal
Copy link
Contributor Author

ndepal commented Jan 17, 2020

I understand the specific fix you described, it's just not clear to me how we ensure navigator isn't filled with more of these cases.

Yes, seems almost impossible.

Trivial style failure in CI.

I'll fix it on Monday.

@ndepal
Copy link
Contributor Author

ndepal commented Jan 20, 2020

Fixed the style issue and rebased on master.

@ndepal ndepal force-pushed the bugfix/mission_command branch from 34bc634 to 0e30057 Compare January 20, 2020 08:54
@julianoes
Copy link
Contributor

I understand the specific fix you described, it's just not clear to me how we ensure navigator isn't filled with more of these cases.

I agree :(

@ndepal
Copy link
Contributor Author

ndepal commented Jan 24, 2020

With #14020 merged, I believe the problem of the flight task going into failsafe no longer happens. So this fix is less critical. However, I still think the mission should not publish a current.valid == false triplet.

@stale
Copy link

stale bot commented Apr 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

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

Successfully merging this pull request may close these issues.

Position controller failsafe reported when the mission starts with a command
3 participants