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
Merged

Conversation

shellixyz
Copy link
Collaborator

@shellixyz shellixyz 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
Copy link
Collaborator Author

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

@digitalentity
Copy link
Member

Maybe it's better to fix HOVER_PRIOR_TO_LANDING state?

@shellixyz
Copy link
Collaborator Author

@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
Copy link
Member

@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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the else ? Why ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok 👍. Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.
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