47 #define debug(fmt, args...) do { } while(0) 58 index +=
mixer->
mix(outputs + index, space - index);
84 debug(
"set trim: %d, offset: %5.3f", values[index], (
double)offset);
104 unsigned index_mixer = 0;
113 while (index < index_mixer) {
114 values[index] = trim * 10000;
144 if (rotor_count > 0) {
176 const char *end = buf + buflen;
184 const char *p = end - buflen;
185 unsigned resid = buflen;
224 debug(
"SUCCESS - buflen: %d", buflen);
int load_from_buf(Mixer::ControlCallback control_cb, uintptr_t cb_handle, const char *buf, unsigned &buflen)
Adds mixers to the group based on a text description in a buffer.
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
static SimpleMixer * from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handle, const char *buf, unsigned &buflen)
Factory method with full external configuration.
void set_thrust_factor(float val) override
Sets the thrust factor used to calculate mapping from desired thrust to motor control signal output...
uint16_t get_saturation_status()
unsigned get_multirotor_count()
void add_mixer(Mixer *mixer)
Add a mixer to the group.
static MultirotorMixer * from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handle, const char *buf, unsigned &buflen)
Factory method.
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.
unsigned set_trims(int16_t *v, unsigned n)
void set_max_delta_out_once(float delta_out_max) override
Update slew rate parameter.
static MultirotorMixer * mixer
mixer initialization
void set_airmode(Airmode airmode) override
Set airmode.
void set_max_delta_out_once(float delta_out_max)
Update slew rate parameter.
static HelicopterMixer * from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handle, const char *buf, unsigned &buflen)
Factory method.
void set_thrust_factor(float val)
Sets the thrust factor used to calculate mapping from desired thrust to motor control signal output...
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
unsigned get_multirotor_count() override
#define debug(fmt, args...)
void groups_required(uint32_t &groups)
unsigned mix(float *outputs, unsigned space) override
Perform the mixing function.
void set_airmode(Mixer::Airmode airmode)
void groups_required(uint32_t &groups) override
Analyses the mix configuration and updates a bitmask of groups that are required. ...
static NullMixer * from_text(const char *buf, unsigned &buflen)
Factory method.
unsigned mix(float *outputs, unsigned space)
unsigned get_trim(float *trim) override
Get trim offset for this mixer.
unsigned set_trim(float trim) override
Set trim offset for this mixer.
Abstract class defining a mixer mixing zero or more inputs to one or more outputs.
unsigned get_trims(int16_t *values)
List< Mixer * > _mixers
linked list of mixers