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

commander: require local position for home #7958

Merged
merged 1 commit into from
Sep 13, 2017
Merged

Conversation

julianoes
Copy link
Contributor

This fixes (or at least works around) a race condition where the
status_flags.condition_local_position_valid is still false but the
status_flags.condition_global_position_valid is already true.

The way to reproduce it is t:

  1. Poll home position to check if home is initialized
  2. Send arm and takeoff command as soon as home is initialized

Then arming will succeed but takeoff will fail because there is a check
for status_flags.condition_local_position_valid in
main_state_transition() to enter TAKEOFF.

Tested in SITL using DroneCore takeoff and land example.

The error case was found by @hamishwillee.

This fixes (or at least works around) a race condition where the
`status_flags.condition_local_position_valid` is still `false` but the
`status_flags.condition_global_position_valid` is already `true`.

The way to reproduce it is t:
1. Poll home position to check if home is initialized
2. Send arm and takeoff command as soon as home is initialized

Then arming will succeed but takeoff will fail because there is a check
for `status_flags.condition_local_position_valid` in
`main_state_transition()` to enter TAKEOFF.
@julianoes julianoes requested a review from bkueng September 13, 2017 07:07
@bkueng bkueng merged commit ee6a792 into master Sep 13, 2017
@bkueng bkueng deleted the fix-takeoff-condition branch September 13, 2017 08:06
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

Successfully merging this pull request may close these issues.

3 participants