Creating custom module with its Params

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.

did you see the doc?

2 Likes

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

1 Like

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:

  1. 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.
  2. create rc.your_vehicle_defaults and set there all the defaults params for your vehicle.
  3. add your vehicle, custom_ve, in the rc.vehicle_setup similarly as Multicopter setup.
  4. add your *_apps, *_defaults files to CMakeLists.txt.
  5. in the subfolder airframes, create your airframe with a new number between [22000, 22999], i.e. 22000_your_vehicle,
  6. 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.

1 Like

worked for me, thanks alot