82 MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle, MultirotorGeometry geometry,
83 float roll_scale,
float pitch_scale,
float yaw_scale,
float idle_speed);
93 MultirotorMixer(ControlCallback control_cb, uintptr_t cb_handle,
const Rotor *rotors,
unsigned rotor_count);
121 unsigned mix(
float *outputs,
unsigned space)
override;
139 unsigned set_trim(
float trim)
override {
return _rotor_count; }
140 unsigned get_trim(
float *trim)
override {
return _rotor_count; }
178 float compute_desaturation_gain(
const float *desaturation_vector,
const float *outputs,
saturation_status &sat_status,
179 float min_output,
float max_output)
const;
199 void minimize_saturation(
const float *desaturation_vector,
float *outputs,
saturation_status &sat_status,
200 float min_output = 0.
f,
float max_output = 1.
f,
bool reduce_only =
false)
const;
209 inline void mix_airmode_rp(
float roll,
float pitch,
float yaw,
float thrust,
float *outputs);
218 inline void mix_airmode_rpy(
float roll,
float pitch,
float yaw,
float thrust,
float *outputs);
228 inline void mix_airmode_disabled(
float roll,
float pitch,
float yaw,
float thrust,
float *outputs);
240 inline void mix_yaw(
float yaw,
float *outputs);
242 void update_saturation_status(
unsigned index,
bool clipping_high,
bool clipping_low_roll_pitch,
bool clipping_low_yaw);
244 float _roll_scale{1.0f};
245 float _pitch_scale{1.0f};
246 float _yaw_scale{1.0f};
247 float _idle_speed{0.0f};
248 float _delta_out_max{0.0f};
249 float _thrust_factor{0.0f};
258 float *_outputs_prev{
nullptr};
259 float *_tmp_array{
nullptr};
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
float thrust_scale
scales thrust for this rotor
void set_thrust_factor(float val) override
Sets the thrust factor used to calculate mapping from desired thrust to motor control signal output...
Generic, programmable, procedural control signal mixers.
uint8_t MultirotorGeometryUnderlyingType
Supported multirotor geometries.
uint16_t get_saturation_status() override
Get the saturation status.
int(* ControlCallback)(uintptr_t handle, uint8_t control_group, uint8_t control_index, float &control)
Fetch a control value.
void set_max_delta_out_once(float delta_out_max) override
Update slew rate parameter.
void set_airmode(Airmode airmode) override
Set airmode.
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
unsigned get_multirotor_count() override
float pitch_scale
scales pitch for this rotor
float roll_scale
scales roll for this rotor
void groups_required(uint32_t &groups) override
Analyses the mix configuration and updates a bitmask of groups that are required. ...
unsigned get_trim(float *trim) override
Get trim offset for this mixer.
Multi-rotor mixer for pre-defined vehicle geometries.
unsigned set_trim(float trim) override
Set trim offset for this mixer.
float yaw_scale
scales yaw for this rotor
Abstract class defining a mixer mixing zero or more inputs to one or more outputs.