Custom SDF file

All custom vehicles need to have atleast an sdf file ready. To create an sdf file for your vehicle, refer to https://classic.gazebosim.org/tutorials?tut=build_model&cat=build_robot

Once you have a custom sdf file ready, create a folder with your vehicle name (”<sdf_name>”). Add your sdf file to it, along with any other resources, and create a new “model.config” file. KEEP YOUR FOLDER NAME AND SDF FILE NAME SAME. (For eg. if your vehicle sdf file is called “my_plane.sdf”, then your folder name should be “my_plane”. This should also be reflected in the model.config file as described below)

Add the following to the model.config file → (This is an example of the delta_wing model. Change all the details to match your model and author.)

<?xml version="1.0"?>

<model>
  <name>Zephyr Delta Wing</name>
  <version>1.0</version>
  <sdf version="1.6">delta_wing.sdf</sdf>

  <author>
    <name>Cole Biesemeyer</name>
    <email>[email protected]</email>
  </author>

  <author>
    <name>Nate Koenig</name>
    <email>[email protected]</email>
  </author>

  <author>
    <name>John Hsu</name>
    <email>[email protected]</email>
  </author>

  <description>
    A model of a Zephyr delta wing with PX4 controls instrumented.
  </description>

</model>

Add the folder your created (”<sdf_file>”) and add it to “/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo/models” (This may differ in different versions of the PX4 firmware, for instance, sitl_gazebo could be sitl_gazebo-classic, or something like that. Find it regardless.)

This concludes the custom SDF step.

Custom Airframe file in ROMFS

Airframe files are used to set certain parameters in the firmware pertaining to a particular airframe (such as MAV_TYPE and CA_ROTOR_COUNT). If you are confused about any such parameters and what they are for, feel free to look up their detailed documentation in

Create a new file in “/PX4-Autopilot/ROMFS/px4fmu-common/init.d-posix/airframes” titled (”ID_gazebo-classic_<sdf_name>”). Here, the ID can be any number, but it shouldnt be the same as any existing airframe file. <sdf_name> should be exactly the same as the name of the sdf file, otherwise it wont work. (This can be based off the iris or solo airframe files of other existing vehicles. For eg. If your vehicle is closer to an existing multirotor frame, then use one of their airframes as an existing reference, and build up from there. )

For eg. I want to create a custom dual rotor tailsitter VTOL, and PX4 already consists of an existing tailsitter, but it has 4 rotors. So I add my custom SDF file as described in the previous step, and then start with the airframe file of the 4 rotor tailsitter →