31 #define THROTTLE_CURVE_SWITCH_VAL (MAX_PPRZ*2/THROTTLE_CURVES_NB)
36 .curves = THROTTLE_CURVES
44 throttle_curve.
mode = THROTTLE_CURVE_MODE_INIT;
57 Bound(mode, 0, THROTTLE_CURVES_NB - 1);
68 int8_t curve_p = ((float)in_cmd[COMMAND_THRUST] / curve_range);
72 uint16_t x = in_cmd[COMMAND_THRUST] - curve_p * curve_range;
74 + ((curve.
throttle[curve_p + 1] - curve.
throttle[curve_p]) * x / curve_range);
struct curve_t curves[THROTTLE_CURVES_NB]
Throttle/pitch curves.
void nav_throttle_curve_set(uint8_t mode)
Set a specific throttle curve based on the mode given with this function.
#define THROTTLE_CURVE_SWITCH_VAL
uint8_t nb_points
The number of points in the curve.
struct throttle_curve_t throttle_curve
uint16_t throttle
Output thrust(throttle) of the throttle curve.
void throttle_curve_run(bool motors_on, pprz_t in_cmd[])
Run the throttle curve and generate the output throttle and pitch This depends on the FMODE(flight mo...
Hardware independent code for commands handling.
int16_t collective[THROTTLE_POINTS_NB]
The collective points in the curve.
pprz_t commands[COMMANDS_NB]
Storage of intermediate command values.
void throttle_curve_init(void)
Initialize the default throttle curve values.
uint8_t nb_curves
The number of throttle/pitch curves.
uint16_t throttle[THROTTLE_POINTS_NB]
Throttle points in the curve.
int16_t collective
Output collective of the throttle curve.