Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
rosflight_firmware::Mixer Class Reference

#include <mixer.h>

Inheritance diagram for rosflight_firmware::Mixer:
Inheritance graph
[legend]

Classes

struct  aux_channel_t
 
struct  aux_command_t
 
struct  mixer_t
 

Public Types

enum  {
  ESC_CALIBRATION = 0, QUADCOPTER_PLUS = 1, QUADCOPTER_X = 2, HEX_PLUS = 3,
  HEX_X = 4, OCTO_PLUS = 5, OCTO_X = 6, Y6 = 7,
  X8 = 8, TRICOPTER = 9, FIXEDWING = 10, PASSTHROUGH = 11,
  NUM_MIXERS, INVALID_MIXER = 255
}
 
enum  output_type_t { NONE, S, M, G }
 

Public Member Functions

const float * get_outputs () const
 
void init ()
 
void init_mixing ()
 
void init_PWM ()
 
void mix_output ()
 
 Mixer (ROSflight &_rf)
 
void param_change_callback (uint16_t param_id) override
 
void set_new_aux_command (aux_command_t new_aux_command)
 

Static Public Attributes

static constexpr uint8_t NUM_MIXER_OUTPUTS = 8
 
static constexpr uint8_t NUM_TOTAL_OUTPUTS = 14
 

Private Member Functions

void write_motor (uint8_t index, float value)
 
void write_servo (uint8_t index, float value)
 

Private Attributes

const mixer_tarray_of_mixers_ [NUM_MIXERS]
 
aux_command_t aux_command_
 
output_type_t combined_output_type_ [NUM_TOTAL_OUTPUTS]
 
const mixer_t esc_calibration_mixing
 
const mixer_t fixedwing_mixing
 
const mixer_t hex_plus_mixing
 
const mixer_t hex_x_mixing
 
const mixer_tmixer_to_use_
 
const mixer_t octocopter_plus_mixing
 
const mixer_t octocopter_x_mixing
 
float outputs_ [NUM_TOTAL_OUTPUTS]
 
const mixer_t passthrough_mixing
 
const mixer_t quadcopter_plus_mixing
 
const mixer_t quadcopter_x_mixing
 
float raw_outputs_ [NUM_TOTAL_OUTPUTS]
 
ROSflightRF_
 
const mixer_t tricopter_mixing
 
const mixer_t X8_mixing
 
const mixer_t Y6_mixing
 

Detailed Description

Definition at line 46 of file mixer.h.

Member Enumeration Documentation

anonymous enum
Enumerator
ESC_CALIBRATION 
QUADCOPTER_PLUS 
QUADCOPTER_X 
HEX_PLUS 
HEX_X 
OCTO_PLUS 
OCTO_X 
Y6 
X8 
TRICOPTER 
FIXEDWING 
PASSTHROUGH 
NUM_MIXERS 
INVALID_MIXER 

Definition at line 54 of file mixer.h.

Enumerator
NONE 

Definition at line 72 of file mixer.h.

Constructor & Destructor Documentation

rosflight_firmware::Mixer::Mixer ( ROSflight _rf)

Definition at line 41 of file mixer.cpp.

Member Function Documentation

const float* rosflight_firmware::Mixer::get_outputs ( ) const
inline

Definition at line 269 of file mixer.h.

void rosflight_firmware::Mixer::init ( )

Definition at line 47 of file mixer.cpp.

void rosflight_firmware::Mixer::init_mixing ( )

Definition at line 70 of file mixer.cpp.

void rosflight_firmware::Mixer::init_PWM ( )

Definition at line 100 of file mixer.cpp.

void rosflight_firmware::Mixer::mix_output ( )

Definition at line 166 of file mixer.cpp.

void rosflight_firmware::Mixer::param_change_callback ( uint16_t  param_id)
overridevirtual

Implements rosflight_firmware::ParamListenerInterface.

Definition at line 52 of file mixer.cpp.

void rosflight_firmware::Mixer::set_new_aux_command ( aux_command_t  new_aux_command)

Definition at line 157 of file mixer.cpp.

void rosflight_firmware::Mixer::write_motor ( uint8_t  index,
float  value 
)
private

Definition at line 116 of file mixer.cpp.

void rosflight_firmware::Mixer::write_servo ( uint8_t  index,
float  value 
)
private

Definition at line 143 of file mixer.cpp.

Member Data Documentation

