Hello there,
I’m new here and having some trouble with the CMSIS-DSP Arduino Library. I’m using the Teensy 4.1, and in my code, I called the arm_mat_add_f32() function and other matrix functions without any issues. But I get errors only when calling arm_mat_cholesky_f32() and arm_quaternion_normalize_f32().
Here’s the error log:
lib/ukf/src/ukf.cpp: In member function 'void ukf::ukf_predict(UKF_HANDLE*, float32_t*, float32_t*)':
lib/ukf/src/ukf.cpp:72:17: error: 'arm_mat_cholesky_f32' was not declared in this scope; did you mean 'arm_mat_scale_f32'?
72 | arm_mat_cholesky_f32(&ukf->P, &ukf->P_sqrt);
| ^~~~~~~~~~~~~~~~~~~~
| arm_mat_scale_f32
lib/ukf/src/ukf.cpp:86:25: error: 'arm_quaternion_normalize_f32' was not declared in this scope
86 | arm_quaternion_normalize_f32(xi_pred.q, xi_pred.q, 1);
Here’s a snippet of the code causing the issue:
void ukf::ukf_predict(UKF_HANDLE *ukf, float32_t omegaM[3], float32_t u[UKF_CTRL_DIM]) {
arm_mat_add_f32(&ukf->P, &ukf->Q, &ukf->P);
arm_mat_cholesky_f32(&ukf->P, &ukf->P_sqrt);
ukf_generate_sigmaPoints(ukf, &ukf->P_sqrt);
for (uint8_t i = 0; i < UKF_SIGMA_CNT; i++) {
UKF_STATE xi = {0}, xi_pred = {0};
memcpy(xi.q, &ukf->sigma.pData[i * UKF_STATE_DIM], sizeof(float32_t) * 4);
memcpy(xi.b, &ukf->sigma.pData[i * UKF_STATE_DIM + 4], sizeof(float32_t) * 3);
ukf_process_model(&xi, omegaM, u, &xi_pred);
arm_quaternion_normalize_f32(xi_pred.q, xi_pred.q, 1);
memcpy(&ukf->sigma.pData[i * UKF_STATE_DIM], xi_pred.q, sizeof(float32_t) * 4);
memcpy(&ukf->sigma.pData[i * UKF_STATE_DIM + 4], xi_pred.b, sizeof(float32_t) * 3);
}
}
and here is my platformio.ini:
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
lib_deps =
arduino-libraries/Arduino_CMSIS-DSP @ ^0.0.1
SPI @ ^1.0
build_flags =
-DARM_MATH_MATRIX_CHECK
-DARM_MATH_QUATERNION
-D__FPU_PRESENT=1
-DARM_MATH_LOOPUNROLL
-ARM_MATH_MVEF
Has anyone else run into this issue or have any tips?
thanks in advanced.