Skip to content
Snippets Groups Projects
Commit e7492a99 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a bug in the reconstruction of the gyro data (it was unsigned).

parent 7ed9ec42
No related branches found
No related tags found
No related merge requests found
......@@ -404,9 +404,9 @@ void CDarwinRobot::imu_get_gyro_data(double *x,double *y,double *z)
if(this->robot_device==NULL)
throw CDarwinRobotException(_HERE_,"Invalid robot device");
this->robot_device->read_registers(IMU_GYRO_X_OFFSET,data,6);
*x=((double)(data[0]+(data[1]<<8)))/1000.0;
*y=((double)(data[2]+(data[3]<<8)))/1000.0;
*z=((double)(data[4]+(data[5]<<8)))/1000.0;
*x=((double)((signed short int)(data[0]+(data[1]<<8))))/1000.0;
*y=((double)((signed short int)(data[2]+(data[3]<<8))))/1000.0;
*z=((double)((signed short int)(data[4]+(data[5]<<8))))/1000.0;
}
// motion manager interface
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment