130 #include <mathlib/mathlib.h> 162 virtual ~Mixer() =
default;
177 virtual unsigned mix(
float *outputs,
unsigned space) = 0;
207 virtual unsigned set_trim(
float trim) {
return 0; }
214 virtual unsigned get_trim(
float *trim) {
return 0; }
254 static const char *
findtag(
const char *buf,
unsigned &buflen,
char tag);
262 static char findnexttag(
const char *buf,
unsigned buflen);
271 static const char *
skipline(
const char *buf,
unsigned &buflen);
static char findnexttag(const char *buf, unsigned buflen)
Find next tag and return it (0 is returned if no tag is found)
virtual unsigned get_multirotor_count()
static const char * skipline(const char *buf, unsigned &buflen)
Skip a line.
ControlCallback _control_cb
client-supplied callback used when fetching control values
An intrusive linked list.
virtual void set_max_delta_out_once(float delta_out_max)
Empty method, only implemented for MultirotorMixer and MixerGroup class.
Mixer(ControlCallback control_cb, uintptr_t cb_handle)
Constructor.
int(* ControlCallback)(uintptr_t handle, uint8_t control_group, uint8_t control_index, float &control)
Fetch a control value.
virtual uint16_t get_saturation_status()
Get the saturation status.
static bool string_well_formed(const char *buf, unsigned &buflen)
Check wether the string is well formed and suitable for parsing.
virtual void set_airmode(Airmode airmode)
Set airmode.
Mixer & operator=(const Mixer &)=delete
virtual unsigned mix(float *outputs, unsigned space)=0
Perform the mixing function.
float get_control(uint8_t group, uint8_t index)
Invoke the client callback to fetch a control value.
static const char * findtag(const char *buf, unsigned &buflen, char tag)
Find a tag.
virtual unsigned get_trim(float *trim)
Get trim offset for this mixer.
virtual void groups_required(uint32_t &groups)
Analyses the mix configuration and updates a bitmask of groups that are required. ...
virtual void set_thrust_factor(float val)
Abstract class defining a mixer mixing zero or more inputs to one or more outputs.
virtual unsigned set_trim(float trim)
Set trim offset for this mixer.