mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
correct the sign for yaw and roll for invensense serial data
This commit is contained in:
parent
3e192cda9b
commit
d7a1cc6ea8
3 changed files with 3 additions and 6 deletions
|
@ -143,8 +143,7 @@ void Avatar::updateHeadFromGyros(float deltaTime, SerialInterface* serialInterfa
|
|||
// Update head lean distance based on accelerometer data
|
||||
glm::vec3 headRotationRates(_head.getPitch(), _head.getYaw(), _head.getRoll());
|
||||
|
||||
|
||||
glm::vec3 leaning = (serialInterface->getLastAcceleration() - serialInterface->getGravity())
|
||||
glm::vec3 leaning = (serialInterface->getLastAcceleration() - serialInterface->getGravity())
|
||||
* LEAN_SENSITIVITY
|
||||
* (1.f - fminf(glm::length(headRotationRates), HEAD_RATE_MAX) / HEAD_RATE_MAX);
|
||||
leaning.y = 0.f;
|
||||
|
|
|
@ -210,8 +210,6 @@ void Head::renderEars() {
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Head::renderMouth() {
|
||||
|
||||
float s = sqrt(_averageLoudness);
|
||||
|
|
|
@ -203,8 +203,8 @@ void SerialInterface::readData() {
|
|||
|
||||
// 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.
|
||||
_lastRollRate = ((float) rollRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||
_lastYawRate = ((float) yawRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||
_lastRollRate = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||
_lastYawRate = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||
_lastPitchRate = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND;
|
||||
|
||||
// Accumulate a set of initial baseline readings for setting gravity
|
||||
|
|
Loading…
Reference in a new issue