Create custom model for SITL

HI, i tried:

  • I created a folder under Tools/sitl_gazebo/models for my model, named x4vtail_vtol3
  • I created the following files under Tools/sitl_gazebo/models/x4vtail_vtol3: model.config and x4vtail_vtol3.sdf (which is based off the standard_vtol models in Tools/sitl_gazebo/models)
  • I create my own airframe file in init.d-posix, named 1044_x4vtail_vtol3. Also i will use my own mixer, name x4vtail_vtol3_sitl.main.mix.
  • I added the airframe name to the platforms/posix/cmake/sitl_target.cmake in the command set(models …)
  • And i added name of it to ROMFS/px4fmu_common/mixers-sitl/CMakeLists.txt.
    *Then, i run
cd build
cmake .. 
make
cd ..

*When i run
make px4_sitl gazebo_x4vtail_vtol3
it gets stuck at INFO [simulator] Waiting for simulator to accept connection on TCP port 4560 and gazebo do not open, here is the result:

[0/1] Re-running CMake...
-- PX4 version: v1.12.1
-- PX4 config file: /home/x/PX4-Autopilot/boards/px4/sitl/default.cmake
-- PX4 config: px4_sitl_default
-- PX4 platform: posix
-- PX4 lockstep: enabled
-- cmake build type: RelWithDebInfo
-- Building for code coverage
-- ccache enabled (export CCACHE_DISABLE=1 to disable)
-- build type is RelWithDebInfo
-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-591-gb3fed06
-- ROMFS: ROMFS/px4fmu_common
-- Configuring done
-- Generating done
-- Build files have been written to: /home/x/PX4-Autopilot/build/px4_sitl_default
[0/4] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[3/4] cd /home/x/PX4-Autopilot/build/px4_sitl_default/t...-Autopilot /home/x/PX4-Autopilot/build/px4_sitl_default
SITL ARGS
sitl_bin: /home/x/PX4-Autopilot/build/px4_sitl_default/bin/px4
debugger: none
program: gazebo
model: x4vtail_vtol3
world: none
src_path: /home/x/PX4-Autopilot
build_path: /home/x/PX4-Autopilot/build/px4_sitl_default
GAZEBO_PLUGIN_PATH :/home/x/PX4-Autopilot/build/posix_sitl_default/build_gazebo:/home/x/PX4-Autopilot/build/posix_sitl_default/build_gazebo:/home/x/PX4-Autopilot/build/posix_sitl_default/build_gazebo:/home/x/PX4-Autopilot/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/home/x/PX4-Autopilot/Tools/sitl_gazebo/models:/home/x/PX4-Autopilot/Tools/sitl_gazebo/models:/home/x/PX4-Autopilot/Tools/sitl_gazebo/models:/home/x/PX4-Autopilot/Tools/sitl_gazebo/models
LD_LIBRARY_PATH /home/x/catkin_ws/devel/lib:/opt/ros/melodic/lib:/home/x/PX4-Autopilot/build/posix_sitl_default/build_gazebo:/home/x/PX4-Autopilot/build/posix_sitl_default/build_gazebo:/home/x/PX4-Autopilot/build/posix_sitl_default/build_gazebo:/home/x/PX4-Autopilot/build/px4_sitl_default/build_gazebo
empty world, setting empty.world as default
Using: /home/x/PX4-Autopilot/Tools/sitl_gazebo/models/x4vtail_vtol3/x4vtail_vtol3.sdf
/home/x/PX4-Autopilot/Tools/sitl_run.sh: line 201: 30918 Segmentation fault      (core dumped) gzserver $verbose $world_path
SITL COMMAND: "/home/x/PX4-Autopilot/build/px4_sitl_default/bin/px4" "/home/x/PX4-Autopilot/build/px4_sitl_default"/etc -s etc/init.d-posix/rcS -t "/home/x/PX4-Autopilot"/test_data
INFO  [px4] Creating symlink /home/x/PX4-Autopilot/build/px4_sitl_default/etc -> /home/x/PX4-Autopilot/build/px4_sitl_default/tmp/rootfs/etc

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
Info: found model autostart file as SYS_AUTOSTART=1044
INFO  [param] selected parameter default file eeprom/parameters_1044
[param] parameter file not found, creating eeprom/parameters_1044
  SYS_AUTOCONFIG: curr: 0 -> new: 1
  SYS_AUTOSTART: curr: 0 -> new: 1044
  CAL_ACC0_ID: curr: 0 -> new: 1310988
  CAL_GYRO0_ID: curr: 0 -> new: 1310988
  CAL_ACC1_ID: curr: 0 -> new: 1310996
  CAL_GYRO1_ID: curr: 0 -> new: 1310996
  CAL_ACC2_ID: curr: 0 -> new: 1311004
  CAL_GYRO2_ID: curr: 0 -> new: 1311004
  CAL_MAG0_ID: curr: 0 -> new: 197388
  CAL_MAG1_ID: curr: 0 -> new: 197644
  SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
  SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
