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
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
@@ -225,9 +225,9 @@ void SerialInterface::readData(float deltaTime) { · 3 unmodified lines
225 225
226 // Convert the integer rates to floats226 // Convert the integer rates to floats
227 const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.227 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;228 _lastRotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
229 _lastRotationRates[1] = ((float) yawRate) * 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;230 _lastRotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
231 231
232 // Update raw rotation estimates232 // Update raw rotation estimates
233 glm::quat estimatedRotation = glm::quat(glm::radians(_estimatedRotation)) *233 glm::quat estimatedRotation = glm::quat(glm::radians(_estimatedRotation)) *