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
parent bd05ea84cc
commit e362844532
3 changed files with 8 additions and 1 deletions

View File

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

View File

@ -64,6 +64,7 @@
#define CH7_SAVE_WP 7 #define CH7_SAVE_WP 7
#define CH7_MULTI_MODE 8 #define CH7_MULTI_MODE 8
#define CH7_CAMERA_TRIGGER 9 #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_DO_NOTHING"
"CH7_SAVE_WP" "CH7_SAVE_WP"
"CH7_DO_NOTHING" "CH7_DO_NOTHING"
"CH7_CAMERA_TRIGGER") "CH7_CAMERA_TRIGGER"
"CH7_SONAR")
apm_option("ACCEL_ALT_HOLD" TYPE BOOL ADVANCED apm_option("ACCEL_ALT_HOLD" TYPE BOOL ADVANCED
DESCRIPTION "Disabled by default, work in progress." DESCRIPTION "Disabled by default, work in progress."