PER Firmware
Loading...
Searching...
No Matches
imu.c File Reference

IMU calibration and coordinate transformations. More...

#include "can_library/generated/TORQUE_VECTOR.h"
#include "common/utils/orientation.h"
#include "sensors.h"
#include "common/utils/units.h"
#include "common/utils/clamp.h"
Include dependency graph for imu.c:

Enumerations

enum  decoupling_state_t { DECOUPLING_STATE_IDLE , DECOUPLING_STATE_CALIBRATING , DECOUPLING_STATE_ACTIVE }
 

Functions

void initialize_calibration (void)
 Initialize the IMU decoupling calibration data structures and state.
 
void IZZE_angular_rate_CALLBACK (void)
 Finalize the IMU decoupling calibration by deriving the rotation matrix from the accumulated accelerometer data.
 
void IZZE_acceleration_CALLBACK (void)
 Callback function for handling IZZE acceleration data.
 

Variables

static matrix3x3_t mounting_offset_matrix = {0}
 
imu_data_t imu_data = {0}
 

Detailed Description

IMU calibration and coordinate transformations.

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Enumeration Type Documentation

◆ decoupling_state_t

Enumerator
DECOUPLING_STATE_IDLE 
DECOUPLING_STATE_CALIBRATING 
DECOUPLING_STATE_ACTIVE 

Function Documentation

◆ initialize_calibration()

void initialize_calibration ( void )

Initialize the IMU decoupling calibration data structures and state.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IZZE_acceleration_CALLBACK()

void IZZE_acceleration_CALLBACK ( void )

Callback function for handling IZZE acceleration data.

In calibration mode, accumulates the raw acceleration data to derive the calibration rotation. In active mode, applies the decoupling rotation to the raw acceleration data and sends it out as IMU acceleration.

Here is the call graph for this function:

◆ IZZE_angular_rate_CALLBACK()

void IZZE_angular_rate_CALLBACK ( void )

Finalize the IMU decoupling calibration by deriving the rotation matrix from the accumulated accelerometer data.

Callback function for handling IZZE angular rate data.

In active mode, applies the decoupling rotation to the raw angular rate data and sends it out as IMU angular rate.

Here is the call graph for this function:

Variable Documentation

◆ imu_data

imu_data_t imu_data = {0}

◆ mounting_offset_matrix

matrix3x3_t mounting_offset_matrix = {0}
static