PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

bring back `px4-rc.params` file to set user defined params

Open bastianhjaeger opened this issue 4 months ago • 9 comments

px4-rc.params file can be used to set/override parameters.

It was removed in https://github.com/PX4/PX4-Autopilot/pull/24600 and discussed to bring it back.

Test coverage

  • Simulation testing :heavy_check_mark:

bastianhjaeger avatar Sep 03 '25 08:09 bastianhjaeger

I think we need to do a little bit more, how does this make it into the ROMFS? @alexcekay added something similar recently https://github.com/PX4/PX4-Autopilot/pull/25449

dakejahl avatar Sep 03 '25 08:09 dakejahl

The way it worked before (and should still) is, that we ensure the file px4-rc.params is present in the context and then gets applied.

bastianhjaeger avatar Sep 03 '25 08:09 bastianhjaeger

There are still things missing to fully bing this back.

  • Please have a look at https://github.com/PX4/PX4-Autopilot/pull/24600/files#diff-2a4aa749b0ac200cb520539a8171ae5f8dc353e08be7edd519e945a7e6e7422a
  • The file ROMFS/px4fmu_common/init.d-posix/px4-rc.params needs to be created again
  • It needs to be added back to the ROMFS in ROMFS/px4fmu_common/init.d-posix/CMakeLists.txt

alexcekay avatar Sep 03 '25 09:09 alexcekay

Thx. Done.

bastianhjaeger avatar Sep 03 '25 11:09 bastianhjaeger

So you want to edit the px4-rc.params file directly? Your comment in the code seems to indicate you want to use something in your PATH?

#user defined params for instances can be in PATH

With your latest commit you've added the file in-tree. If you want to have something in-tree then I would use the dynamic init system

CONFIG_BOARD_ADDITIONAL_INIT="rc.additional"

dakejahl avatar Sep 03 '25 17:09 dakejahl

For hardware targets we also have config.txt and extras.txt. Maybe we want to bring this into SITL as well? We should try to simplify and minimize the configuration options https://docs.px4.io/main/en/concept/system_startup.html#customizing-the-system-startup

dakejahl avatar Sep 03 '25 17:09 dakejahl

So you want to edit the px4-rc.params file directly? Your comment in the code seems to indicate you want to use something in your PATH?

#user defined params for instances can be in PATH

With your latest commit you've added the file in-tree. If you want to have something in-tree then I would use the dynamic init system

CONFIG_BOARD_ADDITIONAL_INIT="rc.additional"

The way we used it so far was to add some path to "PATH" and put a file there called px4-rc.params, which then will be applied by the RCS file with

#user defined params for instances can be in PATH
. px4-rc.params

bastianhjaeger avatar Sep 09 '25 14:09 bastianhjaeger

This PR was identified as stale and it will be closed in 30 days unless any activity is detected.

github-actions[bot] avatar Dec 09 '25 02:12 github-actions[bot]

I see. https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d-posix/rcS#L14

So it's a posix-only thing. It would be nice to do this in a more obvious and generalized way.

Not sure what you want to say?

bastianhjaeger avatar Dec 11 '25 08:12 bastianhjaeger

I see. https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d-posix/rcS#L14 So it's a posix-only thing. It would be nice to do this in a more obvious and generalized way.

Not sure what you want to say?

I am saying this is an empty file without clear purpose that gets put into the PATH in a non-obvious way that is specific to posix. Any reason why config.txt or extras.txt aren't suitable? We should try to minimize the number of configuration knobs. https://docs.px4.io/main/en/concept/system_startup#customizing-the-system-startup

dakejahl avatar Dec 11 '25 22:12 dakejahl