History

Add pitch/yaw scale preference to control degree of view rotation.

Andrzej Kapolka committed 13 years ago

Commit e0e94481 parent ffc1c335 files · +21 −9Browse files

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

Unified · Split

interface/src/SerialInterface.cpp+4−4
@@ -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
@@ -225,9 +225,9 @@ void SerialInterface::readData(float deltaTime) { · 3 unmodified lines
225225
226226 // Convert the integer rates to floats
227227 const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.
228− _lastRotationRates[0] = ((float) pitchRate) * LSB_TO_DEGREES_PER_SECOND;
229− _lastRotationRates[1] = ((float) yawRate) * LSB_TO_DEGREES_PER_SECOND;
230− _lastRotationRates[2] = ((float) rollRate) * LSB_TO_DEGREES_PER_SECOND;
228+ _lastRotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
229+ _lastRotationRates[1] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
230+ _lastRotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
231231
232232 // Update raw rotation estimates
233233 glm::quat estimatedRotation = glm::quat(glm::radians(_estimatedRotation)) *