Robot Control Library
rc_calibrate_gyro.c
/**
* @file rc_calibrate_gyro.c
* @example rc_calibrate_gyro
*
* @brief runs the mpu gyroscope calibration routine
*
* If the routine is successful, a new gyroscope calibration file
* will be saved which is loaded automatically the next time the MPU
* is used.
*
*
* @author James Strawson
* @date 1/29/2018
*/
#include <stdio.h>
#include <rc/mpu.h>
// bus for Robotics Cape and BeagleBone Blue is 2
// change this for your platform
#define I2C_BUS 2
int main()
{
printf("\nThis program will generate a new gyro calibration file\n");
printf("keep your board very still for this procedure.\n");
printf("Press any key to continue\n");
getchar();
printf("Starting calibration routine\n");
config.i2c_bus = I2C_BUS;
printf("Failed to complete gyro calibration\n");
return -1;
}
printf("\ngyro calibration file written\n");
printf("run rc_test_mpu to check performance\n");
return 0;
}
rc_mpu_config_t rc_mpu_default_config(void)
Returns an rc_mpu_config_t struct with default settings.
int rc_mpu_calibrate_gyro_routine(rc_mpu_config_t conf)
Runs gyroscope calibration routine.
configuration of the mpu sensor
Definition: mpu.h:155
int i2c_bus
which bus to use, default 2 on Robotics Cape and BB Blue
Definition: mpu.h:160