m/3dof: Add reset functionality

This commit is contained in:
Mateo de Mayo 2021-12-06 08:26:39 -03:00
parent 916e2ced42
commit 471ca9530b
2 changed files with 17 additions and 0 deletions

View file

@ -38,6 +38,20 @@ m_imu_3dof_init(struct m_imu_3dof *f, int flags)
f->flags = flags;
}
void
m_imu_3dof_reset(struct m_imu_3dof *f)
{
struct m_ff_vec3_f32 *aff = f->word_accel_ff;
struct m_ff_vec3_f32 *gff = f->gyro_ff;
int flags = f->flags;
U_ZERO(f);
f->rot.w = 1.0f;
f->word_accel_ff = aff;
f->gyro_ff = gff;
f->flags = flags;
}
void
m_imu_3dof_close(struct m_imu_3dof *f)
{

View file

@ -75,6 +75,9 @@ struct m_imu_3dof
void
m_imu_3dof_init(struct m_imu_3dof *f, int flags);
void
m_imu_3dof_reset(struct m_imu_3dof *f);
void
m_imu_3dof_close(struct m_imu_3dof *f);