Vector and Matrix Math#
Inertial measurement unit fusion driver math routines.
Functions#
Normalize the angle ( -PI < angle <= PI )
Multiply two 3x3 matrices.
Normalize the angle of a vector.
Set all elements of a vector to 0.
Scale a vector by a factor.
Multiply a vector by a scalar.
Add two vectors.
Subtract vector b from vector a.
Calculate the dot product of two vectors.
Calculate the cross product of two vectors.
Function Documentation#
sl_imu_normalize_angle#
void sl_imu_normalize_angle (float * a)
Normalize the angle ( -PI < angle <= PI )
N/A | a | The angle to be normalized |
236
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_matrix_multiply#
void sl_imu_matrix_multiply (float c, float a, float b)
Multiply two 3x3 matrices.
[out] | c | The multiplication result, AB |
[in] | a | Input vector A |
[in] | b | Input vector B |
251
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_normalize_angle#
void sl_imu_vector_normalize_angle (float v)
Normalize the angle of a vector.
N/A | v | The vector, which contains angles to be normalized |
260
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_zero#
void sl_imu_vector_zero (float v)
Set all elements of a vector to 0.
N/A | v | The vector to be cleared |
269
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_scale#
void sl_imu_vector_scale (float v, float scale)
Scale a vector by a factor.
N/A | v | The vector to be scaled |
[in] | scale | The scale factor |
281
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_scalar_multiplication#
void sl_imu_vector_scalar_multiplication (float r, float v, float scale)
Multiply a vector by a scalar.
[out] | r | The multiplied vector |
[in] | v | The vector to be multiplied |
[in] | scale | The scalar multiplicator value |
296
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_add#
void sl_imu_vector_add (float r, float a, float b)
Add two vectors.
[out] | r | The vectorial sum of the vectors, a+b |
[in] | a | The first vector |
[in] | b | The second vector |
311
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_subtract#
void sl_imu_vector_subtract (float r, float a, float b)
Subtract vector b from vector a.
[out] | r | The vectorial difference, a-b |
[in] | a | Vector a |
[in] | b | Vector b |
326
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_dot_product#
float sl_imu_vector_dot_product (float a, float b)
Calculate the dot product of two vectors.
[in] | a | The first vector |
[in] | b | The second vector |
Returns
The dot product
341
of file hardware/driver/imu/inc/sl_imu.h
sl_imu_vector_cross_product#
void sl_imu_vector_cross_product (float r, float a, float b)
Calculate the cross product of two vectors.
[out] | r | The cross product |
[in] | a | The first vector |
[in] | b | The second vector |
356
of file hardware/driver/imu/inc/sl_imu.h