Showing the changes to interface/src/SerialInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -200,7 +200,7 @@ void SerialInterface::readData(float deltaTime) { · 199 unmodified lines | |||
| 200 | 200 | ||
| 201 | // ask the invensense for raw gyro data | 201 | // ask the invensense for raw gyro data |
| 202 | short accelData[3]; | 202 | short accelData[3]; |
| 203 | int r1 = mpu_get_accel_reg(accelData, 0); | 203 | mpu_get_accel_reg(accelData, 0); |
| 204 | 204 | ||
| 205 | const float LSB_TO_METERS_PER_SECOND2 = 1.f / 16384.f * GRAVITY_EARTH; | 205 | const float LSB_TO_METERS_PER_SECOND2 = 1.f / 16384.f * GRAVITY_EARTH; |
| 206 | // From MPU-9150 register map, with setting on | 206 | // From MPU-9150 register map, with setting on |
| @@ -208,10 +208,8 @@ void SerialInterface::readData(float deltaTime) { · 1 unmodified line | |||
| 208 | 208 | ||
| 209 | _lastAcceleration = glm::vec3(-accelData[2], -accelData[1], -accelData[0]) * LSB_TO_METERS_PER_SECOND2; | 209 | _lastAcceleration = glm::vec3(-accelData[2], -accelData[1], -accelData[0]) * LSB_TO_METERS_PER_SECOND2; |
| 210 | 210 | ||
| 211 | int rollRate, yawRate, pitchRate; | ||
| 212 | |||
| 213 | short gyroData[3]; | 211 | short gyroData[3]; |
| 214 | int r2 = mpu_get_gyro_reg(gyroData, 0); | 212 | mpu_get_gyro_reg(gyroData, 0); |
| 215 | 213 | ||
| 216 | // Convert the integer rates to floats | 214 | // Convert the integer rates to floats |
| 217 | const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec. | 215 | const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec. |