Skip to content

Fix RTH hover above home - #3332

Merged
fiam merged 1 commit into
iNavFlight:developmentfrom
shellixyz:fix_rth_hover
Jun 11, 2018
Merged

Fix RTH hover above home#3332
fiam merged 1 commit into
iNavFlight:developmentfrom
shellixyz:fix_rth_hover

Conversation

@shellixyz

@shellixyz shellixyz commented Jun 6, 2018

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator Author

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

@digitalentity

Copy link
Copy Markdown
Member

Maybe it's better to fix HOVER_PRIOR_TO_LANDING state?

@shellixyz

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

@shellixyz good point, agreed

@digitalentity digitalentity added this to the 2.0 milestone Jun 8, 2018
Comment thread src/main/io/osd.c Outdated
if (STATE(FIXED_WING))
return OSD_MESSAGE_STR("LOITERING AROUND HOME");
else
return OSD_MESSAGE_STR("HOVERING");

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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