2018-02-09 14:40:38 -04:00
|
|
|
<?xml version="1.0"?>
|
2017-05-13 16:51:46 -03:00
|
|
|
<launch>
|
|
|
|
<!-- Posix SITL environment launch script -->
|
2018-02-09 14:40:38 -04:00
|
|
|
<!-- launchs PX4 SITL and spawns vehicle -->
|
|
|
|
<!-- vehicle pose -->
|
2017-05-13 16:51:46 -03:00
|
|
|
<arg name="x" default="0"/>
|
|
|
|
<arg name="y" default="0"/>
|
|
|
|
<arg name="z" default="0"/>
|
|
|
|
<arg name="R" default="0"/>
|
|
|
|
<arg name="P" default="0"/>
|
|
|
|
<arg name="Y" default="0"/>
|
2020-08-10 17:50:55 -03:00
|
|
|
<!-- vehicle model and config -->
|
2018-01-01 00:21:44 -04:00
|
|
|
<arg name="est" default="ekf2"/>
|
2017-05-13 16:51:46 -03:00
|
|
|
<arg name="vehicle" default="iris"/>
|
|
|
|
<arg name="ID" default="1"/>
|
2018-08-11 13:02:12 -03:00
|
|
|
<env name="PX4_SIM_MODEL" value="$(arg vehicle)" />
|
|
|
|
<env name="PX4_ESTIMATOR" value="$(arg est)" />
|
2018-02-09 14:40:38 -04:00
|
|
|
<arg name="mavlink_udp_port" default="14560"/>
|
2019-02-17 03:24:00 -04:00
|
|
|
<arg name="mavlink_tcp_port" default="4560"/>
|
2021-01-08 14:29:47 -04:00
|
|
|
<arg name="gst_udp_port" default="5600"/>
|
|
|
|
<arg name="video_uri" default="5600"/>
|
|
|
|
<arg name="mavlink_cam_udp_port" default="14530"/>
|
2021-01-12 09:41:41 -04:00
|
|
|
<arg name="mavlink_id" value="$(eval 1 + arg('ID'))" />
|
2018-06-14 13:37:47 -03:00
|
|
|
<!-- PX4 configs -->
|
|
|
|
<arg name="interactive" default="true"/>
|
2020-10-12 04:33:51 -03:00
|
|
|
<!-- generate sdf vehicle model -->
|
2021-01-12 09:41:41 -04:00
|
|
|
<arg name="cmd" default="$(find mavlink_sitl_gazebo)/scripts/jinja_gen.py --stdout --mavlink_id=$(arg mavlink_id) --mavlink_udp_port=$(arg mavlink_udp_port) --mavlink_tcp_port=$(arg mavlink_tcp_port) --gst_udp_port=$(arg gst_udp_port) --video_uri=$(arg video_uri) --mavlink_cam_udp_port=$(arg mavlink_cam_udp_port) $(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf.jinja $(find mavlink_sitl_gazebo)"/>
|
2020-10-12 04:33:51 -03:00
|
|
|
<param command="$(arg cmd)" name="sdf_$(arg vehicle)$(arg ID)"/>
|
2018-02-09 14:40:38 -04:00
|
|
|
<!-- PX4 SITL -->
|
2018-06-14 13:37:47 -03:00
|
|
|
<arg unless="$(arg interactive)" name="px4_command_arg1" value=""/>
|
|
|
|
<arg if="$(arg interactive)" name="px4_command_arg1" value="-d"/>
|
2020-09-10 08:33:29 -03:00
|
|
|
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS -i $(arg ID) -w sitl_$(arg vehicle)_$(arg ID) $(arg px4_command_arg1)">
|
2017-05-13 16:51:46 -03:00
|
|
|
</node>
|
2018-02-09 14:40:38 -04:00
|
|
|
<!-- spawn vehicle -->
|
2020-10-12 04:33:51 -03:00
|
|
|
<node name="$(anon vehicle_spawn)" pkg="gazebo_ros" type="spawn_model" output="screen" args="-sdf -param sdf_$(arg vehicle)$(arg ID) -model $(arg vehicle)$(arg ID) -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg R) -P $(arg P) -Y $(arg Y)"/>
|
2017-05-13 16:51:46 -03:00
|
|
|
</launch>
|