Copter: added CH7 switch to enabling/disable the sonar in flight

This indirectly switches surface tracking on/off which is useful to
avoid tracking the tops of uneven objects when far above the ground
This commit is contained in:
Randy Mackay 2013-01-14 13:58:53 +09:00 committed by rmackay9
parent df2137ed72
commit 8bbc93bb04
3 changed files with 8 additions and 1 deletions

View File

@ -164,6 +164,11 @@ static void read_trim_switch()
}
break;
#endif
case CH7_SONAR:
// enable or disable the sonar
g.sonar_enabled = ap_system.CH7_flag;
break;
}
}

View File

@ -66,6 +66,7 @@
#define CH7_SAVE_WP 7
#define CH7_MULTI_MODE 8
#define CH7_CAMERA_TRIGGER 9
#define CH7_SONAR 10 // allow enabling or disabling sonar in flight which helps avoid surface tracking when you are far above the ground

View File

@ -159,7 +159,8 @@ apm_option("CH7_OPTION" TYPE STRING
"CH7_DO_NOTHING"
"CH7_SAVE_WP"
"CH7_DO_NOTHING"
"CH7_CAMERA_TRIGGER")
"CH7_CAMERA_TRIGGER"
"CH7_SONAR")
apm_option("ACCEL_ALT_HOLD" TYPE BOOL ADVANCED
DESCRIPTION "Disabled by default, work in progress."