@ -82,6 +82,7 @@ public:
@@ -82,6 +82,7 @@ public:
// enable/disable proximity based avoidance
void proximity_avoidance_enable ( bool on_off ) { _proximity_enabled = on_off ; }
bool proximity_avoidance_enabled ( ) const { return _proximity_enabled ; }
void proximity_alt_avoidance_enable ( bool on_off ) { _proximity_alt_enabled = on_off ; }
// helper functions
@ -103,6 +104,8 @@ public:
@@ -103,6 +104,8 @@ public:
// return margin (in meters) that the vehicle should stay from objects
float get_margin ( ) const { return _margin ; }
// return minimum alt (in meters) above which avoidance will be active
float get_min_alt ( ) const { return _alt_min ; }
// return true if limiting is active
bool limits_active ( ) const { return ( AP_HAL : : millis ( ) - _last_limit_time ) < AC_AVOID_ACTIVE_LIMIT_TIMEOUT_MS ; } ;
@ -200,8 +203,10 @@ private:
@@ -200,8 +203,10 @@ private:
AP_Float _margin ; // vehicle will attempt to stay this distance (in meters) from objects while in GPS modes
AP_Int8 _behavior ; // avoidance behaviour (slide or stop)
AP_Float _backup_speed_max ; // Maximum speed that will be used to back away (in m/s)
AP_Float _alt_min ; // alt below which Proximity based avoidance is turned off
bool _proximity_enabled = true ; // true if proximity sensor based avoidance is enabled (used to allow pilot to enable/disable)
bool _proximity_alt_enabled = true ; // true if proximity sensor based avoidance is enabled based on altitude
uint32_t _last_limit_time ; // the last time a limit was active
uint32_t _last_log_ms ; // the last time simple avoidance was logged