In working towards my goal of building a stand-alone MW RTH/nav setup w/ CPPM output (for sending to another FC), I'm considering adding a new config option in my setup called 'NAV_HOME_HEIGHT'... The goal of this config option would be to send the craft to a predetermined height when initiating 'GPS HOME' mode.
Here's more/less what I had in mind...
Code: Select all
//config.h
#define NAV_HOME_HEIGHT 1500//height in cm for GPS HOME / RTH
Code: Select all
//multiwii.cpp @ line ~1036
#if GPS
if (f.GPS_FIX && GPS_numSat >= 5 ) {
if (rcOptions[BOXGPSHOME]) { // if both GPS_HOME & GPS_HOLD are checked => GPS_HOME is the priority
if (!f.GPS_HOME_MODE) {
f.GPS_HOME_MODE = 1;
f.GPS_HOLD_MODE = 0;
GPSNavReset = 0;
#if defined (NAV_HOME_HEIGHT)
f.BARO_MODE = 1;
AltHold = NAV_HOME_HEIGHT;
#endif
...
}
Another feature that I have in mind to go along with this is to prevent GPS navigation until first climbing/descending to the NAV_HOME_HEIGHT (perhaps only for multi-rotors). I was thinking about perhaps a 'GPSNavClimb' flag that prohibits the GPS nav PID factors to be summed into the final PID values until the baro height is within some threshold percentage of the NAV_HOME_HEIGHT value. After that, the flag would be unset and the GPS nav PIDs would be factored in... thoughts on this?
Anyway, I just wanted to throw it out there & perhaps get some feedback on this
(pros/cons, possible improvements, suggestions, advice, etc.)
thanks...