Hello everyone,
I am currently working on the src/lib/mixer/MultirotorMixer part of px4. I need to add parameters but my different tries end up unsuccessfully.
Test 1 : Following the documentation Parameters & Configs · PX4 Developer Guide I tried to use the cpp API and added
#include <px4_module_params.h>
to the file src/lib/mixer/MultirotorMixer/MultirotorMixer.hpp
==> the file dooesn’t exist anymore.
So I took example on the other files using parameters and tried replace it by
#include <px4_platform_common/module_params.h>
==> I end up with the following error:
fatal error: parameters/px4_parameters_public.h: No such file or directory
Indeed the parameters/px4_parameters_public.h is generated afterward … So I tried to modified the CMakefile.txt by tranforming
add_library(MultirotorMixer
MultirotorMixer.cpp
MultirotorMixer.hpp
${CMAKE_CURRENT_BINARY_DIR}/mixer_multirotor.generated.h
${CMAKE_CURRENT_BINARY_DIR}/mixer_multirotor_normalized.generated.h
${CMAKE_CURRENT_BINARY_DIR}/mixer_multirotor_6dof.generated.h
)
into px4 version to ensure the parameters of my file src/lib/mixer/MultirotorMixer/params.c are processed
px4_add_library(MultirotorMixer
MultirotorMixer.cpp
MultirotorMixer.hpp
${CMAKE_CURRENT_BINARY_DIR}/mixer_multirotor.generated.h
${CMAKE_CURRENT_BINARY_DIR}/mixer_multirotor_normalized.generated.h
${CMAKE_CURRENT_BINARY_DIR}/mixer_multirotor_6dof.generated.h
)
with no success.
Test 2:
I tried to used The C API with int param_get(param_t param, void *val);
and it works fine with the gazebo simulation ( make px4_sitl gazebo
) but when I try to build the fmu version (make px4_fmu-v3
)I have the following error :
undefined reference to `param_get'
Could someone point out my mistakes and give me a working way to add new parameters ?
Thanks in advance,
Best,
Alexis D.