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
215215 // From MPU-9150 register map, with setting on
216216 // highest resolution = +/- 2G
217217
218− _lastAcceleration = glm::vec3(accelXRate, accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
218+ _lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
219219
220220 int rollRate, yawRate, pitchRate;
221221
@@ -266,8 +266,8 @@ void SerialInterface::readData(float deltaTime) { · 44 unmodified lines
266266 // Without a compass heading, always decay estimated Yaw slightly
267267 const float YAW_DECAY = 0.995;
268268 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)) *
270− estimatedRotation, estimatedRotation, YAW_DECAY);
269+ esimatedRotation = safeMix(glm::angleAxis(glm::degrees(atan2f(forward.x, -forward.z)),
270+ glm::vec3(0.0f, 1.0f, 0.0f)) * estimatedRotation, estimatedRotation, YAW_DECAY);
271271 }
272272 }
273273