Vector and Matrix Math
Description
Inertial measurement unit fusion driver math routines.
Functions |
|
| void | sl_imu_normalize_angle (float *a) |
|
Normalize the angle ( -PI < angle <= PI )
|
|
| void | sl_imu_matrix_multiply (float c[3][3], float a[3][3], float b[3][3]) |
|
Multiply two 3x3 matrices.
|
|
| void | sl_imu_vector_normalize_angle (float v[3]) |
|
Normalize the angle of a vector.
|
|
| void | sl_imu_vector_zero (float v[3]) |
|
Set all elements of a vector to 0.
|
|
| void | sl_imu_vector_scale (float v[3], float scale) |
|
Scale a vector by a factor.
|
|
| void | sl_imu_vector_scalar_multiplication (float r[3], float v[3], float scale) |
|
Multiply a vector by a scalar.
|
|
| void | sl_imu_vector_add (float r[3], float a[3], float b[3]) |
|
Add two vectors.
|
|
| void | sl_imu_vector_subtract (float r[3], float a[3], float b[3]) |
|
Subtract vector b from vector a.
|
|
| float | sl_imu_vector_dot_product (float a[3], float b[3]) |
|
Calculate the dot product of two vectors.
|
|
| void | sl_imu_vector_cross_product (float r[3], float a[3], float b[3]) |
|
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 )
- Parameters
-
aThe angle to be normalized
◆ sl_imu_matrix_multiply()
| void sl_imu_matrix_multiply | ( | float |
c[3][3],
|
| float |
a[3][3],
|
||
| float |
b[3][3]
|
||
| ) |
Multiply two 3x3 matrices.
- Parameters
-
[out] cThe multiplication result, AB [in] aInput vector A [in] bInput vector B
◆ sl_imu_vector_normalize_angle()
| void sl_imu_vector_normalize_angle | ( | float |
v[3]
|
) |
Normalize the angle of a vector.
- Parameters
-
vThe vector, which contains angles to be normalized
◆ sl_imu_vector_zero()
| void sl_imu_vector_zero | ( | float |
v[3]
|
) |
Set all elements of a vector to 0.
- Parameters
-
vThe vector to be cleared
◆ sl_imu_vector_scale()
| void sl_imu_vector_scale | ( | float |
v[3],
|
| float |
scale
|
||
| ) |
Scale a vector by a factor.
- Parameters
-
vThe vector to be scaled [in] scaleThe scale factor
◆ sl_imu_vector_scalar_multiplication()
| void sl_imu_vector_scalar_multiplication | ( | float |
r[3],
|
| float |
v[3],
|
||
| float |
scale
|
||
| ) |
Multiply a vector by a scalar.
- Parameters
-
[out] rThe multiplied vector [in] vThe vector to be multiplied [in] scaleThe scalar multiplicator value
◆ sl_imu_vector_add()
| void sl_imu_vector_add | ( | float |
r[3],
|
| float |
a[3],
|
||
| float |
b[3]
|
||
| ) |
Add two vectors.
- Parameters
-
[out] rThe vectorial sum of the vectors, a+b [in] aThe first vector [in] bThe second vector
◆ sl_imu_vector_subtract()
| void sl_imu_vector_subtract | ( | float |
r[3],
|
| float |
a[3],
|
||
| float |
b[3]
|
||
| ) |
Subtract vector b from vector a.
- Parameters
-
[out] rThe vectorial difference, a-b [in] aVector a [in] bVector b
◆ sl_imu_vector_dot_product()
| float sl_imu_vector_dot_product | ( | float |
a[3],
|
| float |
b[3]
|
||
| ) |
Calculate the dot product of two vectors.
- Parameters
-
[in] aThe first vector [in] bThe second vector
- Returns
- The dot product
◆ sl_imu_vector_cross_product()
| void sl_imu_vector_cross_product | ( | float |
r[3],
|
| float |
a[3],
|
||
| float |
b[3]
|
||
| ) |
Calculate the cross product of two vectors.
- Parameters
-
[out] rThe cross product [in] aThe first vector [in] bThe second vector