mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:14:28 +02:00
Testing a different coordinate conversion.
This commit is contained in:
parent
73ceea7795
commit
bf389de774
1 changed files with 9 additions and 4 deletions
|
@ -216,8 +216,9 @@ void SerialInterface::readData(float deltaTime) {
|
||||||
// From MPU-9150 register map, with setting on
|
// From MPU-9150 register map, with setting on
|
||||||
// highest resolution = +/- 2G
|
// highest resolution = +/- 2G
|
||||||
|
|
||||||
_lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
|
//_lastAcceleration = glm::vec3(-accelXRate, -accelYRate, -accelZRate) * LSB_TO_METERS_PER_SECOND2;
|
||||||
|
_lastAcceleration = glm::vec3(-accelYRate, accelXRate, accelZRate) * LSB_TO_METERS_PER_SECOND2;
|
||||||
|
|
||||||
int rollRate, yawRate, pitchRate;
|
int rollRate, yawRate, pitchRate;
|
||||||
|
|
||||||
convertHexToInt(sensorBuffer + 22, rollRate);
|
convertHexToInt(sensorBuffer + 22, rollRate);
|
||||||
|
@ -227,8 +228,12 @@ void SerialInterface::readData(float deltaTime) {
|
||||||
// Convert the integer rates to floats
|
// Convert the integer rates to floats
|
||||||
const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.
|
const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec.
|
||||||
glm::vec3 rotationRates;
|
glm::vec3 rotationRates;
|
||||||
rotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
|
//rotationRates[0] = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||||
rotationRates[1] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
|
//rotationRates[1] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||||
|
//rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||||
|
|
||||||
|
rotationRates[0] = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||||
|
rotationRates[1] = ((float) pitchRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||||
rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
|
rotationRates[2] = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||||
|
|
||||||
// compute the angular acceleration
|
// compute the angular acceleration
|
||||||
|
|
Loading…
Reference in a new issue