|
HRI board firmware
v2.1
Microcontroller firmware of the board used during the HRI labs.
|
Driver for the MPU-6050, a 6-axis IMU from Invensense. More...
Enumerations | |
| enum | mpu_AccelRange { MPU_ACCEL_RANGE_2G = 0, MPU_ACCEL_RANGE_4G = 1, MPU_ACCEL_RANGE_8G = 2, MPU_ACCEL_RANGE_16G = 3 } |
| Enumeration of the possible accelerometer ranges. More... | |
| enum | mpu_GyroRange { MPU_GYRO_RANGE_250DPS = 0, MPU_GYRO_RANGE_500DPS = 1, MPU_GYRO_RANGE_1000DPS = 2, MPU_GYRO_RANGE_2000DPS = 3 } |
| Enumeration of the possible gyrometer ranges. More... | |
| enum | mpu_Bandwidth { MPU_DLPF_BW_256HZ = 0, MPU_DLPF_BW_188HZ = 1, MPU_DLPF_BW_98HZ = 2, MPU_DLPF_BW_42HZ = 3, MPU_DLPF_BW_20HZ = 4, MPU_DLPF_BW_10HZ = 5, MPU_DLPF_BW_5HZ = 6 } |
| Enumeration of the possible bandwidths. More... | |
| enum | mpu_Axis { MPU_AXIS_ACCEL_X = 0x3b, MPU_AXIS_ACCEL_Y = 0x3d, MPU_AXIS_ACCEL_Z = 0x3f, MPU_AXIS_TEMPERATURE = 0x41, MPU_AXIS_GYRO_X = 0x43, MPU_AXIS_GYRO_Y = 0x45, MPU_AXIS_GYRO_Z = 0x47 } |
| Enumeration of all the measurement registers. More... | |
Functions | |
| bool | mpu_Init (mpu_AccelRange accelRange, mpu_GyroRange gyroRange, mpu_Bandwidth bandwidth) |
| Initializes the MPU-6050 device. More... | |
| void | mpu_GetAxis (mpu_Axis axis, float32_t *value) |
| Acquires the value of a single axis, from the IMU. More... | |
| void | mpu_GetAcceleration (float32_t *ax, float32_t *ay, float32_t *az) |
| Acquires the acceleration from the IMU. More... | |
| void | mpu_GetAngularSpeed (float32_t *gx, float32_t *gy, float32_t *gz) |
| Acquires the angular speed from the IMU. More... | |
| float | mpu_GetTemperature (void) |
| Acquires the temperature from the IMU. More... | |
Driver for the MPU-6050, a 6-axis IMU from Invensense.
This driver uses the I2C bus of the digital extension connector.
Call mpu_Init() first in the initialization code. Then, call mpu_Get() to get the accelerations and angular speeds.
| enum mpu_AccelRange |
| enum mpu_Axis |
| enum mpu_Bandwidth |
Enumeration of the possible bandwidths.
| enum mpu_GyroRange |
| void mpu_GetAcceleration | ( | float32_t * | ax, |
| float32_t * | ay, | ||
| float32_t * | az | ||
| ) |
Acquires the acceleration from the IMU.
| ax | variable to write the X-axis acceleration on [m/s^2]. |
| ay | variable to write the Y-axis acceleration on [m/s^2]. |
| az | variable to write the Z-axis acceleration on [m/s^2]. |
| void mpu_GetAngularSpeed | ( | float32_t * | gx, |
| float32_t * | gy, | ||
| float32_t * | gz | ||
| ) |
Acquires the angular speed from the IMU.
| gx | variable to write the X-axis angular speed on [deg/s]. |
| gy | variable to write the Y-axis angular speed on [deg/s]. |
| gz | variable to write the Z-axis angular speed on [deg/s]. |
| void mpu_GetAxis | ( | mpu_Axis | axis, |
| float32_t * | value | ||
| ) |
Acquires the value of a single axis, from the IMU.
| axis | the IMU axis to get (see mpu_Axis). |
| value | variable to write the value on. The unit depends on the selected axis: [m/s^2] for an acceleration, [deg/s] for an angular speed, and [celsius] for the temperature. |
| float mpu_GetTemperature | ( | void | ) |
Acquires the temperature from the IMU.
| bool mpu_Init | ( | mpu_AccelRange | accelRange, |
| mpu_GyroRange | gyroRange, | ||
| mpu_Bandwidth | bandwidth | ||
| ) |
Initializes the MPU-6050 device.
| accelRange | accelerometer range. |
| gyroRange | gyroscope range. |
| bandwidth | bandwith of the accelerometer and gyroscope. |
1.8.13