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
216216 // From MPU-9150 register map, with setting on
217217 // highest resolution = +/- 2G
218218
219− _lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
220−
219+ //_lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
220+ _lastAcceleration = glm::vec3(-accelYRate, accelXRate, accelZRate) * LSB_TO_METERS_PER_SECOND2;
221+
221222 int rollRate, yawRate, pitchRate;
222223
223224 convertHexToInt(sensorBuffer + 22, rollRate);
@@ -227,8 +228,12 @@ void SerialInterface::readData(float deltaTime) { · 3 unmodified lines
227228 // Convert the integer rates to floats
228229 const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.
229230 glm::vec3 rotationRates;
230− rotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
231− rotationRates[1] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
231+ //rotationRates[0] = ((float) -pitchRate) * 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;
232237 rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
233238
234239 // compute the angular acceleration