Gazebo multi-robot simulator, version 9.19.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
* SYS_AUTOCONFIG: curr: 1 -> new: 0
  IMU_INTEG_RATE: curr: 200 -> new: 250
INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
PX4 SIM HOST: localhost
INFO  [simulator] Waiting for simulator to accept connection on TCP port 4560

I have no idea about it ,can you help me? Please and Thanks! :sob:

I once added this model in another computer through the above steps. At that time, it could be successfully added, and my plane could fly normally. But this time I followed the same steps and failed. I don’t know why.

1 Like

I have the same problem
if anyone could help, it would be appreciated.
to find the solution to this problem, I used the iris model but just changed the name to something else, and I got the following errors:
@Jaeyoung-Lim Jaeyoung-Lim

[0/4] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[3/4] cd /home/aminys/PX4-Autopilot/bu...s/PX4-Autopilot/build/px4_sitl_default
SITL ARGS
sitl_bin: /home/aminys/PX4-Autopilot/build/px4_sitl_default/bin/px4
debugger: none
program: gazebo
model: HB_x500
world: none
src_path: /home/aminys/PX4-Autopilot
build_path: /home/aminys/PX4-Autopilot/build/px4_sitl_default
GAZEBO_PLUGIN_PATH :/home/aminys/PX4-Autopilot/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/home/aminys/PX4-Autopilot/Tools/sitl_gazebo/models
LD_LIBRARY_PATH :/home/aminys/PX4-Autopilot/build/px4_sitl_default/build_gazebo
empty world, setting empty.world as default
Using: /home/aminys/PX4-Autopilot/Tools/sitl_gazebo/models/HB_x500/HB_x500.sdf
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
Error [Param.cc:329] Invalid boolean value
Error [Param.cc:329] Invalid boolean value
Error [Param.cc:449] Invalid argument. Unable to set value [{{ mavlink_udp_port }} ] for key[mavlink_udp_port].
Error [Param.cc:449] Invalid argument. Unable to set value [{{ mavlink_tcp_port }} ] for key[mavlink_tcp_port].
SITL COMMAND: "/home/aminys/PX4-Autopilot/build/px4_sitl_default/bin/px4" "/home/aminys/PX4-Autopilot/build/px4_sitl_default"/etc -s etc/init.d-posix/rcS -t "/home/aminys/PX4-Autopilot"/test_data
Creating symlink /home/aminys/PX4-Autopilot/build/px4_sitl_default/etc -> /home/aminys/PX4-Autopilot/build/px4_sitl_def

I have a question, if I change let’s say the box size in the sdf file, will the physical properties change like will it simulate according to real life conditions based on the measurements given

Same error, anything new ?

Hello!
I’m relatively new to this, I was trying to follow these steps, but I find myself stuck at the last step. I can’t find the sitl_target.cmake. I don’t see in on main in Github as well. What changes should I incorporate to get this working?
Any help would be appreciated!
Thanks in advance!

