UAVCAN driver: support throttle linearization (THR_MLD_FAC parameter)

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
Roman Bapst
2019-07-09 15:10:54 -04:00
committed by Daniel Agar
parent 2aa05e3914
commit b54a43fccc
4 changed files with 15 additions and 6 deletions
+5 -1
View File
@@ -128,6 +128,7 @@
#pragma once
#include <stdint.h>
#include <lib/mathlib/mathlib.h>
/** simple channel scaler */
struct mixer_scaler_s {
@@ -707,7 +708,10 @@ public:
*
* @param[in] val The value
*/
void set_thrust_factor(float val) override { _thrust_factor = val; }
void set_thrust_factor(float val) override
{
_thrust_factor = math::constrain(val, 0.0f, 1.0f);
}
void set_airmode(Airmode airmode) override;