-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Sub: allow SURFACE mode to work with no altitude data #29996
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
Conversation
b80ed6f
to
7a0d333
Compare
LGTM...sims fine...did not think you would want to get rid of requires GPS in the mode....if you are happy, I am happy |
@@ -95,8 +95,8 @@ bool Sub::set_mode(Mode::Number mode, ModeReason reason) | |||
|
|||
// check for valid altitude if old mode did not require it but new one does | |||
// we only want to stop changing modes if it could make things worse | |||
if (flightmode->has_manual_throttle() && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this rename makes it inconsistent with Copter. That's not necessarily a blocker but as we try to move vehicles closer to each other, let's try not to move in the opposite direction unless it's really necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially I had just created a new requires_altitude
, which is what ardusub actually wants to know.
but that made has_manual_throttle
unused, which is why the PR ended up like this.
I'm quite set on making the code "make sense" for someone reading (which means using the new name). but I don't mind keeping has_manual_throttle() for compatibility. Note that for surface mode, these are not equivalent.
It's really great to see this! I'm not the Sub maintainer so please take my comments with a grain of salt. I'm just being as pedantic as I would be if the code were Copter or Rover. |
7a0d333
to
e7e69b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine, thanks!
c187d3c
to
358d0b6
Compare
Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>
358d0b6
to
9d328f9
Compare
This fixes an issue where SURFACE mode doesn't work on vehicles with no baros for altitude sensor.