Browse Source

Attention: flipped the yaw direction of multirotors in order to be compatible to APM

sbg
Julian Oes 12 years ago
parent
commit
e4bfd78847
  1. 75
      apps/systemlib/mixer/mixer_multirotor.cpp
  2. 4
      apps/systemlib/mixer/multi_tables

75
apps/systemlib/mixer/mixer_multirotor.cpp

@ -54,9 +54,6 @@ @@ -54,9 +54,6 @@
#include "mixer.h"
#define CW (-1.0f)
#define CCW (1.0f)
namespace
{
@ -64,52 +61,52 @@ namespace @@ -64,52 +61,52 @@ namespace
* These tables automatically generated by multi_tables - do not edit.
*/
const MultirotorMixer::Rotor _config_quad_x[] = {
{ -0.707107, 0.707107, -1.00 },
{ 0.707107, -0.707107, -1.00 },
{ 0.707107, 0.707107, 1.00 },
{ -0.707107, -0.707107, 1.00 },
{ -0.707107, 0.707107, 1.00 },
{ 0.707107, -0.707107, 1.00 },
{ 0.707107, 0.707107, -1.00 },
{ -0.707107, -0.707107, -1.00 },
};
const MultirotorMixer::Rotor _config_quad_plus[] = {
{ -1.000000, 0.000000, -1.00 },
{ 1.000000, 0.000000, -1.00 },
{ 0.000000, 1.000000, 1.00 },
{ -0.000000, -1.000000, 1.00 },
{ -1.000000, 0.000000, 1.00 },
{ 1.000000, 0.000000, 1.00 },
{ 0.000000, 1.000000, -1.00 },
{ -0.000000, -1.000000, -1.00 },
};
const MultirotorMixer::Rotor _config_hex_x[] = {
{ -1.000000, 0.000000, 1.00 },
{ 1.000000, 0.000000, -1.00 },
{ 0.500000, 0.866025, 1.00 },
{ -0.500000, -0.866025, -1.00 },
{ -0.500000, 0.866025, -1.00 },
{ 0.500000, -0.866025, 1.00 },
{ -1.000000, 0.000000, -1.00 },
{ 1.000000, 0.000000, 1.00 },
{ 0.500000, 0.866025, -1.00 },
{ -0.500000, -0.866025, 1.00 },
{ -0.500000, 0.866025, 1.00 },
{ 0.500000, -0.866025, -1.00 },
};
const MultirotorMixer::Rotor _config_hex_plus[] = {
{ 0.000000, 1.000000, 1.00 },
{ -0.000000, -1.000000, -1.00 },
{ 0.866025, -0.500000, 1.00 },
{ -0.866025, 0.500000, -1.00 },
{ 0.866025, 0.500000, -1.00 },
{ -0.866025, -0.500000, 1.00 },
{ 0.000000, 1.000000, -1.00 },
{ -0.000000, -1.000000, 1.00 },
{ 0.866025, -0.500000, -1.00 },
{ -0.866025, 0.500000, 1.00 },
{ 0.866025, 0.500000, 1.00 },
{ -0.866025, -0.500000, -1.00 },
};
const MultirotorMixer::Rotor _config_octa_x[] = {
{ -0.382683, 0.923880, 1.00 },
{ 0.382683, -0.923880, 1.00 },
{ -0.923880, 0.382683, -1.00 },
{ -0.382683, -0.923880, -1.00 },
{ 0.382683, 0.923880, -1.00 },
{ 0.923880, -0.382683, -1.00 },
{ 0.923880, 0.382683, 1.00 },
{ -0.923880, -0.382683, 1.00 },
{ -0.382683, 0.923880, -1.00 },
{ 0.382683, -0.923880, -1.00 },
{ -0.923880, 0.382683, 1.00 },
{ -0.382683, -0.923880, 1.00 },
{ 0.382683, 0.923880, 1.00 },
{ 0.923880, -0.382683, 1.00 },
{ 0.923880, 0.382683, -1.00 },
{ -0.923880, -0.382683, -1.00 },
};
const MultirotorMixer::Rotor _config_octa_plus[] = {
{ 0.000000, 1.000000, 1.00 },
{ -0.000000, -1.000000, 1.00 },
{ -0.707107, 0.707107, -1.00 },
{ -0.707107, -0.707107, -1.00 },
{ 0.707107, 0.707107, -1.00 },
{ 0.707107, -0.707107, -1.00 },
{ 1.000000, 0.000000, 1.00 },
{ -1.000000, 0.000000, 1.00 },
{ 0.000000, 1.000000, -1.00 },
{ -0.000000, -1.000000, -1.00 },
{ -0.707107, 0.707107, 1.00 },
{ -0.707107, -0.707107, 1.00 },
{ 0.707107, 0.707107, 1.00 },
{ 0.707107, -0.707107, 1.00 },
{ 1.000000, 0.000000, -1.00 },
{ -1.000000, 0.000000, -1.00 },
};
const MultirotorMixer::Rotor *_config_index[MultirotorMixer::Geometry::MAX_GEOMETRY] = {
&_config_quad_x[0],

4
apps/systemlib/mixer/multi_tables

@ -70,9 +70,9 @@ foreach table $tables { @@ -70,9 +70,9 @@ foreach table $tables {
upvar #0 $table angles
foreach {angle dir} $angles {
if {$dir == "CW"} {
set dd -1.0
} else {
set dd 1.0
} else {
set dd -1.0
}
factors $angle $dd
}

Loading…
Cancel
Save