const mixer_t* rosflight_firmware::Mixer::array_of_mixers_[NUM_MIXERS]
private
aux_command_t rosflight_firmware::Mixer::aux_command_
private

Definition at line 106 of file mixer.h.

output_type_t rosflight_firmware::Mixer::combined_output_type_[NUM_TOTAL_OUTPUTS]
private

Definition at line 107 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::esc_calibration_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, NONE, NONE},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
490
}

Definition at line 112 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::fixedwing_mixing
private
Initial value:
=
{
{S, S, M, S, S, M, NONE, NONE},
{ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
50
}

Definition at line 221 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::hex_plus_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, M, M},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f},
{ 0.0f, -0.866025f, -0.866025f, 0.0f, 0.866025f, 0.866025f, 0.0f, 0.0f},
{ 1.0f, 0.5f, -0.5f, -1.0f, -0.5f, 0.5f, 0.0f, 0.0f},
{ 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 0.0f, 0.0f},
490
}

Definition at line 144 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::hex_x_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, M, M},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f},
{ -0.5f, -1.0f, -0.5f, 0.5f, 1.0f, 0.5f, 0.0f, 0.0f},
{ 0.866025f, 0.0f, -0.866025f, -0.866025f, 0.0f, 0.866025f, 0.0f, 0.0f},
{ 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 0.0f, 0.0f},
490
}

Definition at line 155 of file mixer.h.

const mixer_t* rosflight_firmware::Mixer::mixer_to_use_
private

Definition at line 243 of file mixer.h.

constexpr uint8_t rosflight_firmware::Mixer::NUM_MIXER_OUTPUTS = 8
static

Definition at line 52 of file mixer.h.

constexpr uint8_t rosflight_firmware::Mixer::NUM_TOTAL_OUTPUTS = 14
static

Definition at line 51 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::octocopter_plus_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, M, M},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f},
{ 0.0f, -0.707f, -1.0f, -0.707f, 0.0f, 0.707f, 1.0f, 0.707f},
{ 1.0f, 0.707f, 0.0f, -0.707f, -1.0f, -0.707f, 0.0f, 0.707f},
{ 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f},
490
}

Definition at line 166 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::octocopter_x_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, M, M},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f},
{-0.414f, -1.0f, -1.0f, -0.414f, 0.414f, 1.0f, 1.0f, 0.414},
{ 1.0f, 0.414f, -0.414f, -1.0f, -1.0f, -0.414f, 0.414f, 1.0},
{ 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f},
490
}

Definition at line 177 of file mixer.h.

float rosflight_firmware::Mixer::outputs_[NUM_TOTAL_OUTPUTS]
private

Definition at line 105 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::passthrough_mixing
private
Initial value:
=
{
{NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
50
}

Definition at line 232 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::quadcopter_plus_mixing
private
Initial value:
=
{
{M, M, M, M, NONE, NONE, NONE, NONE},
{ 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 1.0f, -1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
490
}

Definition at line 122 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::quadcopter_x_mixing
private
Initial value:
=
{
{M, M, M, M, NONE, NONE, NONE, NONE},
{ 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{-1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 1.0f, -1.0f,-1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 1.0f, -1.0f, 1.0f,-1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
490
}

Definition at line 133 of file mixer.h.

float rosflight_firmware::Mixer::raw_outputs_[NUM_TOTAL_OUTPUTS]
private

Definition at line 104 of file mixer.h.

ROSflight& rosflight_firmware::Mixer::RF_
private

Definition at line 102 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::tricopter_mixing
private
Initial value:
=
{
{M, M, M, S, NONE, NONE, NONE, NONE},
{ 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{-1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.667f, 0.0f, 0.667f, -1.333f, 0.0f, 0.0f, 0.0f, 0.0f},
{ 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f},
490
}

Definition at line 210 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::X8_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, M, M},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f},
{-1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f},
{ 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f},
{ 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f},
490
}

Definition at line 199 of file mixer.h.

const mixer_t rosflight_firmware::Mixer::Y6_mixing
private
Initial value:
=
{
{M, M, M, M, M, M, NONE, NONE},
{ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f},
{-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f},
{ 0.667f, 0.667f, -1.333f, -1.333f, 0.667f, 0.667f, 0.0f, 0.0f},
{ 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 0.0f, 0.0f},
490
}

Definition at line 188 of file mixer.h.


The documentation for this class was generated from the following files:


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:24