-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Add osd switching via stick inputs in disarm state #27877
base: master
Are you sure you want to change the base?
Conversation
fd74178
to
cdc4255
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.
The new option would need to be documented in the relevant parameter description in AP_OSD.cpp
Not sure why we haven't supported this before. Seems odd.
needs Andy's approval that this does not interfere with his param change code |
Pretty sure this is going to interact very badly with the param stuff and runcam menus. I think probably at a minimum you need to check that you are not in the runcam osd menus and disable this behaviour if you are. The param stuff is the same I think - you need to check you are not in these menus when enabling this stuff. |
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.
Need to check whether you are in runcam or osd parameter menus
cdc4255
to
e07d39d
Compare
Hi! For now, there is no interference between the param menu and the used stick combination. |
Does it work ok? I mean if its working well with the parameter menus then that's great. |
yep, so far so good |
e07d39d
to
497aad5
Compare
Sticks inputs: roll mid && pitch high && yaw low && throttle mid Signed-off-by: 4th <[email protected]>
497aad5
to
f9e74b6
Compare
@Hwurzburg |
cebfc34
to
d241686
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.
We don't care if RunCam is preventing arming.
We care that we're in the RunCam menus.
So use an appropriately-named method.
Byte-cost for this feature:
|
... also has to pass CI |
This can be quite difficult. |
Signed-off-by: Mr4th <|\/|>
Signed-off-by: Mr4th <|\/|>
Signed-off-by: Mr4th <|\/|>
d241686
to
65cd913
Compare
@@ -599,6 +606,32 @@ void AP_OSD::update_current_screen() | |||
last_switch_ms = 0; | |||
} | |||
break; | |||
case STICKS_INPUT: | |||
if (!AP_Notify::flags.armed && !AP::runcam()->in_menu()) { |
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.
You don't need to check for armed here. You can't be in menu and armed
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.
... also the wrong way to check if you're armed; you ask the arming library directly if you're armed.
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.
You don't need to check for armed here. You can't be in menu and armed
Disagree. We should not pre-suppose the inner-workings of AP_RunCam here.
We should both check we are not armed and that we aren't going to screw over AP_RunCam somehow.
if (!AP_Notify::flags.armed && !AP::runcam()->in_menu()) { | |
if (!AP::arming().is_armed() && !AP::runcam()->in_menu()) { |
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.
... actually, you will need to add #if
s around the call to the runcam singleton here, or we'll end up with compilations failures when runcam isn't compiled in
@@ -244,7 +244,7 @@ bool AP_RunCam::pre_arm_check(char *failure_msg, const uint8_t failure_msg_len) | |||
} | |||
|
|||
// currently in the OSD menu, do not allow arming | |||
if (is_arming_prevented()) { |
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.
please don't change these - it makes it less clear. I don't think this is what @peterbarker was proposing, he suggested having two functions and I think that would be fine.
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.
You will also need to squash the commits
We do internally. I object to this rename internally, but fine for it to be used externally. |
@@ -78,7 +79,7 @@ const AP_Param::GroupInfo AP_OSD::var_info[] = { | |||
// @Param: _SW_METHOD | |||
// @DisplayName: Screen switch method | |||
// @Description: This sets the method used to switch different OSD screens. | |||
// @Values: 0: switch to next screen if channel value was changed, 1: select screen based on pwm ranges specified for each screen, 2: switch to next screen after low to high transition and every 1s while channel value is high | |||
// @Values: 0: switch to next screen if channel value was changed, 1: select screen based on pwm ranges specified for each screen, 2: switch to next screen after low to high transition and every 1s while channel value is high, 3: switches to next screen if the sticks in the next position: roll - middle, pitch - high, throttle - middle, yaw - left. Keeps toggling to next screen every 1s while sticks in mentioned positions |
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 causes a CI metadata failure
// @Values: 0: switch to next screen if channel value was changed, 1: select screen based on pwm ranges specified for each screen, 2: switch to next screen after low to high transition and every 1s while channel value is high, 3: switches to next screen if the sticks in the next position: roll - middle, pitch - high, throttle - middle, yaw - left. Keeps toggling to next screen every 1s while sticks in mentioned positions | |
// @Values: 0: switch to next screen if channel value was changed, 1: select screen based on pwm ranges specified for each screen, 2: switch to next screen after low to high transition and every 1s while channel value is high, 3: switches to next screen if the sticks are held roll-middle pitch-high throttle-middle and yaw-left. Keeps toggling to the next screen every 1s while sticks are in the mentioned positions |
Sticks inputs: roll mid && pitch high && yaw low && throttle mid