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

Multi function OSD utility #8698

Merged
merged 18 commits into from
Aug 31, 2023

Conversation

breadoven
Copy link
Collaborator

@breadoven breadoven commented Jan 12, 2023

Provides a dual purpose Multi Function OSD utility field used as a Warning display and also to allow activation of infrequently used functions/modes.

Warnings are displayed for 10s when first triggered after which the warning disappears to be replaced with an alert symbol with a number showing the active warning total. Active warnings are then redisplayed for 5s on a rolling 30s cycle. The field is blank if there are no warnings. Current Warnings are provided for Battery state, Vibration level, GPS Fix or Failure, RTH Sanity (>200m heading in wrong direction), Altitude Sanity (difference between estimated and GPS altitude > 20m), Compass failure and Ground Test mode being active. A BARO health warning could be added (#8233 and #8534).

Functions use a single mode to select between different functions based on feedback provided by the Multi Function OSD field. Functions are selected by briefly toggling the mode ON/OFF with this sequence repeated until the required function is displayed in the OSD. The function is then triggered by activating the mode for > 3s. Deactivating the mode for > 3s resets everything leaving the OSD field blank. Ideally a momentary switch should be used to operate the mode although it should also work with a normal switch. Current functions include redisplaying any warnings, emergency landing activation, Safehome suspend, Trackback suspend, Turtle mode activation and an Emergency arming function (which does the same as the multi toggle Emergency arming but using the 3s function trigger instead). The first function is deliberately set to redisplay warnings only so this is all that should happen if the mode is triggered accidently (likely if a non-momentary switch be used).

Tested on the HITL sim OK. There could be an issue with RC latency at longer ranges interfering with the timings for function selection. Needs testing to know if it's likely to cause a problem. And I guess this won't work for some HD OSD systems ?

@MrD-RC
Copy link
Collaborator

MrD-RC commented Jan 30, 2023

I think a handy addition would be the ability to switch between RTH to home point or safehome from that functions menu.

@breadoven
Copy link
Collaborator Author

I think a handy addition would be the ability to switch between RTH to home point or safehome from that functions menu.

In some ways this sort of thing could be more useful than using the functions to simplify triggering things that can be done some other way, e.g. emergency arming is always available using the arm switch. There is no way of switching off Safehomes inflight so setting a function to do this could be useful. I guess you could also do it through programming, but then you'd need to set up a trigger of some sort, something these functions avoid.

Main limitation of the functions is the number that could be made available before it becomes too clunky to use. Probably 10 max would be the limit so you'd really only want to use them where it made sense.

@MrD-RC
Copy link
Collaborator

MrD-RC commented Feb 1, 2023

Yes, I agree. I think 10 would be about the maximum you could have. Plus having options that are not available or easy to use would be advantageous. For example, your manual emergency landing. I know that can be activated by toggling the pos hold switch. But some mode switch setups, the toggling action could be tricky to perform.

@breadoven
Copy link
Collaborator Author

For example, your manual emergency landing. I know that can be activated by toggling the pos hold switch. But some mode switch setups, the toggling action could be tricky to perform.

I did realise it can be awkward to multi toggle using "Sticky" momentary switches. Can be done but not easy doing it quickly. However, I did work out how to get a Sticky switch to auto toggle if you press and hold it, combination of Sticky and Timer. Short press just gives you the usual Sticky toggle action, but long press sees it switch ON/OFF at whatever frequency you set using the Timer.

@breadoven
Copy link
Collaborator Author

Added function to suspend Safehomes. Currently works for RTH and FS RTH. Might be desirable to limit this function to normal RTH only so FS RTH uses Safehomes regardless ?

@Jetrell
Copy link

Jetrell commented Feb 15, 2023

Might be desirable to limit this function to normal RTH only so FS RTH uses Safehomes regardless ?

That makes sense. We can't really select anything under an RX failsafe condition.
I was also thinking it may be beneficial to enable RTH Trackback via this method, with the same non FS logic as you've applied to Safehome? This may benefit boats and rovers too,

@MrD-RC
Copy link
Collaborator

MrD-RC commented Feb 15, 2023

Yeah, I'd agree with that. Leave FS as what is set up pre-flight.

@Jetrell
Copy link

Jetrell commented Feb 23, 2023

@breadoven I'm not sure if you're looking for other fields to add?
I had thought of Magnetometer disable for fixed wings. In cases when the course tracking may be too heavily influenced by it on a windy day.
But without being able to ever disable it in flight before. I wasn't sure if just turning it off without a reboot, was possible, or would have any bad side effects?

@breadoven
Copy link
Collaborator Author

@breadoven I'm not sure if you're looking for other fields to add? I had thought of Magnetometer disable for fixed wings. In cases when the course tracking may be too heavily influenced by it on a windy day. But without being able to ever disable it in flight before. I wasn't sure if just turning it off without a reboot, was possible, or would have any bad side effects?

It should be possible if losing the magnetometer is allowed gracefully as it were. Would need checking to be sure.

@breadoven
Copy link
Collaborator Author

I think is is OK to merge now. Only thing missing are digital fonts for a general alert symbol, yellow triangle with a ! inside ... or something similar.

@breadoven breadoven merged commit 29b86a0 into iNavFlight:master Aug 31, 2023
14 checks passed
@breadoven breadoven added this to the 7.0 milestone Aug 31, 2023
@breadoven breadoven added the Release Notes Add this when a PR needs to be mentioned in the release notes label Sep 4, 2023
@breadoven breadoven deleted the abo_multi_function_utility branch September 8, 2023 07:35
@Choolet
Copy link

Choolet commented Nov 7, 2023

Functions are selected by briefly toggling the mode ON/OFF with this sequence repeated until the required function is displayed in the OSD.

@breadoven Would I be correct in saying the toggle action ranges from 1000 - 2000 microseconds?
Is it possible for the toggle range to be smaller? For example 1000 - 1200.

I like this feature because it adds functionality when few RC channels are left.
In my case I have many modes and other features on small portions of the same channel, by using TX mixers.
I would like to use this feature on the same channel as other modes.

@breadoven
Copy link
Collaborator Author

@breadoven Would I be correct in saying the toggle action ranges from 1000 - 2000 microseconds? Is it possible for the toggle range to be smaller? For example 1000 - 1200.

The toggle action is just based on selecting the Multifunction mode ON/OFF so it just depends on how you've set the mode up in the Configurator modes tab. Doesn't need to be 1000-2000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Font change Release Notes Add this when a PR needs to be mentioned in the release notes Requires Configurator Testing Required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants