This adds four-way auto-hover to Flightgear's Harrier-GR3. This allows automated control of vertical, forwards and lateral speeds, plus heading rotation speed.
The diff/bundle below is dated 2019-03-31, and is relative to fgaddon:Aircraft/Harrier-GR3 svn r3850 / git-svn:Aircraft/Harrier-GR3 id 22e4bd0d9b05: "Harrier-GR3: restore the CoG.".
harrier-auto-hover.diff: raw diff.
harrier-auto-hover.bundle: git bundle.
Control in vertical plain is slightly different from the original vertical-only auto-hover patch.
As of 2019-03-31:
Usage is described in aircraft help:
Alt-Page up Auto-hover vertical: increment target vertical speed Alt-Page down Auto-hover vertical: decrement target vertical speed Alt-0 Auto-hover vertical: set target vertical speed to zero Alt-- Auto-hover vertical: maintain current height Alt-v Auto-hover vertical: off Alt-. Auto-hover horizontal: Set target forwards/sideways speeds to zero Alt-up Auto-hover horizontal: Increment target forwards speed Alt-down Auto-hover horizontal: Decrement target forwards speed Alt-right Auto-hover horizontal: Increment target rightwards speed Alt-left Auto-hover horizontal: Decrement target rightwards speed Alt-a Auto-hover horizontal: control air speed Alt-g Auto-hover horizontal: control ground speed (default) Alt-h Auto-hover horizontal: off Alt-4 Auto-hover rotation: increment target rotation speed to left Alt-5 Auto-hover rotation: set target heading to current heading Alt-6 Auto-hover rotation: increment target rotation speed to right Alt-r Auto-hover rotation: off === Auto-hover vertical === Uses throttle to control vertical height/speed. === Auto-hover horizontal === Uses pitch and roll to control forwards/sideways speed. === Auto-hover rotation === Uses rudder to control rotation speed or heading.
Auto-hover currently uses crude on-screen text to show what it is doing.
The system is pretty unsophisticated and forwards/sideways in particular will go wrong if the aircraft is not stable. So it's best to have nozzles at standard hover setting (Alt-m) and manually get the aircraft stable and slow in the horizontal plain before engaging forwards/sideways auto-hover.
Here's a brief description of the changes:
Harrier-GR3-keyboard.xml: New, included by Harrier-GR3-set.xml. Contains keyboard short-cuts previously in Harrier-GR3-set.xml, and new auto-hover keyboard short-cuts. Harrier-GR3-mice.xml: New, empty, but included by Harrier-GR3-set.xml. [Auto-hover was originally controlled by mouse, which required this separately included file, but i subsequently switched to keyboard control instead.] Harrier-GR3-set.xml: Include Harrier-GR3-keyboard.xml and Harrier-GR3-mice.xml instead of inline. Added help for auto-hover. Added namespace for Nasal/Controls.nas. Nasal/Controls.nas: Added implementation of auto-hover. Implementation uses nasal callbacks which modify throttle, elevator and ailerones in order to track target x, y, z and heading speeds. Systems/Autopilot.xml: Some experimental code to implement auto-hover using fg's standard pid support; doesn't work very well so far.