Hi. I created the model according to the instructions. Error on startup. I also get the same error if I run some of the list of available models. For example:models iris, plane, plane_catapult, boat - start normally; models iris_rplidar, iris_opt_flow, plane_lidar, iris_foggy_lidar - do not start and give an error.

https://github.com/Andreykulachenko/catkin_ws/issues/1

Took me a while to this figure out but the sitl_target.cmake file that needs to be modified for step 5 has been moved to src/modules/simulation/simulator_mavlink/sitl_targets_gazebo.cmake in the current firmware

I use this way and make it

Hi all,

I’m attempting to create my own custom iris model in gazebo classic using px4 v1.14.3. My first step is to add 0.25m standoffs to the model which raise the entire vehicle up my 0.25m. Simple enough, or so I thought…

I’ve followed the instructions above:

  1. create my custom iris_with_standoffs.sdf
  2. navigate to PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/airframes and create a 4229_gazebo-classic_iris_with_standoffs file. I kept this airframe description identical to the default 10015_gazebo-classic_iris and also tried to add the following param:
  • param set-default CA_ROTOR*_PZ 0.25

  • the above is for rotors 0-3 to compensate for the new height, but this didn’t help.

  1. navigate to PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt and add my 4229_gazebo-classic_iris_with_standoffs to the px4_add_romfs_files() function

  2. navigate to PX4-Autopilot/ and run make px4_sitl_default gazebo-classic_iris_with_standoffs

Gazebo launches and the px4 shell doesn’t output any errors, but my model spawns in a state of chaos, bouncing around the world with all the links moving about.

Any help on what I can try to get this working?

Here’s my iris_with_standoffs.sdf, which spawns fine on it’s own in gazebo classic (i.e. out of the px4 sitl simulation). The only things that I’ve changed are the z poses of the links as well as the addition of cylindrical legs.

image

<!-- Base link -->
<link name='base_link'>
  <pose>0 0 0.25 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <inertial>
    <pose>0 0 0 0 0 0</pose>
    <mass>1.5</mass>
    <inertia>
      <ixx>0.029125</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>0.029125</iyy>
      <iyz>0</iyz>
      <izz>0.055225</izz>
    </inertia>
  </inertial>
  <collision name='base_link_inertia_collision'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <box>
        <size>0.47 0.47 0.11</size>
      </box>
    </geometry>
    <surface>
      <contact>
        <ode>
          <min_depth>0.001</min_depth>
          <max_vel>0</max_vel>
        </ode>
      </contact>
      <friction>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='base_link_inertia_visual'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <mesh>
        <scale>1 1 1</scale>
        <uri>model://iris/meshes/iris.stl</uri>
      </mesh>
    </geometry>
    <material>
      <script>
        <name>Gazebo/DarkGrey</name>
        <uri>file://media/materials/scripts/gazebo.material</uri>
      </script>
    </material>
  </visual>
  <gravity>1</gravity>
  <velocity_decay/>
</link>

<!--IMU link-->
<link name='/imu_link'>
  <pose>0 0 0.27 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <inertial>
    <pose>0 0 0 0 0 0</pose>
    <mass>0.015</mass>
    <inertia>
      <ixx>1e-05</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>1e-05</iyy>
      <iyz>0</iyz>
      <izz>1e-05</izz>
    </inertia>
  </inertial>
</link>
<joint name='/imu_joint' type='revolute'>
  <child>/imu_link</child>
  <parent>base_link</parent>
  <axis>
    <xyz>1 0 0</xyz>
    <limit>
      <lower>0</lower>
      <upper>0</upper>
      <effort>0</effort>
      <velocity>0</velocity>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>

