AC_Avoidance: add enabled and margin accessors

This commit is contained in:
Randy Mackay 2019-09-20 11:07:26 +09:00
parent 1c4f47f882
commit 0d032ecd86
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,9 @@ public:
return _singleton;
}
// return true if any avoidance feature is enabled
bool enabled() const { return _enabled != AC_AVOID_DISABLED; }
/*
* Adjusts the desired velocity so that the vehicle can stop
* before the fence/object.
@ -76,6 +79,9 @@ public:
// kP should be non-zero for Copter which has a non-linear response
float get_max_speed(float kP, float accel_cmss, float distance_cm, float dt) const;
// return margin (in meters) that the vehicle should stay from objects
float get_margin() const { return _margin; }
static const struct AP_Param::GroupInfo var_info[];
private: