Merge pull request #981 from jhiesey/master

Add mixer config for hexa coax frame
This commit is contained in:
Lorenz Meier 2014-05-20 08:37:36 -07:00
commit 7c001bb0cb
4 changed files with 26 additions and 5 deletions

View File

@ -1,7 +1,5 @@
#!nsh
#
# UNTESTED UNTESTED!
#
# Generic 10" Hexa coaxial geometry
#
# Lorenz Meier <lm@inf.ethz.ch>

View File

@ -447,6 +447,7 @@ public:
QUAD_WIDE, /**< quad in wide configuration */
HEX_X, /**< hex in X configuration */
HEX_PLUS, /**< hex in + configuration */
HEX_COX,
OCTA_X,
OCTA_PLUS,
OCTA_COX,

View File

@ -115,6 +115,14 @@ const MultirotorMixer::Rotor _config_hex_plus[] = {
{ 0.866025, 0.500000, 1.00 },
{ -0.866025, -0.500000, -1.00 },
};
const MultirotorMixer::Rotor _config_hex_cox[] = {
{ -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 },
};
const MultirotorMixer::Rotor _config_octa_x[] = {
{ -0.382683, 0.923880, -1.00 },
{ 0.382683, -0.923880, -1.00 },
@ -152,6 +160,7 @@ const MultirotorMixer::Rotor *_config_index[MultirotorMixer::MAX_GEOMETRY] = {
&_config_quad_wide[0],
&_config_hex_x[0],
&_config_hex_plus[0],
&_config_hex_cox[0],
&_config_octa_x[0],
&_config_octa_plus[0],
&_config_octa_cox[0],
@ -163,6 +172,7 @@ const unsigned _config_rotor_count[MultirotorMixer::MAX_GEOMETRY] = {
4, /* quad_wide */
6, /* hex_x */
6, /* hex_plus */
6, /* hex_cox */
8, /* octa_x */
8, /* octa_plus */
8, /* octa_cox */
@ -252,6 +262,9 @@ MultirotorMixer::from_text(Mixer::ControlCallback control_cb, uintptr_t cb_handl
} else if (!strcmp(geomname, "6x")) {
geometry = MultirotorMixer::HEX_X;
} else if (!strcmp(geomname, "6c")) {
geometry = MultirotorMixer::HEX_COX;
} else if (!strcmp(geomname, "8+")) {
geometry = MultirotorMixer::OCTA_PLUS;

View File

@ -52,6 +52,15 @@ set hex_plus {
120 CW
}
set hex_cox {
60 CW
60 CCW
180 CW
180 CCW
-60 CW
-60 CCW
}
set octa_x {
22.5 CW
-157.5 CW
@ -85,7 +94,7 @@ set octa_cox {
-135 CW
}
set tables {quad_x quad_plus quad_v quad_wide hex_x hex_plus octa_x octa_plus octa_cox}
set tables {quad_x quad_plus quad_v quad_wide hex_x hex_plus hex_cox octa_x octa_plus octa_cox}
proc factors {a d} { puts [format "\t{ %9.6f, %9.6f, %5.2f }," [rcos [expr $a + 90]] [rcos $a] [expr -$d]]}
@ -104,13 +113,13 @@ foreach table $tables {
puts "};"
}
puts "const MultirotorMixer::Rotor *_config_index\[MultirotorMixer::Geometry::MAX_GEOMETRY\] = {"
puts "const MultirotorMixer::Rotor *_config_index\[MultirotorMixer::MAX_GEOMETRY\] = {"
foreach table $tables {
puts [format "\t&_config_%s\[0\]," $table]
}
puts "};"
puts "const unsigned _config_rotor_count\[MultirotorMixer::Geometry::MAX_GEOMETRY\] = {"
puts "const unsigned _config_rotor_count\[MultirotorMixer::MAX_GEOMETRY\] = {"
foreach table $tables {
upvar #0 $table angles
puts [format "\t%u, /* %s */" [expr [llength $angles] / 2] $table]