<!-- Rotors -->
<link name='rotor_0'>
  <pose>0.13 -0.22 0.273 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <inertial>
    <pose>0 0 0 0 0 0</pose>
    <mass>0.005</mass>
    <inertia>
      <ixx>9.75e-07</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>0.000273104</iyy>
      <iyz>0</iyz>
      <izz>0.000274004</izz>
    </inertia>
  </inertial>
  <collision name='rotor_0_collision'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <cylinder>
        <length>0.005</length>
        <radius>0.128</radius>
      </cylinder>
    </geometry>
    <surface>
      <contact>
        <ode/>
      </contact>
      <friction>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='rotor_0_visual'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <mesh>
        <scale>1 1 1</scale>
        <uri>model://iris/meshes/iris_prop_ccw.dae</uri>
      </mesh>
    </geometry>
    <material>
      <script>
        <name>Gazebo/Blue</name>
        <uri>file://media/materials/scripts/gazebo.material</uri>
      </script>
    </material>
  </visual>
  <gravity>1</gravity>
  <velocity_decay/>
</link>

<joint name='rotor_0_joint' type='revolute'>
  <child>rotor_0</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <lower>-1e+16</lower>
      <upper>1e+16</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>

<link name='rotor_1'>
  <pose>-0.13 0.2 0.273 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <inertial>
    <pose>0 0 0 0 0 0</pose>
    <mass>0.005</mass>
    <inertia>
      <ixx>9.75e-07</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>0.000273104</iyy>
      <iyz>0</iyz>
      <izz>0.000274004</izz>
    </inertia>
  </inertial>
  <collision name='rotor_1_collision'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <cylinder>
        <length>0.005</length>
        <radius>0.128</radius>
      </cylinder>
    </geometry>
    <surface>
      <contact>
        <ode/>
      </contact>
      <friction>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='rotor_1_visual'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <mesh>
        <scale>1 1 1</scale>
        <uri>model://iris/meshes/iris_prop_ccw.dae</uri>
      </mesh>
    </geometry>
    <material>
      <script>
        <name>Gazebo/DarkGrey</name>
        <uri>file://media/materials/scripts/gazebo.material</uri>
      </script>
    </material>
  </visual>
  <gravity>1</gravity>
  <velocity_decay/>
</link>

<joint name='rotor_1_joint' type='revolute'>
  <child>rotor_1</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <lower>-1e+16</lower>
      <upper>1e+16</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>

<link name='rotor_2'>
  <pose>0.13 0.22 0.273 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <inertial>
    <pose>0 0 0 0 0 0</pose>
    <mass>0.005</mass>
    <inertia>
      <ixx>9.75e-07</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>0.000273104</iyy>
      <iyz>0</iyz>
      <izz>0.000274004</izz>
    </inertia>
  </inertial>
  <collision name='rotor_2_collision'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <cylinder>
        <length>0.005</length>
        <radius>0.128</radius>
      </cylinder>
    </geometry>
    <surface>
      <contact>
        <ode/>
      </contact>
      <friction>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='rotor_2_visual'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <mesh>
        <scale>1 1 1</scale>
        <uri>model://iris/meshes/iris_prop_cw.dae</uri>
      </mesh>
    </geometry>
    <material>
      <script>
        <name>Gazebo/Blue</name>
        <uri>file://media/materials/scripts/gazebo.material</uri>
      </script>
    </material>
  </visual>
  <gravity>1</gravity>
  <velocity_decay/>
</link>

<joint name='rotor_2_joint' type='revolute'>
  <child>rotor_2</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <lower>-1e+16</lower>
      <upper>1e+16</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>

<link name='rotor_3'>
  <pose>-0.13 -0.2 0.273 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <inertial>
    <pose>0 0 0 0 0 0</pose>
    <mass>0.005</mass>
    <inertia>
      <ixx>9.75e-07</ixx>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyy>0.000273104</iyy>
      <iyz>0</iyz>
      <izz>0.000274004</izz>
    </inertia>
  </inertial>
  <collision name='rotor_3_collision'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <cylinder>
        <length>0.005</length>
        <radius>0.128</radius>
      </cylinder>
    </geometry>
    <surface>
      <contact>
        <ode/>
      </contact>
      <friction>
        <ode/>
      </friction>
    </surface>
  </collision>
  <visual name='rotor_3_visual'>
    <pose>0 0 0 0 0 0</pose>
    <geometry>
      <mesh>
        <scale>1 1 1</scale>
        <uri>model://iris/meshes/iris_prop_cw.dae</uri>
      </mesh>
    </geometry>
    <material>
      <script>
        <name>Gazebo/DarkGrey</name>
        <uri>file://media/materials/scripts/gazebo.material</uri>
      </script>
    </material>
  </visual>
  <gravity>1</gravity>
  <velocity_decay/>
