SITL gz make airframes simulator specific
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# @name Gazebo x500 depth
|
||||
#
|
||||
# @type Quadrotor
|
||||
#
|
||||
|
||||
. ${R}etc/init.d/rc.mc_defaults
|
||||
|
||||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz}
|
||||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default}
|
||||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=x500_depth}
|
||||
|
||||
param set-default CA_AIRFRAME 0
|
||||
param set-default CA_ROTOR_COUNT 4
|
||||
|
||||
param set-default CA_ROTOR0_PX 0.13
|
||||
param set-default CA_ROTOR0_PY 0.22
|
||||
param set-default CA_ROTOR0_KM 0.05
|
||||
|
||||
param set-default CA_ROTOR1_PX -0.13
|
||||
param set-default CA_ROTOR1_PY -0.20
|
||||
param set-default CA_ROTOR1_KM 0.05
|
||||
|
||||
param set-default CA_ROTOR2_PX 0.13
|
||||
param set-default CA_ROTOR2_PY -0.22
|
||||
param set-default CA_ROTOR2_KM -0.05
|
||||
|
||||
param set-default CA_ROTOR3_PX -0.13
|
||||
param set-default CA_ROTOR3_PY 0.20
|
||||
param set-default CA_ROTOR3_KM -0.05
|
||||
|
||||
param set-default SIM_GZ_FUNC1 101
|
||||
param set-default SIM_GZ_FUNC2 102
|
||||
param set-default SIM_GZ_FUNC3 103
|
||||
param set-default SIM_GZ_FUNC4 104
|
||||
|
||||
param set-default SIM_GZ_MIN1 150
|
||||
param set-default SIM_GZ_MIN2 150
|
||||
param set-default SIM_GZ_MIN3 150
|
||||
param set-default SIM_GZ_MIN4 150
|
||||
|
||||
param set-default SIM_GZ_MAX1 1000
|
||||
param set-default SIM_GZ_MAX2 1000
|
||||
param set-default SIM_GZ_MAX3 1000
|
||||
param set-default SIM_GZ_MAX4 1000
|
||||
|
||||
param set-default MPC_THR_HOVER 0.60
|
|
@ -72,7 +72,8 @@ px4_add_romfs_files(
|
|||
3010_jsbsim_quadrotor_x
|
||||
3011_jsbsim_hexarotor_x
|
||||
|
||||
4001_x500
|
||||
4001_gz_x500
|
||||
4002_gz_x500_depth
|
||||
|
||||
2507_cloudship
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ if [ "$PX4_SIMULATOR" = "sihsim" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "0"
|
|||
|
||||
elif [ "$PX4_SIMULATOR" = "gz" ]; then
|
||||
|
||||
# source generated gazebo_env.sh for IGN_GAZEBO_RESOURCE_PATH
|
||||
if [ -f ./gazebo_env.sh ]; then
|
||||
. ./gazebo_env.sh
|
||||
# source generated gz_env.sh for IGN_GAZEBO_RESOURCE_PATH
|
||||
if [ -f ./gz_env.sh ]; then
|
||||
. ./gz_env.sh
|
||||
|
||||
elif [ -f ../gazebo_env.sh ]; then
|
||||
. ../gazebo_env.sh
|
||||
elif [ -f ../gz_env.sh ]; then
|
||||
. ../gz_env.sh
|
||||
fi
|
||||
|
||||
# "gz sim" only avaiilable in Garden and later
|
||||
|
@ -111,7 +111,7 @@ elif [ "$PX4_SIMULATOR" = "gz" ]; then
|
|||
|
||||
echo "WARN [init] PX4_GZ_MODEL_NAME or PX4_GZ_MODEL not set using PX4_SIM_MODEL."
|
||||
|
||||
if gz_bridge start -m "${PX4_SIM_MODEL}" -w "${PX4_GZ_WORLD}" -i "${px4_instance}"; then
|
||||
if gz_bridge start -m "${PX4_SIM_MODEL#*gz_}" -w "${PX4_GZ_WORLD}" -i "${px4_instance}"; then
|
||||
sensor_baro_sim start
|
||||
sensor_gps_sim start
|
||||
sensor_mag_sim start
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<model>
|
||||
<name>x500-NoPlugin</name>
|
||||
<version>1.0</version>
|
||||
<sdf version="1.9">model.sdf</sdf>
|
||||
<author>
|
||||
<name>Benjamin Perseghetti</name>
|
||||
<email>bperseghetti@rudislabs.com</email>
|
||||
</author>
|
||||
<description>Model of the NXP HoverGames Drone development kit (KIT-HGDRONEK66). The PX4 software compatible kit provides mechanical, RC remote and other components needed to evaluate the RDDRONE-FMUK66 reference design. The FMU includes 100Base-T1 Automotive Ethernet, dual CAN transceivers, as well as SE050 secure element, and works with add on boards NavQPlus, MR-T1ETH8, MR-T1ADAPT, and CAN-nodes such as UCANS32K1SIC. Kit may be used with, and contains the components needed for the HoverGames.com coding challenges.</description>
|
||||
</model>
|
|
@ -1,516 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdf version='1.9'>
|
||||
<model name='x500-NoPlugin'>
|
||||
<pose>0 0 .24 0 0 0</pose>
|
||||
<self_collide>false</self_collide>
|
||||
<static>false</static>
|
||||
<link name="base_link">
|
||||
<inertial>
|
||||
<mass>2.0</mass>
|
||||
<inertia>
|
||||
<ixx>0.02166666666666667</ixx>
|
||||
<ixy>0</ixy>
|
||||
<ixz>0</ixz>
|
||||
<iyy>0.02166666666666667</iyy>
|
||||
<iyz>0</iyz>
|
||||
<izz>0.04000000000000001</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<gravity>true</gravity>
|
||||
<velocity_decay/>
|
||||
<visual name="base_link_visual">
|
||||
<pose>0 0 .025 0 0 3.141592654</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/NXP-HGD-CF.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_0">
|
||||
<pose>0.174 0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_1">
|
||||
<pose>-0.174 0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_2">
|
||||
<pose>0.174 -0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_3">
|
||||
<pose>-0.174 -0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="NXP_FMUK66_FRONT">
|
||||
<pose>0.047 .001 .043 1 0 1.57</pose>
|
||||
<cast_shadows>false</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>.013 .007</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<diffuse>1.0 1.0 1.0</diffuse>
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500-NoPlugin/materials/textures/nxp.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="NXP_FMUK66_TOP">
|
||||
<pose>-0.023 0 .0515 0 0 -1.57</pose>
|
||||
<cast_shadows>false</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>.013 .007</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<diffuse>1.0 1.0 1.0</diffuse>
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500-NoPlugin/materials/textures/nxp.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="RDDRONE_FMUK66_TOP">
|
||||
<pose>-.03 0 .0515 0 0 -1.57</pose>
|
||||
<cast_shadows>false</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>.032 .0034</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<diffuse>1.0 1.0 1.0</diffuse>
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500-NoPlugin/materials/textures/rd.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
</visual>
|
||||
<collision name="base_link_collision_0">
|
||||
<pose>0 0 .007 0 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.35355339059327373 0.35355339059327373 0.05</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_1">
|
||||
<pose>0 -0.098 -.123 -0.35 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.015 0.015 0.21</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_2">
|
||||
<pose>0 0.098 -.123 0.35 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.015 0.015 0.21</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_3">
|
||||
<pose>0 -0.132 -.2195 0 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.25 0.015 0.015</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_4">
|
||||
<pose>0 0.132 -.2195 0 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.25 0.015 0.015</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<sensor name="imu_sensor" type="imu">
|
||||
<always_on>1</always_on>
|
||||
<update_rate>250</update_rate>
|
||||
</sensor>
|
||||
</link>
|
||||
<link name="rotor_0">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>0.174 -0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_0_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_ccw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_0_visual_motor_bell">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_0_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_0_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_0</child>
|
||||
<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">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>-0.174 0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_1_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_ccw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_1_visual_motor_top">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_1_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_1_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_1</child>
|
||||
<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">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>0.174 0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_2_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_cw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_2_visual_motor_top">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_2_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_2_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_2</child>
|
||||
<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">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>-0.174 -0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_3_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/1345_prop_cw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_3_visual_motor_top">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500-NoPlugin/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_3_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_3_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_3</child>
|
||||
<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>
|
||||
</model>
|
||||
</sdf>
|
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
@ -1,10 +1,518 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sdf version='1.9'>
|
||||
<model name='x500'>
|
||||
<include merge='true'>
|
||||
<uri>model://x500-NoPlugin</uri>
|
||||
</include>
|
||||
<plugin filename="ignition-gazebo-multicopter-motor-model-system" name="ignition::gazebo::systems::MulticopterMotorModel">
|
||||
<pose>0 0 .24 0 0 0</pose>
|
||||
<self_collide>false</self_collide>
|
||||
<static>false</static>
|
||||
<link name="base_link">
|
||||
<inertial>
|
||||
<mass>2.0</mass>
|
||||
<inertia>
|
||||
<ixx>0.02166666666666667</ixx>
|
||||
<ixy>0</ixy>
|
||||
<ixz>0</ixz>
|
||||
<iyy>0.02166666666666667</iyy>
|
||||
<iyz>0</iyz>
|
||||
<izz>0.04000000000000001</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<gravity>true</gravity>
|
||||
<velocity_decay/>
|
||||
<visual name="base_link_visual">
|
||||
<pose>0 0 .025 0 0 3.141592654</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/NXP-HGD-CF.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_0">
|
||||
<pose>0.174 0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_1">
|
||||
<pose>-0.174 0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_2">
|
||||
<pose>0.174 -0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="5010_motor_base_3">
|
||||
<pose>-0.174 -0.174 .032 0 0 -.45</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Base.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<visual name="NXP_FMUK66_FRONT">
|
||||
<pose>0.047 .001 .043 1 0 1.57</pose>
|
||||
<cast_shadows>false</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>.013 .007</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<diffuse>1.0 1.0 1.0</diffuse>
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500/materials/textures/nxp.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="NXP_FMUK66_TOP">
|
||||
<pose>-0.023 0 .0515 0 0 -1.57</pose>
|
||||
<cast_shadows>false</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>.013 .007</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<diffuse>1.0 1.0 1.0</diffuse>
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500/materials/textures/nxp.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="RDDRONE_FMUK66_TOP">
|
||||
<pose>-.03 0 .0515 0 0 -1.57</pose>
|
||||
<cast_shadows>false</cast_shadows>
|
||||
<geometry>
|
||||
<plane>
|
||||
<normal>0 0 1</normal>
|
||||
<size>.032 .0034</size>
|
||||
</plane>
|
||||
</geometry>
|
||||
<material>
|
||||
<diffuse>1.0 1.0 1.0</diffuse>
|
||||
<specular>1.0 1.0 1.0</specular>
|
||||
<pbr>
|
||||
<metal>
|
||||
<albedo_map>model://x500/materials/textures/rd.png</albedo_map>
|
||||
</metal>
|
||||
</pbr>
|
||||
</material>
|
||||
</visual>
|
||||
<collision name="base_link_collision_0">
|
||||
<pose>0 0 .007 0 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.35355339059327373 0.35355339059327373 0.05</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_1">
|
||||
<pose>0 -0.098 -.123 -0.35 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.015 0.015 0.21</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_2">
|
||||
<pose>0 0.098 -.123 0.35 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.015 0.015 0.21</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_3">
|
||||
<pose>0 -0.132 -.2195 0 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.25 0.015 0.015</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<collision name="base_link_collision_4">
|
||||
<pose>0 0.132 -.2195 0 0 0</pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.25 0.015 0.015</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
<sensor name="imu_sensor" type="imu">
|
||||
<always_on>1</always_on>
|
||||
<update_rate>250</update_rate>
|
||||
</sensor>
|
||||
</link>
|
||||
<link name="rotor_0">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>0.174 -0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_0_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500/meshes/1345_prop_ccw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_0_visual_motor_bell">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_0_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_0_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_0</child>
|
||||
<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">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>-0.174 0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_1_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500/meshes/1345_prop_ccw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_1_visual_motor_top">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_1_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_1_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_1</child>
|
||||
<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">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>0.174 0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_2_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500/meshes/1345_prop_cw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_2_visual_motor_top">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_2_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_2_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_2</child>
|
||||
<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">
|
||||
<gravity>true</gravity>
|
||||
<self_collide>false</self_collide>
|
||||
<velocity_decay/>
|
||||
<pose>-0.174 -0.174 0.06 0 0 0</pose>
|
||||
<inertial>
|
||||
<mass>0.016076923076923075</mass>
|
||||
<inertia>
|
||||
<ixx>3.8464910483993325e-07</ixx>
|
||||
<iyy>2.6115851691700804e-05</iyy>
|
||||
<izz>2.649858234714004e-05</izz>
|
||||
</inertia>
|
||||
</inertial>
|
||||
<visual name="rotor_3_visual">
|
||||
<pose>-0.022 -0.14638461538461536 -0.016 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>0.8461538461538461 0.8461538461538461 0.8461538461538461</scale>
|
||||
<uri>model://x500/meshes/1345_prop_cw.stl</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
<material>
|
||||
<script>
|
||||
<name>Gazebo/DarkGrey</name>
|
||||
<uri>file://media/materials/scripts/gazebo.material</uri>
|
||||
</script>
|
||||
</material>
|
||||
</visual>
|
||||
<visual name="rotor_3_visual_motor_top">
|
||||
<pose>0 0 -.032 0 0 0</pose>
|
||||
<geometry>
|
||||
<mesh>
|
||||
<scale>1 1 1</scale>
|
||||
<uri>model://x500/meshes/5010Bell.dae</uri>
|
||||
</mesh>
|
||||
</geometry>
|
||||
</visual>
|
||||
<collision name="rotor_3_collision">
|
||||
<pose>0 0 0 0 0 0 </pose>
|
||||
<geometry>
|
||||
<box>
|
||||
<size>0.2792307692307692 0.016923076923076923 0.0008461538461538462</size>
|
||||
</box>
|
||||
</geometry>
|
||||
<surface>
|
||||
<contact>
|
||||
<ode>
|
||||
<min_depth>0.001</min_depth>
|
||||
<max_vel>0</max_vel>
|
||||
</ode>
|
||||
</contact>
|
||||
<friction>
|
||||
<ode/>
|
||||
</friction>
|
||||
</surface>
|
||||
</collision>
|
||||
</link>
|
||||
<joint name="rotor_3_joint" type="revolute">
|
||||
<parent>base_link</parent>
|
||||
<child>rotor_3</child>
|
||||
<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>
|
||||
<plugin filename="ignition-gazebo-multicopter-motor-model-system" name="ignition::gazebo::systems::MulticopterMotorModel">
|
||||
<jointName>rotor_0_joint</jointName>
|
||||
<linkName>rotor_0</linkName>
|
||||
<turningDirection>ccw</turningDirection>
|
||||
|
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
@ -48,7 +48,7 @@ if(gz-transport_FOUND)
|
|||
|
||||
set(GZ_TRANSPORT_VER ${gz-transport_VERSION_MAJOR})
|
||||
|
||||
if (GZ_TRANSPORT_VER GREATER_EQUAL 12)
|
||||
if(GZ_TRANSPORT_VER GREATER_EQUAL 12)
|
||||
set(GZ_TRANSPORT_LIB gz-transport${GZ_TRANSPORT_VER}::core)
|
||||
else()
|
||||
set(GZ_TRANSPORT_LIB ignition-transport${GZ_TRANSPORT_VER}::core)
|
||||
|
@ -82,21 +82,74 @@ if(gz-transport_FOUND)
|
|||
${PX4_SOURCE_DIR}/Tools/simulation/gz/worlds/*.sdf
|
||||
)
|
||||
|
||||
# find corresponding airframes
|
||||
file(GLOB gz_airframes
|
||||
RELATIVE ${PX4_SOURCE_DIR}/ROMFS/px4fmu_common/init.d-posix/airframes
|
||||
${PX4_SOURCE_DIR}/ROMFS/px4fmu_common/init.d-posix/airframes/*_gz_*
|
||||
)
|
||||
|
||||
# remove any .post files
|
||||
foreach(gz_airframe IN LISTS gz_airframes)
|
||||
if(gz_airframe MATCHES ".post")
|
||||
list(REMOVE_ITEM gz_airframes ${gz_airframe})
|
||||
endif()
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES gz_airframes)
|
||||
|
||||
foreach(gz_airframe IN LISTS gz_airframes)
|
||||
set(model_only)
|
||||
string(REGEX REPLACE ".*_gz_" "" model_only ${gz_airframe})
|
||||
|
||||
if(EXISTS "${PX4_SOURCE_DIR}/Tools/simulation/gz/models/${model_only}")
|
||||
|
||||
if((EXISTS "${PX4_SOURCE_DIR}/Tools/simulation/gz/models/${model_only}/model.sdf"))
|
||||
#message(STATUS "Ignition SDF file found for ${model_only}")
|
||||
else()
|
||||
message(WARNING "Ignition no SDF file found for ${model_only}")
|
||||
endif()
|
||||
|
||||
else()
|
||||
message(WARNING "model directory ${PX4_SOURCE_DIR}/Tools/simulation/gz/models/${model_only} not found")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(model ${gz_models})
|
||||
|
||||
# match model to airframe
|
||||
set(airframe_model_only)
|
||||
set(airframe_sys_autostart)
|
||||
set(gz_airframe_found)
|
||||
foreach(gz_airframe IN LISTS gz_airframes)
|
||||
|
||||
string(REGEX REPLACE ".*_gz_" "" airframe_model_only ${gz_airframe})
|
||||
string(REGEX REPLACE "_gz_.*" "" airframe_sys_autostart ${gz_airframe})
|
||||
|
||||
if(model STREQUAL ${airframe_model_only})
|
||||
set(gz_airframe_found ${gz_airframe})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(gz_airframe_found)
|
||||
#message(STATUS "gz model: ${model} (${airframe_model_only}), airframe: ${gz_airframe_found}, SYS_AUTOSTART: ${airframe_sys_autostart}")
|
||||
else()
|
||||
message(WARNING "gz missing model: ${model} (${airframe_model_only}), airframe: ${gz_airframe_found}, SYS_AUTOSTART: ${airframe_sys_autostart}")
|
||||
endif()
|
||||
|
||||
foreach(world ${gz_worlds})
|
||||
|
||||
get_filename_component("world_name" ${world} NAME_WE)
|
||||
|
||||
if(world_name MATCHES "default")
|
||||
if(world_name STREQUAL "default")
|
||||
add_custom_target(gz_${model}
|
||||
COMMAND ${CMAKE_COMMAND} -E env PX4_SIM_MODEL=${model} $<TARGET_FILE:px4>
|
||||
COMMAND ${CMAKE_COMMAND} -E env PX4_SIM_MODEL=gz_${model} $<TARGET_FILE:px4>
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
USES_TERMINAL
|
||||
DEPENDS px4
|
||||
)
|
||||
else()
|
||||
add_custom_target(gz_${model}_${world_name}
|
||||
COMMAND ${CMAKE_COMMAND} -E env PX4_GZ_MODEL=${model} PX4_GZ_WORLD=${world_name} $<TARGET_FILE:px4>
|
||||
COMMAND ${CMAKE_COMMAND} -E env PX4_SIM_MODEL=gz_${model} PX4_SIM_WORLD=${world_name} $<TARGET_FILE:px4>
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
USES_TERMINAL
|
||||
DEPENDS px4
|
||||
|
@ -105,9 +158,7 @@ if(gz-transport_FOUND)
|
|||
endforeach()
|
||||
endforeach()
|
||||
|
||||
|
||||
# TODO: PX4_GZ_MODELS_PATH
|
||||
# PX4_GZ_WORLDS_PATH
|
||||
configure_file(gazebo_env.sh.in ${PX4_BINARY_DIR}/rootfs/gazebo_env.sh)
|
||||
# PX4_GZ_MODELS, PX4_GZ_WORLDS, GZ_SIM_RESOURCE_PATH
|
||||
configure_file(gz_env.sh.in ${PX4_BINARY_DIR}/rootfs/gz_env.sh)
|
||||
|
||||
endif()
|
||||
|
|