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

#include <mixer.h>

Classes

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, 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)
 

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]
 
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
 
const mixer_t quadcopter_plus_mixing
 
const mixer_t quadcopter_x_mixing
 
float raw_outputs_ [8]
 
ROSflightRF_
 
const mixer_t tricopter_mixing
 
float unsaturated_outputs_ [8]
 
const mixer_t X8_mixing
 
const mixer_t Y6_mixing
 

Detailed Description

Definition at line 44 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 
NUM_MIXERS 
INVALID_MIXER 

Definition at line 49 of file mixer.h.

Enumerator
NONE 

Definition at line 66 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 237 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 78 of file mixer.cpp.

void rosflight_firmware::Mixer::init_PWM ( )

Definition at line 108 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)

Definition at line 64 of file mixer.cpp.

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

Definition at line 124 of file mixer.cpp.

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

Definition at line 151 of file mixer.cpp.

Member Data Documentation

const mixer_t* rosflight_firmware::Mixer::array_of_mixers_[NUM_MIXERS]
private
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 93 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 202 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 125 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 136 of file mixer.h.

const mixer_t* rosflight_firmware::Mixer::mixer_to_use_
private

Definition at line 213 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 147 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 158 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 103 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 114 of file mixer.h.

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

Definition at line 87 of file mixer.h.

ROSflight& rosflight_firmware::Mixer::RF_
private

Definition at line 85 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 191 of file mixer.h.

float rosflight_firmware::Mixer::unsaturated_outputs_[8]
private

Definition at line 88 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 180 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 169 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 Wed Jul 3 2019 19:59:31