</link>

<joint name='rotor_3_joint' type='revolute'>
  <child>rotor_3</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <lower>-1e+16</lower>
      <upper>1e+16</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>

<!-- Add standoffs -->
<link name='leg_0'>
    <pose>0.13 -0.22 0.125 0 0 0</pose>
    <collision name='collision'>
      <geometry>
        <cylinder>
          <length>0.25</length>
          <radius>0.01</radius>
        </cylinder>
      </geometry>
    </collision>

    <visual name='visual'>
      <geometry>
        <cylinder>
          <length>0.25</length>
          <radius>0.01</radius>
        </cylinder>
      </geometry>
      <material>
        <script>
          <name>Gazebo/Grey</name>
          <uri>file://media/materials/scripts/gazebo.material</uri>
        </script>
      </material>
    </visual>
  </link>

  <joint name='leg_0_joint' type='fixed'>
    <child>leg_0</child>
    <parent>base_link</parent>
    <axis>
      <xyz>0 0 0</xyz>
      <limit>
        <lower>0</lower>
        <upper>0</upper>
      </limit>
      <dynamics>
        <spring_reference>0</spring_reference>
        <spring_stiffness>0</spring_stiffness>
      </dynamics>
      <use_parent_model_frame>1</use_parent_model_frame>
    </axis>
  </joint>

  <link name='leg_1'>
    <pose>-0.13 0.2 0.125 0 0 0</pose>
    
    <collision name='collision'>
      <geometry>
        <cylinder>
          <length>0.25</length>
          <radius>0.01</radius>
        </cylinder>
      </geometry>
    </collision>

    <visual name='visual'>
      <geometry>
        <cylinder>
          <length>0.25</length>
          <radius>0.01</radius>
        </cylinder>
      </geometry>
      <material>
        <script>
          <name>Gazebo/Grey</name>
          <uri>file://media/materials/scripts/gazebo.material</uri>
        </script>
      </material>
    </visual>
  </link>

<joint name='leg_1_joint' type='fixed'>
  <child>leg_1</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 0</xyz>
    <limit>
      <lower>0</lower>
      <upper>0</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>    

<link name='leg_2'>
  <pose>0.13 0.22 0.125 0 0 0</pose>
  
  <collision name='collision'>
    <geometry>
      <cylinder>
        <length>0.25</length>
        <radius>0.01</radius>
      </cylinder>
    </geometry>
  </collision>

  <visual name='visual'>
    <geometry>
      <cylinder>
        <length>0.25</length>
        <radius>0.01</radius>
      </cylinder>
    </geometry>
    <material>
        <script>
          <name>Gazebo/Grey</name>
          <uri>file://media/materials/scripts/gazebo.material</uri>
        </script>
    </material>
  </visual>
</link>

<joint name='leg_2_joint' type='fixed'>
  <child>leg_2</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 0</xyz>
    <limit>
      <lower>0</lower>
      <upper>0</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>

<link name='leg_3'>
  <pose>-0.13 -0.2 0.125 0 0 0</pose>
  
  <collision name='collision'>
    <geometry>
      <cylinder>
        <length>0.25</length>
        <radius>0.01</radius>
      </cylinder>
    </geometry>
  </collision>

  <visual name='visual'>
    <geometry>
      <cylinder>
        <length>0.25</length>
        <radius>0.01</radius>
      </cylinder>
    </geometry>
    <material>
        <script>
          <name>Gazebo/Grey</name>
          <uri>file://media/materials/scripts/gazebo.material</uri>
        </script>
    </material>
  </visual>
