Showing the changes to interface/src/SerialInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -215,7 +215,7 @@ void SerialInterface::readData(float deltaTime) { · 214 unmodified lines | ||
| 215 | 215 | // From MPU-9150 register map, with setting on |
| 216 | 216 | // 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 | 220 | int rollRate, yawRate, pitchRate; |
| 221 | 221 | |
| @@ -266,8 +266,8 @@ void SerialInterface::readData(float deltaTime) { · 44 unmodified lines | ||
| 266 | 266 | // Without a compass heading, always decay estimated Yaw slightly |
| 267 | 267 | const float YAW_DECAY = 0.995; |
| 268 | 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)) * | |
| 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); | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |