History

Testing a different coordinate conversion.

Andrzej Kapolka committed 13 years ago

Commit bf389de1 parent 73ceea71 file · +9 −4Browse files

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

Unified · Split

interface/src/SerialInterface.cpp+9−4
@@ -216,8 +216,9 @@ void SerialInterface::readData(float deltaTime) { · 215 unmodified lines
216 // From MPU-9150 register map, with setting on216 // From MPU-9150 register map, with setting on
217 // highest resolution = +/- 2G217 // highest resolution = +/- 2G
218 218
219 _lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;219 //_lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
220 220 _lastAcceleration = glm::vec3(-accelYRate, accelXRate, accelZRate) * LSB_TO_METERS_PER_SECOND2;
221
221 int rollRate, yawRate, pitchRate;222 int rollRate, yawRate, pitchRate;
222 223
223 convertHexToInt(sensorBuffer + 22, rollRate);224 convertHexToInt(sensorBuffer + 22, rollRate);
@@ -227,8 +228,12 @@ void SerialInterface::readData(float deltaTime) { · 3 unmodified lines
227 // Convert the integer rates to floats228 // Convert the integer rates to floats
228 const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.229 const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.
229 glm::vec3 rotationRates;230 glm::vec3 rotationRates;
230 rotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;231 //rotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
231 rotationRates[1] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;232 //rotationRates[1] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
233 //rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
234
235 rotationRates[0] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
236 rotationRates[1] = ((float) pitchRate) * LSB_TO_DEGREES_PER_SECOND;
232 rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;237 rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
233 238
234 // compute the angular acceleration239 // compute the angular acceleration