mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Automated updates of the C++ code generated by the multi_tables script, now it is placed into the mixer_multirotor.generated.h file which is generated by makefile
This commit is contained in:
parent
c3ed35f5cc
commit
59fa170e54
1
.gitignore
vendored
1
.gitignore
vendored
@ -40,3 +40,4 @@ tags
|
||||
*.orig
|
||||
Firmware.zip
|
||||
unittests/build
|
||||
*.generated.h
|
||||
|
||||
@ -73,118 +73,8 @@ float constrain(float val, float min, float max)
|
||||
return (val < min) ? min : ((val > max) ? max : val);
|
||||
}
|
||||
|
||||
/*
|
||||
* These tables automatically generated by multi_tables - do not edit.
|
||||
*/
|
||||
|
||||
const MultirotorMixer::Rotor _config_quad_x[] = {
|
||||
{ -0.707107, 0.707107, 1.000000 },
|
||||
{ 0.707107, -0.707107, 1.000000 },
|
||||
{ 0.707107, 0.707107, -1.000000 },
|
||||
{ -0.707107, -0.707107, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_quad_plus[] = {
|
||||
{ -1.000000, 0.000000, 1.000000 },
|
||||
{ 1.000000, 0.000000, 1.000000 },
|
||||
{ 0.000000, 1.000000, -1.000000 },
|
||||
{ -0.000000, -1.000000, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_quad_v[] = {
|
||||
{ -0.322266, 0.946649, 0.424200 },
|
||||
{ 0.322266, 0.946649, 1.000000 },
|
||||
{ 0.322266, 0.946649, -0.424200 },
|
||||
{ -0.322266, 0.946649, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_quad_wide[] = {
|
||||
{ -0.927184, 0.374607, 1.000000 },
|
||||
{ 0.777146, -0.629320, 1.000000 },
|
||||
{ 0.927184, 0.374607, -1.000000 },
|
||||
{ -0.777146, -0.629320, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_hex_x[] = {
|
||||
{ -1.000000, 0.000000, -1.000000 },
|
||||
{ 1.000000, 0.000000, 1.000000 },
|
||||
{ 0.500000, 0.866025, -1.000000 },
|
||||
{ -0.500000, -0.866025, 1.000000 },
|
||||
{ -0.500000, 0.866025, 1.000000 },
|
||||
{ 0.500000, -0.866025, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_hex_plus[] = {
|
||||
{ 0.000000, 1.000000, -1.000000 },
|
||||
{ -0.000000, -1.000000, 1.000000 },
|
||||
{ 0.866025, -0.500000, -1.000000 },
|
||||
{ -0.866025, 0.500000, 1.000000 },
|
||||
{ 0.866025, 0.500000, 1.000000 },
|
||||
{ -0.866025, -0.500000, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_hex_cox[] = {
|
||||
{ -0.866025, 0.500000, -1.000000 },
|
||||
{ -0.866025, 0.500000, 1.000000 },
|
||||
{ -0.000000, -1.000000, -1.000000 },
|
||||
{ -0.000000, -1.000000, 1.000000 },
|
||||
{ 0.866025, 0.500000, -1.000000 },
|
||||
{ 0.866025, 0.500000, 1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_octa_x[] = {
|
||||
{ -0.382683, 0.923880, -1.000000 },
|
||||
{ 0.382683, -0.923880, -1.000000 },
|
||||
{ -0.923880, 0.382683, 1.000000 },
|
||||
{ -0.382683, -0.923880, 1.000000 },
|
||||
{ 0.382683, 0.923880, 1.000000 },
|
||||
{ 0.923880, -0.382683, 1.000000 },
|
||||
{ 0.923880, 0.382683, -1.000000 },
|
||||
{ -0.923880, -0.382683, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_octa_plus[] = {
|
||||
{ 0.000000, 1.000000, -1.000000 },
|
||||
{ -0.000000, -1.000000, -1.000000 },
|
||||
{ -0.707107, 0.707107, 1.000000 },
|
||||
{ -0.707107, -0.707107, 1.000000 },
|
||||
{ 0.707107, 0.707107, 1.000000 },
|
||||
{ 0.707107, -0.707107, 1.000000 },
|
||||
{ 1.000000, 0.000000, -1.000000 },
|
||||
{ -1.000000, 0.000000, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_octa_cox[] = {
|
||||
{ -0.707107, 0.707107, 1.000000 },
|
||||
{ 0.707107, 0.707107, -1.000000 },
|
||||
{ 0.707107, -0.707107, 1.000000 },
|
||||
{ -0.707107, -0.707107, -1.000000 },
|
||||
{ 0.707107, 0.707107, 1.000000 },
|
||||
{ -0.707107, 0.707107, -1.000000 },
|
||||
{ -0.707107, -0.707107, 1.000000 },
|
||||
{ 0.707107, -0.707107, -1.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor _config_twin_engine[] = {
|
||||
{ -1.000000, 0.000000, 0.000000 },
|
||||
{ 1.000000, 0.000000, 0.000000 },
|
||||
};
|
||||
const MultirotorMixer::Rotor *_config_index[MultirotorMixer::MAX_GEOMETRY] = {
|
||||
&_config_quad_x[0],
|
||||
&_config_quad_plus[0],
|
||||
&_config_quad_v[0],
|
||||
&_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],
|
||||
&_config_twin_engine[0],
|
||||
};
|
||||
const unsigned _config_rotor_count[MultirotorMixer::MAX_GEOMETRY] = {
|
||||
4, /* quad_x */
|
||||
4, /* quad_plus */
|
||||
4, /* quad_v */
|
||||
4, /* quad_wide */
|
||||
6, /* hex_x */
|
||||
6, /* hex_plus */
|
||||
6, /* hex_cox */
|
||||
8, /* octa_x */
|
||||
8, /* octa_plus */
|
||||
8, /* octa_cox */
|
||||
2, /* twin_engine */
|
||||
};
|
||||
// This file is generated by the multi_tables script which is invoked during the build process
|
||||
#include "mixer_multirotor.generated.h"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -31,13 +31,18 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
|
||||
#
|
||||
# mixer library
|
||||
#
|
||||
LIBNAME = mixerlib
|
||||
|
||||
|
||||
SRCS = mixer.cpp \
|
||||
mixer_group.cpp \
|
||||
mixer_multirotor.cpp \
|
||||
mixer_simple.cpp \
|
||||
mixer_load.c
|
||||
|
||||
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
$(SELF_DIR)mixer_multirotor.generated.h : $(SELF_DIR)multi_tables
|
||||
$(SELF_DIR)multi_tables > $(SELF_DIR)mixer_multirotor.generated.h
|
||||
|
||||
@ -3,6 +3,12 @@
|
||||
# Generate multirotor mixer scale tables compatible with the ArduCopter layout
|
||||
#
|
||||
|
||||
|
||||
puts "/*"
|
||||
puts "* These tables automatically generated by multi_tables - do not edit."
|
||||
puts "*/"
|
||||
puts ""
|
||||
|
||||
proc rad {a} { expr ($a / 360.0) * 2 * acos(-1) }
|
||||
proc rcos {a} { expr cos([rad $a])}
|
||||
|
||||
@ -133,3 +139,6 @@ foreach table $tables {
|
||||
puts [format "\t%u, /* %s */" [expr [llength $angles] / 2] $table]
|
||||
}
|
||||
puts "};"
|
||||
|
||||
# Newline at the end of file
|
||||
puts ""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user