What you suggest is closer to a real enhancement. What I was talking about was much simpler.
Use the single current mixer.
I assume you only need 6 mixers of 12. If more needed, start by doubling what you need and increasing current channels to that (say 14 or 16).
Have an offset per flight mode (basically 0 or 6) that is stored like the AssistedMode (for instance) is stored.
Hard code or decide a way to decide what offset is what vehicle type (e.g. fixedwing or VTOL)
Find all the places that access the vehicle type. There are several and not all have the TreatCustomCraftAs override. Write a function to replace this duplicate code. That code will also be modified to look at the new offset to vehicle type setting (know what vehicle type e.g. FW or VTOL, it is by the FMS position).
Modify the mixer / actuator code to know what the offset is (based on switch position) and use that when accessing the mixer to determine e.g. whether to use mixer[0] or mixer[6]
and thus which output channel to use e.g. when code calls for roll (e.g. when moving the roll stick or when FC stabilizes in the roll axis)
No new UAVO's and all the stuff that needs to be (understood and) done for that such as
*SettingsInitialize();
*ConnectCallback();
not to mention a LOT of learning curve stuff.
Use banks to allow different PIDs for the different flight modes.
Aircraft will know it is VTOL in one mode and FW in another mode.
I know the code well enough that this is a 1 day code, 1 day test enhancement.
A later enhancement would move RotateVirtual to the bank settings so that for instance a tail sitter could have two different angles for "aircraft is level". Tail sitting hover (nose up) and fixed wing flight (nose out), and you could do attitude mode or GPS modes in either configuration. An enhancement of that could have a tail sitter airplane take off vertically as a VTOL, fly a mission in FW, and land in VTOL.
This fuller version enhancement would be usable for flying a quad as X or + in flight. That is how I would test it.
The complete enhancement would include the following that allows smooth timed transition from one mode to another, like if a slow servo controls the wing tilt. Whether the aircraft is stable or flyable when between modes is a subject for discussion and if generally not, then this part of the enhancement is not useful. This section contains some coding comments I wanted to document while they were in mind:
- "Gated control" where gate=-1 copies inverted input to output, gate=+1 copies non-inverted input to output, -1 <= gate <= +1
- Gated control could be implemented as a smooth "parametric equation" of two mixers (or two sections of one mixer) where at t=0 you are using one mixer, at t=1/2 you are using a mixture of the two mixers, and at t=1 you are using the other mixer. But I wonder if there are simple cases that need a "gated control" rather than the whole "mixed mixers"
- Each change of the mixer parameterization ... outputs to a temporary mixer that is used for flight, but is not stored anywhere.
- Gated control SHOULD be implemented as a smooth "parametric equation" of two mixers and not as individual gated controls. That allows each new temporary mixer parameterization to be calculated at low priority with very little change to the code that uses the mixer to output real time variations in stabilization. No new large number of gated controls to be calculated in the high priority output tasks.
- PIDs from initial and final PID banks would be mixed into "current PIDs" this way as well.
- The VTOL / FW status (e.g. how to hover with GPS) would be switched at some point in the transition...
- Timed signal which runs the signal output from X to Y in Z seconds. This would cause the slow, smooth configuration change from first mixer to second mixer.
- Connections FROM RC inputs and stabilization outputs
- Connections TO actuators, mixer tables, PIDs, config state (FW / VTOL)
- Fixed value signals?
With that, a flight mode switch or accessory switch could do an instant or timed flight configuration change, or a pot could allow you to fly at any flight configuration even halfway between the two normal modes.