Hello,
I’m trying to implement a custom module in the PX4 firmware using this template_module. However the params that I define with DEFINE_PARAMETERS macro does not appear in full params list (via command param show <PARAM_NAME>). Also, I noticed that some modules have separate <MODULE_NAME>_params.c file that define the parameters. I tried this way also, no result.
I wonder if I’m missing any step ?
Would be glad for any help/advice.
Hello,
Did you start your module? You should activate your module in boards/your_FC/yourModule.px4board then compile with make your_FC_yourModule upload.
Then check in QGC console with command help to see all modules, then if yourModule is present, check its status with yourModule status
thanks for the advice, now the params show up when I start the module.
But I need them to be shown despite the module is started or not, or I need the module to autostart. Is there a way to achieve this ?
Your app is started in the ROMFS/px4fmu_common/init.d/rc.your_vehicle.apps.
Taking a multicopter as an example:
- create
rc.your_vehicle.apps file like rc.mc_apps. Create your vehicle type with set VEHICLE_TYPE custom_ve, then start your module in this file.
- create
rc.your_vehicle_defaults and set there all the defaults params for your vehicle.
- add your vehicle,
custom_ve, in the rc.vehicle_setup similarly as Multicopter setup.
- add your
*_apps, *_defaults files to CMakeLists.txt.
- in the subfolder
airframes, create your airframe with a new number between [22000, 22999], i.e. 22000_your_vehicle,
- add this last file to
airframes/CMakeLists.txt
Compile. Then in QGC, when you set the SYS_AUTOSTART param to 22000 and restart yor FC, your module will autostart.
worked for me, thanks alot