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

Fix RTH hover above home #3332

Merged
merged 1 commit into from Jun 11, 2018

Conversation

Projects
None yet
3 participants
@shellixyz
Copy link
Collaborator

commented Jun 6, 2018

The state machine was switching to NAV_STATE_RTH_LANDING even when landing was not allowed which made the throttle during hover unable to go over cruise throttle impeding the ability of the craft to stay at the target altitude.

Don't merge yet I need to test this fix.

@shellixyz shellixyz force-pushed the shellixyz:fix_rth_hover branch from 6c57215 to 4e8f9cd Jun 6, 2018

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 6, 2018

Tested on FW, RTH loiter around home is now working as intended. Ready to merge.

@digitalentity

This comment has been minimized.

Copy link
Member

commented Jun 7, 2018

Maybe it's better to fix HOVER_PRIOR_TO_LANDING state?

@shellixyz

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 8, 2018

@digitalentity I chose this way for these reasons:

  1. It would have meant duplicating the sanity checks
  2. It would have made the code harder to read in my opinion
  3. I added NAV_RC_ALT to the final hover and it wouldn't have made sense to add it to the HOVER_PRIOR_TO_LANDING state
@digitalentity

This comment has been minimized.

Copy link
Member

commented Jun 8, 2018

@shellixyz good point, agreed

@digitalentity digitalentity added this to the 2.0 milestone Jun 8, 2018

if (STATE(FIXED_WING))
return OSD_MESSAGE_STR("LOITERING AROUND HOME");
else
return OSD_MESSAGE_STR("HOVERING");

This comment has been minimized.

Copy link
@fiam

fiam Jun 9, 2018

Member

Could you drop the else and add braces in the if?

This comment has been minimized.

Copy link
@shellixyz

shellixyz Jun 10, 2018

Author Collaborator

Drop the else ? Why ?

This comment has been minimized.

Copy link
@fiam

fiam Jun 10, 2018

Member

Drop the else, not its contents :-). Something like...

+if (STATE(FIXED_WING)) {
+    return OSD_MESSAGE_STR("LOITERING AROUND HOME");
+}
+return OSD_MESSAGE_STR("HOVERING");

This comment has been minimized.

Copy link
@shellixyz

shellixyz Jun 10, 2018

Author Collaborator

Oh ok 👍. Done

This comment has been minimized.

Copy link
@fiam

fiam Jun 11, 2018

Member

Thanks!

Fix RTH hover above home
The state machine was switching to NAV_STATE_RTH_LANDING even when landing was not allowed which made the throttle during hover unable to go over cruise throttle impeding the ability of the craft to stay at the target altitude.

@shellixyz shellixyz force-pushed the shellixyz:fix_rth_hover branch from 4e8f9cd to 4339a86 Jun 10, 2018

@fiam fiam merged commit f7f34ea into iNavFlight:development Jun 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.