</link>

<joint name='leg_3_joint' type='fixed'>
  <child>leg_3</child>
  <parent>base_link</parent>
  <axis>
    <xyz>0 0 0</xyz>
    <limit>
      <lower>0</lower>
      <upper>0</upper>
    </limit>
    <dynamics>
      <spring_reference>0</spring_reference>
      <spring_stiffness>0</spring_stiffness>
    </dynamics>
    <use_parent_model_frame>1</use_parent_model_frame>
  </axis>
</joint>


<!--PX4 Plugins-->
<plugin name='rosbag' filename='libgazebo_multirotor_base_plugin.so'>
  <robotNamespace/>
  <linkName>base_link</linkName>
  <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
</plugin>
<plugin name='front_right_motor_model' filename='libgazebo_motor_model.so'>
  <robotNamespace/>
  <jointName>rotor_0_joint</jointName>
  <linkName>rotor_0</linkName>
  <turningDirection>ccw</turningDirection>
  <timeConstantUp>0.0125</timeConstantUp>
  <timeConstantDown>0.025</timeConstantDown>
  <maxRotVelocity>1100</maxRotVelocity>
  <motorConstant>5.84e-06</motorConstant>
  <momentConstant>0.06</momentConstant>
  <commandSubTopic>/gazebo/command/motor_speed</commandSubTopic>
  <motorNumber>0</motorNumber>
  <rotorDragCoefficient>0.000175</rotorDragCoefficient>
  <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
  <motorSpeedPubTopic>/motor_speed/0</motorSpeedPubTopic>
  <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
</plugin>
<plugin name='back_left_motor_model' filename='libgazebo_motor_model.so'>
  <robotNamespace/>
  <jointName>rotor_1_joint</jointName>
  <linkName>rotor_1</linkName>
  <turningDirection>ccw</turningDirection>
  <timeConstantUp>0.0125</timeConstantUp>
  <timeConstantDown>0.025</timeConstantDown>
  <maxRotVelocity>1100</maxRotVelocity>
  <motorConstant>5.84e-06</motorConstant>
  <momentConstant>0.06</momentConstant>
  <commandSubTopic>/gazebo/command/motor_speed</commandSubTopic>
  <motorNumber>1</motorNumber>
  <rotorDragCoefficient>0.000175</rotorDragCoefficient>
  <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
  <motorSpeedPubTopic>/motor_speed/1</motorSpeedPubTopic>
  <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
</plugin>
<plugin name='front_left_motor_model' filename='libgazebo_motor_model.so'>
  <robotNamespace/>
  <jointName>rotor_2_joint</jointName>
  <linkName>rotor_2</linkName>
  <turningDirection>cw</turningDirection>
  <timeConstantUp>0.0125</timeConstantUp>
  <timeConstantDown>0.025</timeConstantDown>
  <maxRotVelocity>1100</maxRotVelocity>
  <motorConstant>5.84e-06</motorConstant>
  <momentConstant>0.06</momentConstant>
  <commandSubTopic>/gazebo/command/motor_speed</commandSubTopic>
  <motorNumber>2</motorNumber>
  <rotorDragCoefficient>0.000175</rotorDragCoefficient>
  <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
  <motorSpeedPubTopic>/motor_speed/2</motorSpeedPubTopic>
  <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
</plugin>
<plugin name='back_right_motor_model' filename='libgazebo_motor_model.so'>
  <robotNamespace/>
  <jointName>rotor_3_joint</jointName>
  <linkName>rotor_3</linkName>
  <turningDirection>cw</turningDirection>
  <timeConstantUp>0.0125</timeConstantUp>
  <timeConstantDown>0.025</timeConstantDown>
  <maxRotVelocity>1100</maxRotVelocity>
  <motorConstant>5.84e-06</motorConstant>
  <momentConstant>0.06</momentConstant>
  <commandSubTopic>/gazebo/command/motor_speed</commandSubTopic>
  <motorNumber>3</motorNumber>
  <rotorDragCoefficient>0.000175</rotorDragCoefficient>
  <rollingMomentCoefficient>1e-06</rollingMomentCoefficient>
  <motorSpeedPubTopic>/motor_speed/3</motorSpeedPubTopic>
  <rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>
