mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
math Functions constrain X_in of exponentialFromLimits function
This commit is contained in:
committed by
Daniel Agar
parent
c97b2a3071
commit
6110ddc8b1
@@ -173,9 +173,11 @@ const T gradual(const T &value, const T &x_low, const T &x_high, const T &y_low,
|
|||||||
* @param Y_max maximum output at X = 0
|
* @param Y_max maximum output at X = 0
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const T expontialFromLimits(const T &X, const T &Y_min, const T &Y_mid, const T &Y_max)
|
const T expontialFromLimits(const T &X_in, const T &Y_min, const T &Y_mid, const T &Y_max)
|
||||||
{
|
{
|
||||||
T SIGMA_NORM = (T)0.001;
|
T SIGMA_NORM = (T)0.001;
|
||||||
|
// constrain X_in to the range of 0 and 2
|
||||||
|
T X = math::constrain(X_in, (T)0, (T)2);
|
||||||
// If Y_mid is exactly in the middle, then just apply linear approach.
|
// If Y_mid is exactly in the middle, then just apply linear approach.
|
||||||
bool use_linear_approach = false;
|
bool use_linear_approach = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user