Custom parameters' description not showing in QGC

Hello,

I’ve added custom parameters to the software for a custom module I’m building, and while the parameters do appear in QGC when the module is running and seem to work fine, I’m not getting the description, unit nor the min/max values in QGC. Is there any step I missed ?

I followed the metadata procedure from https://dev.px4.cc/master/en/advanced/parameters_and_configurations.html and the parameters.xml generated file does have the description fields correctly filled, example :

<parameter name="MYMOD_R_T" default="0.3" type="FLOAT">
      <short_desc>Roll failure trigger time</short_desc>
      <long_desc>Seconds (decimal) that roll has to exceed MYMOD_R before being considered as a failure.</long_desc>
      <min>0.02</min>
      <max>5</max>
      <unit>s</unit>
      <decimal>2</decimal>`
    </parameter>
1 Like

Hi,

I think what you need to do is:

  1. bump up parameter_version_minor in src/lib/parameters/px4params/xmlout.py
  2. clean build
  3. write the firmware via QGC

Hope it helps:)

I’ve been confused by this too.

A method that worked for me was to build QGC myself, and replace its parameter xml file with the one generated by running make px4_metadata in the PX4-Autopilot repository.

Of course, a big drawback is that you have to build QGC yourself, but a positive side is that then QGC will have the correct metadata regardless of whether you’ve used it to flash your vehicle’s firmware or not.

Hi,

Thanks for the reply, tried this but still didn’t work… To be clear, by “bump up” you meant that if my code looks like this :

xml_parameters = ET.Element("parameters")
    xml_version = ET.SubElement(xml_parameters, "version")
    xml_version.text = "3"
    xml_version = ET.SubElement(xml_parameters, "parameter_version_major")
    xml_version.text = "1"
    xml_version = ET.SubElement(xml_parameters, "parameter_version_minor")
    xml_version.text = "16"

I should replace the 16 by 17 ? (that’s what I just tried)

Yeah thing is I really wanted to try and find a solution that didn’t require building QGC from source, but that’ll probably be the solution I’ll go to when other people start using my modules and need the documentation inside QGC… :slight_smile:

Ok so actually, I downloaded the last QGC version and now it seems to work by doing, in my px4_firmware folder

make clean
make px4_metadata
make px4_custom_firmware

Then by flashing the board with the custom .px4 file through QGC.

This used to not work on my previous QGC, and I did delete all QGC related .cache folders as well before downloading & launching the new AppImage, so maybe the most important step for me was this one.

I didn’t try to add a new module and new parameters yet, but as soon as I code a new one I’ll come edit here to confirm that it now works as it’s supposed to work then… ¯_(ツ)_/¯

I tried with a new module today, and it worked without needing to remove the .cache folders nor to modify xmlout.py file. The steps in the solution above seem to now work perfectly fine.