correct the sign for yaw and roll for invensense serial data

This commit is contained in:
Stephen Birarda 2013-05-22 19:38:17 -07:00
parent 3e192cda9b
commit d7a1cc6ea8
3 changed files with 3 additions and 6 deletions

View file

@ -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;

View file

@ -210,8 +210,6 @@ void Head::renderEars() {
glPopMatrix();
}
void Head::renderMouth() {
float s = sqrt(_averageLoudness);

View file

@ -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