</plugin>

<!--GPS link, includes its own GPS plugin-->
<include>
  <uri>model://gps</uri>
  <pose>0.05 0 0.29 0 0 0</pose> <!--add 0.25cm to z-direction due to 0.25cm legs-->
  <name>gps0</name>
</include>
<joint name='gps0_joint' type='fixed'>
  <child>gps0::link</child>
  <parent>base_link</parent>
</joint>

<plugin name='groundtruth_plugin' filename='libgazebo_groundtruth_plugin.so'>
  <robotNamespace/>
</plugin>
<plugin name='magnetometer_plugin' filename='libgazebo_magnetometer_plugin.so'>
  <robotNamespace/>
  <pubRate>100</pubRate>
  <noiseDensity>0.0004</noiseDensity>
  <randomWalk>6.4e-06</randomWalk>
  <biasCorrelationTime>600</biasCorrelationTime>
  <magTopic>/mag</magTopic>
</plugin>
<plugin name='barometer_plugin' filename='libgazebo_barometer_plugin.so'>
  <robotNamespace/>
  <pubRate>50</pubRate>
  <baroTopic>/baro</baroTopic>
  <baroDriftPaPerSec>0</baroDriftPaPerSec>
</plugin>
<plugin name='mavlink_interface' filename='libgazebo_mavlink_interface.so'>
  <robotNamespace/>
  <imuSubTopic>/imu</imuSubTopic>
  <magSubTopic>/mag</magSubTopic>
  <baroSubTopic>/baro</baroSubTopic>
  <mavlink_addr>INADDR_ANY</mavlink_addr>
  <mavlink_tcp_port>4560</mavlink_tcp_port>
  <mavlink_udp_port>14560</mavlink_udp_port>
  <serialEnabled>0</serialEnabled>
  <serialDevice>/dev/ttyACM0</serialDevice>
  <baudRate>921600</baudRate>
  <qgc_addr>INADDR_ANY</qgc_addr>
  <qgc_udp_port>14550</qgc_udp_port>
  <sdk_addr>INADDR_ANY</sdk_addr>
  <sdk_udp_port>14540</sdk_udp_port>
  <hil_mode>0</hil_mode>
  <hil_state_level>0</hil_state_level>
  <send_vision_estimation>0</send_vision_estimation>
  <send_odometry>1</send_odometry>
  <enable_lockstep>1</enable_lockstep>
  <use_tcp>1</use_tcp>
  <motorSpeedCommandPubTopic>/gazebo/command/motor_speed</motorSpeedCommandPubTopic>
  <control_channels>
    <channel name='rotor1'>
      <input_index>0</input_index>
      <input_offset>0</input_offset>
      <input_scaling>1000</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>100</zero_position_armed>
      <joint_control_type>velocity</joint_control_type>
    </channel>
    <channel name='rotor2'>
      <input_index>1</input_index>
      <input_offset>0</input_offset>
      <input_scaling>1000</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>100</zero_position_armed>
      <joint_control_type>velocity</joint_control_type>
    </channel>
    <channel name='rotor3'>
      <input_index>2</input_index>
      <input_offset>0</input_offset>
      <input_scaling>1000</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>100</zero_position_armed>
      <joint_control_type>velocity</joint_control_type>
    </channel>
    <channel name='rotor4'>
      <input_index>3</input_index>
      <input_offset>0</input_offset>
      <input_scaling>1000</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>100</zero_position_armed>
      <joint_control_type>velocity</joint_control_type>
    </channel>
    <channel name='rotor5'>
      <input_index>4</input_index>
      <input_offset>1</input_offset>
      <input_scaling>324.6</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>0</zero_position_armed>
      <joint_control_type>velocity</joint_control_type>
      <joint_control_pid>
        <p>0.1</p>
        <i>0</i>
        <d>0</d>
        <iMax>0.0</iMax>
        <iMin>0.0</iMin>
        <cmdMax>2</cmdMax>
        <cmdMin>-2</cmdMin>
      </joint_control_pid>
      <joint_name>zephyr_delta_wing::propeller_joint</joint_name>
    </channel>
    <channel name='rotor6'>
      <input_index>5</input_index>
      <input_offset>0</input_offset>
      <input_scaling>0.524</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>0</zero_position_armed>
      <joint_control_type>position</joint_control_type>
      <joint_name>zephyr_delta_wing::flap_left_joint</joint_name>
      <joint_control_pid>
        <p>10.0</p>
        <i>0</i>
        <d>0</d>
        <iMax>0</iMax>
        <iMin>0</iMin>
        <cmdMax>20</cmdMax>
        <cmdMin>-20</cmdMin>
      </joint_control_pid>
    </channel>
    <channel name='rotor7'>
      <input_index>6</input_index>
      <input_offset>0</input_offset>
      <input_scaling>0.524</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>0</zero_position_armed>
      <joint_control_type>position</joint_control_type>
      <joint_name>zephyr_delta_wing::flap_right_joint</joint_name>
      <joint_control_pid>
        <p>10.0</p>
        <i>0</i>
        <d>0</d>
        <iMax>0</iMax>
        <iMin>0</iMin>
        <cmdMax>20</cmdMax>
        <cmdMin>-20</cmdMin>
      </joint_control_pid>
    </channel>
    <channel name='rotor8'>
      <input_index>7</input_index>
      <input_offset>0</input_offset>
      <input_scaling>0.524</input_scaling>
      <zero_position_disarmed>0</zero_position_disarmed>
      <zero_position_armed>0</zero_position_armed>
      <joint_control_type>position</joint_control_type>
    </channel>
  </control_channels>
