Specify Vehicle Parameters (Startup File) in SITL

Hi.

I would like to load a specific parameter configuration file for a PX4 SITL setup. Those files used to be, for example, in

Firmware/posix-configs/SITL/init/ekf2

This used to be in v1.8.2

In recent version, specifically in v1.9.2, those files are not there any more. It seems there has been some restructuring of folder tree.

In v1.9.2, I observed that in the Firmware\launch\posix-sitl.launch , here

the startup parameters are passed in a different way.

Can anyone please describe how a specific startup file can be loaded using the current PX4 stable version (v1.9.2 at this time)?

Thank you.

The startup files are here now: https://github.com/PX4/Firmware/tree/master/ROMFS/px4fmu_common/init.d-posix

In SITL they’re auto-detected based on the model name. I’m not sure if you’re using a custom model or one of the provided ones. There was some discussion a while back on this. Here is an issue that talks about this, starting at a relevant comment. Read that one and the ones following. https://github.com/PX4/Devguide/issues/398#issuecomment-426109047

Thanks @lamping.ap for your reply. I will read the comments, test, and give feedback.

I had a customized iris model with depth camera and 2D LIDAR sensors, and I can confirm that I am able to simulate it in Gazebo with ROS interface. I followed steps similar to ones in the issue linked above and I summarize it here.

  1. I copied the customized model to Firmware/Tools/sitl_gazebo/models/<model_name>
  2. Created a startup file in Firmware/ROMFS/px4fmu_common/init.d-posix/xxxx_<model_name> . xxxx is a unique ID that does not start with 0’s (e.g. 10017_<model_name>)
  3. Build SITL make px4_sitl gazebo
  4. roslaunch px4 posix_sitl.launch vehicle:=<model_name>

Can you give the file list which needs to be changed in order to fly a custom airframe ?
For simulations, I have
i) Added a my_vehicle folder in Firmware/Tools/sitl_gazebo/models - added a config file and a sdf file in this folder
ii) Created an airframe file under ROMFS/px4fmu_common/init.d-posix with 4229_my_vehicle name
iii)Add the airframe name (my_vehicle) to the file platforms/posix/cmake/sitl_target.cmake in the command set(models … )
Now, which files need to be changed for actually implementing the code in pixhawk?