Monado OpenXR Runtime
m_imu_pre.h File Reference

IMU pre filter struct. More...

#include "xrt/xrt_defines.h"
Include dependency graph for m_imu_pre.h:

Go to the source code of this file.

Data Structures

struct  m_imu_pre_filter_part
 This is a common IMU pre-filter which takes raw 'ticks' from a 3 axis IMU measurement and converts it into degrees per secs and meters per second^2 floats. More...
 
struct  m_imu_pre_filter
 This is a common IMU pre-filter which takes raw 'ticks' from an IMU measurement and converts it into floats representing radians per second and meters per second^2 floats. More...
 

Functions

void m_imu_pre_filter_init (struct m_imu_pre_filter *imu, float ticks_to_float_accel, float ticks_to_float_gyro)
 A simple init function that takes the two ticks_to_float values, all other values are set to identity. More...
 
void m_imu_pre_filter_set_switch_x_and_y (struct m_imu_pre_filter *imu)
 Sets the transformation to flip X and Y axis. More...
 
void m_imu_pre_filter_data (struct m_imu_pre_filter *imu, const struct xrt_vec3_i32 *accel, const struct xrt_vec3_i32 *gyro, struct xrt_vec3 *out_accel, struct xrt_vec3 *out_gyro)
 Pre-filters the values, taking them from ticks into float values. More...
 

Detailed Description

IMU pre filter struct.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ m_imu_pre_filter_data()

void m_imu_pre_filter_data ( struct m_imu_pre_filter imu,
const struct xrt_vec3_i32 accel,
const struct xrt_vec3_i32 gyro,
struct xrt_vec3 out_accel,
struct xrt_vec3 out_gyro 
)

Pre-filters the values, taking them from ticks into float values.

See description of m_imu_pre_filter_part for formula used. Also rotates values with the imu_to_head pose.

◆ m_imu_pre_filter_init()

void m_imu_pre_filter_init ( struct m_imu_pre_filter imu,
float  ticks_to_float_accel,
float  ticks_to_float_gyro 
)

A simple init function that takes the two ticks_to_float values, all other values are set to identity.

◆ m_imu_pre_filter_set_switch_x_and_y()

void m_imu_pre_filter_set_switch_x_and_y ( struct m_imu_pre_filter imu)

Sets the transformation to flip X and Y axis.

This changes the handedness of the coordinates.