</plugin>
<static>0</static>
<plugin name='rotors_gazebo_imu_plugin' filename='libgazebo_imu_plugin.so'>
  <robotNamespace/>
  <linkName>/imu_link</linkName>
  <imuTopic>/imu</imuTopic>
  <gyroscopeNoiseDensity>0.00018665</gyroscopeNoiseDensity>
  <gyroscopeRandomWalk>3.8785e-05</gyroscopeRandomWalk>
  <gyroscopeBiasCorrelationTime>1000.0</gyroscopeBiasCorrelationTime>
  <gyroscopeTurnOnBiasSigma>0.0087</gyroscopeTurnOnBiasSigma>
  <accelerometerNoiseDensity>0.00186</accelerometerNoiseDensity>
  <accelerometerRandomWalk>0.006</accelerometerRandomWalk>
  <accelerometerBiasCorrelationTime>300.0</accelerometerBiasCorrelationTime>
  <accelerometerTurnOnBiasSigma>0.196</accelerometerTurnOnBiasSigma>
</plugin>

So if you increase this value by the amount you’ve raised iris by, it should load properly

thanks for the suggestion @pyromania99. Unfortunately this does not seem to solve my problem.

I actually tried, in addition, to simply remove all collisions on the base_link, rotors and the legs and I still have the vehicle spawning in chaos and bouncing around the world.

Any more ideas?

It would be easiest to simply modify the iris.stl file in something like blender ,rather than have seperate bodies for the standoffs, assuming your standoffs are fixed and don’t move.

Still, try loading the model into gazebo independently, and modify the sdf , a good measure that worked for me was pausing the simulation, raising the model above ground and then play. This was good for checking the collision box size visually. Once you have your entire model above ground , you shouldn’t have any problems with SITL

The chaos and bouncing is usually because the model spawns in the ground

Do you mean outside of the px4 sitl environment?

My sdf loads without issue if I launch gazebo and then add the sdf manually. The screen grab I included in my previous comment is from that scenario.