mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 14:33:34 +08:00
@@ -54,11 +54,10 @@
|
|||||||
|
|
||||||
#include "mixer.h"
|
#include "mixer.h"
|
||||||
|
|
||||||
#define debug(fmt, args...) do { } while(0)
|
/*
|
||||||
//#define debug(fmt, args...) do { printf("[mixer] " fmt "\n", ##args); } while(0)
|
* Clockwise: 1
|
||||||
|
* Counter-clockwise: -1
|
||||||
#define CW (-1.0f)
|
*/
|
||||||
#define CCW (1.0f)
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -67,52 +66,52 @@ namespace
|
|||||||
* These tables automatically generated by multi_tables - do not edit.
|
* These tables automatically generated by multi_tables - do not edit.
|
||||||
*/
|
*/
|
||||||
const MultirotorMixer::Rotor _config_quad_x[] = {
|
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[] = {
|
const MultirotorMixer::Rotor _config_quad_plus[] = {
|
||||||
{ -1.000000, 0.000000, -1.00 },
|
{ -1.000000, 0.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 },
|
||||||
{ -0.000000, -1.000000, 1.00 },
|
{ -0.000000, -1.000000, -1.00 },
|
||||||
};
|
};
|
||||||
const MultirotorMixer::Rotor _config_hex_x[] = {
|
const MultirotorMixer::Rotor _config_hex_x[] = {
|
||||||
{ -1.000000, 0.000000, 1.00 },
|
{ -1.000000, 0.000000, -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 },
|
||||||
{ -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[] = {
|
const MultirotorMixer::Rotor _config_hex_plus[] = {
|
||||||
{ 0.000000, 1.000000, 1.00 },
|
{ 0.000000, 1.000000, -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 },
|
||||||
{ 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[] = {
|
const MultirotorMixer::Rotor _config_octa_x[] = {
|
||||||
{ -0.382683, 0.923880, 1.00 },
|
{ -0.382683, 0.923880, -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.382683, -0.923880, -1.00 },
|
{ -0.382683, -0.923880, 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.923880, 0.382683, -1.00 },
|
||||||
{ -0.923880, -0.382683, 1.00 },
|
{ -0.923880, -0.382683, -1.00 },
|
||||||
};
|
};
|
||||||
const MultirotorMixer::Rotor _config_octa_plus[] = {
|
const MultirotorMixer::Rotor _config_octa_plus[] = {
|
||||||
{ 0.000000, 1.000000, 1.00 },
|
{ 0.000000, 1.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 },
|
||||||
{ 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 },
|
||||||
{ -1.000000, 0.000000, 1.00 },
|
{ -1.000000, 0.000000, -1.00 },
|
||||||
};
|
};
|
||||||
const MultirotorMixer::Rotor *_config_index[MultirotorMixer::Geometry::MAX_GEOMETRY] = {
|
const MultirotorMixer::Rotor *_config_index[MultirotorMixer::Geometry::MAX_GEOMETRY] = {
|
||||||
&_config_quad_x[0],
|
&_config_quad_x[0],
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ foreach table $tables {
|
|||||||
upvar #0 $table angles
|
upvar #0 $table angles
|
||||||
foreach {angle dir} $angles {
|
foreach {angle dir} $angles {
|
||||||
if {$dir == "CW"} {
|
if {$dir == "CW"} {
|
||||||
set dd -1.0
|
|
||||||
} else {
|
|
||||||
set dd 1.0
|
set dd 1.0
|
||||||
|
} else {
|
||||||
|
set dd -1.0
|
||||||
}
|
}
|
||||||
factors $angle $dd
|
factors $angle $dd
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user