History

Coordinate fix.

Andrzej Kapolka committed 13 years ago

Commit ba6f2301 parent 081f1931 file · +3 −3Browse files

Showing the changes to interface/src/SerialInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/SerialInterface.cpp+3−3
@@ -215,7 +215,7 @@ void SerialInterface::readData(float deltaTime) { · 214 unmodified lines
215 // From MPU-9150 register map, with setting on215 // From MPU-9150 register map, with setting on
216 // highest resolution = +/- 2G216 // highest resolution = +/- 2G
217 217
218 _lastAcceleration = glm::vec3(accelXRate, accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;218 _lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
219 219
220 int rollRate, yawRate, pitchRate;220 int rollRate, yawRate, pitchRate;
221 221
@@ -266,8 +266,8 @@ void SerialInterface::readData(float deltaTime) { · 44 unmodified lines
266 // Without a compass heading, always decay estimated Yaw slightly266 // Without a compass heading, always decay estimated Yaw slightly
267 const float YAW_DECAY = 0.995;267 const float YAW_DECAY = 0.995;
268 glm::vec3 forward = estimatedRotation * glm::vec3(0.0f, 0.0f, -1.0f);268 glm::vec3 forward = estimatedRotation * glm::vec3(0.0f, 0.0f, -1.0f);
269 safeMix(glm::angleAxis(glm::degrees(atan2f(forward.x, -forward.z)), glm::vec3(0.0f, 1.0f, 0.0f)) *269 esimatedRotation = safeMix(glm::angleAxis(glm::degrees(atan2f(forward.x, -forward.z)),
270 estimatedRotation, estimatedRotation, YAW_DECAY);270 glm::vec3(0.0f, 1.0f, 0.0f)) * estimatedRotation, estimatedRotation, YAW_DECAY);
271 }271 }
272 }272 }
273 273