aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-01-08 00:02:57 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-01-08 00:02:57 +0100
commit2169e1f808db498c5d8b45c80a7d5e1ea0943ee6 (patch)
tree5203a1f1df91fb7d5f0fc6e3fdf3d06fbefd1f00 /apps
parent91dba465241dbff972f4ba99619d8d7af9c5649b (diff)
parente24dd0f684eb118a5052919c555d3e06ce8c569b (diff)
downloadpx4-firmware-2169e1f808db498c5d8b45c80a7d5e1ea0943ee6.tar.gz
px4-firmware-2169e1f808db498c5d8b45c80a7d5e1ea0943ee6.tar.bz2
px4-firmware-2169e1f808db498c5d8b45c80a7d5e1ea0943ee6.zip
Merge branch 'master' of github.com:PX4/Firmware into mathlib
Diffstat (limited to 'apps')
-rw-r--r--apps/systemlib/mixer/mixer_multirotor.cpp80
-rwxr-xr-xapps/systemlib/mixer/multi_tables4
2 files changed, 44 insertions, 40 deletions
diff --git a/apps/systemlib/mixer/mixer_multirotor.cpp b/apps/systemlib/mixer/mixer_multirotor.cpp
index 3dd6dfcf7..5fdc92c6a 100644
--- a/apps/systemlib/mixer/mixer_multirotor.cpp
+++ b/apps/systemlib/mixer/mixer_multirotor.cpp
@@ -56,9 +56,13 @@
#define debug(fmt, args...) do { } while(0)
//#define debug(fmt, args...) do { printf("[mixer] " fmt "\n", ##args); } while(0)
+//#include <debug.h>
+//#define debug(fmt, args...) lib_lowprintf(fmt "\n", ##args)
-#define CW (-1.0f)
-#define CCW (1.0f)
+/*
+ * Clockwise: 1
+ * Counter-clockwise: -1
+ */
namespace
{
@@ -67,52 +71,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],
diff --git a/apps/systemlib/mixer/multi_tables b/apps/systemlib/mixer/multi_tables
index 2c4a5abed..f17ae30ca 100755
--- a/apps/systemlib/mixer/multi_tables
+++ b/apps/systemlib/mixer/multi_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
}