aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lorenz@px4.io>2015-03-29 16:28:22 -0700
committerLorenz Meier <lorenz@px4.io>2015-03-29 16:28:22 -0700
commit3d8c85920b06bf37f4a0b1c17de9863a7533a36d (patch)
tree3505d685e1c0801940e952eb5b2e99000d699b77
parent17ee20a338a05a9d46c4aa8a4c193c0b0810b3b1 (diff)
parent2d19726ee781793d18a4dab4e003d5a24abaf2c3 (diff)
downloadpx4-firmware-3d8c85920b06bf37f4a0b1c17de9863a7533a36d.tar.gz
px4-firmware-3d8c85920b06bf37f4a0b1c17de9863a7533a36d.tar.bz2
px4-firmware-3d8c85920b06bf37f4a0b1c17de9863a7533a36d.zip
Merge pull request #1961 from bansiesta/missingrotation
rotation: added another missing rotation
-rw-r--r--src/lib/conversion/rotation.cpp5
-rw-r--r--src/lib/conversion/rotation.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/conversion/rotation.cpp b/src/lib/conversion/rotation.cpp
index 1fe36d395..7418ba4ef 100644
--- a/src/lib/conversion/rotation.cpp
+++ b/src/lib/conversion/rotation.cpp
@@ -194,5 +194,10 @@ rotate_3f(enum Rotation rot, float &x, float &y, float &z)
tmp = z; z = x; x = -tmp;
return;
}
+ case ROTATION_ROLL_180_PITCH_270: {
+ tmp = z; z = x; x = tmp;
+ y = -y;
+ return;
+ }
}
}
diff --git a/src/lib/conversion/rotation.h b/src/lib/conversion/rotation.h
index 13fe701df..ef0f41c3a 100644
--- a/src/lib/conversion/rotation.h
+++ b/src/lib/conversion/rotation.h
@@ -75,6 +75,7 @@ enum Rotation {
ROTATION_PITCH_90 = 24,
ROTATION_PITCH_270 = 25,
ROTATION_ROLL_270_YAW_270 = 26,
+ ROTATION_ROLL_180_PITCH_270 = 27,
ROTATION_MAX
};
@@ -111,7 +112,8 @@ const rot_lookup_t rot_lookup[] = {
{270, 0, 135 },
{ 0, 90, 0 },
{ 0, 270, 0 },
- {270, 0, 270 }
+ {270, 0, 270 },
+ {180, 270, 0 }
};
/**