10#include <driver/i2c_types.h>
20 static constexpr const char* TAG =
"Device::Imu";
23 static constexpr uint8_t I2C_ADDRESS = 0x68;
24 static constexpr uint32_t I2C_CLOCK_SPEED = 100'000;
25 static constexpr uint8_t MPU6050_DEVICE_ID = 0x68;
26 static constexpr uint8_t FIFO_BUFFER_SIZE = 42;
29 i2c_master_dev_handle_t device_handle;
40 void write_register(uint8_t register_address, uint8_t value)
const;
49 [[nodiscard]] uint8_t read_register(uint8_t register_address)
const;
~Imu()
Definition imu.cpp:25
void initialize()
Sets up the necessary I2C channel.
Definition imu.cpp:29
void read_fifo_buffer()
Reads the current FIFO buffer from the IMUs DMP (digital motion processor).
Definition imu.cpp:97
Imu(Robot &robot)
Definition imu.cpp:16
quaternion get_quaternion() const
Retrieves the quaternion from the last measurement.
Definition imu.h:74
vector3 get_gyro_values() const
Retrieves the gyro values from the last measurement.
Definition imu.h:81
Class containing all the components of the robot.
Definition robot.h:32
log_source
Definition log_sources.h:12
@ LOG_SOURCE_DEVICE_IMU
Definition log_sources.h:28
Definition battery.cpp:14
A struct to represent a quaternion value.
Definition quaternion.h:13
A struct to represent a value with x, y and z components.
Definition vector3.h:13