Browse Source

Add mixer config for hexa coax frame

sbg
John Hiesey 11 years ago
parent
commit
56a8f3de0a
  1. 2
      ROMFS/px4fmu_common/init.d/11001_hexa_cox
  2. 1
      src/modules/systemlib/mixer/mixer.h
  3. 13
      src/modules/systemlib/mixer/mixer_multirotor.cpp
  4. 15
      src/modules/systemlib/mixer/multi_tables

2
ROMFS/px4fmu_common/init.d/11001_hexa_cox

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

1
src/modules/systemlib/mixer/mixer.h

@ -447,6 +447,7 @@ public: @@ -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,

13
src/modules/systemlib/mixer/mixer_multirotor.cpp

@ -115,6 +115,14 @@ const MultirotorMixer::Rotor _config_hex_plus[] = { @@ -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] = { @@ -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] = { @@ -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 @@ -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;

15
src/modules/systemlib/mixer/multi_tables

@ -52,6 +52,15 @@ set hex_plus { @@ -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 { @@ -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 { @@ -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]

Loading…
Cancel
Save