I refer to this URL:Multiple instances of PX4 SITL · Issue #6408 · PX4/PX4-Autopilot · GitHub
Here is my launch file posix_sitl_default
<!-- Start first instance of px4 and gazebo model-->
<group ns="uas1">
<include file="$(find px4)/launch/mylaunch.launch">
<arg name="name" value="uas1" />
<arg name="rcS" value="$(find px4)/posix-configs/SITL/init/lpe/iris1"/>
<arg name="fcu_url" default="udp://:14540@localhost:14557"/>
<arg name="x" value="0"/>
<arg name="y" value="0"/>
<arg name="z" value="0"/>
</include>
</group>
<!-- Start second instance of px4 and gazebo model-->
<group ns="uas2">
<include file="$(find px4)/launch/mylaunch.launch">
<arg name="name" value="uas2" />
<arg name="rcS" value="$(find px4)/posix-configs/SITL/init/lpe/iris2"/>
<arg name="fcu_url" default="udp://:14541@localhost:14559" />
<arg name="x" value="1"/>
<arg name="y" value="0"/>
<arg name="z" value="0"/>
</include>
</group>
here is my mylaunch file:
<arg name="est" default="lpe"/>
<arg name="vehicle" default="iris"/>
<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf"/>
<arg name="rcS" default="$(find px4)/posix-configs/SITL/init/$(arg est)/$(arg vehicle)"/>
<arg name="fcu_url" default="udp://:14540@localhost:14557"/>
<!-- px4 instance -->
<node name="sitl" pkg="px4" type="px4" output="screen" args="$(find px4) $(arg rcS)" />
<!-- load model in gazebo -->
<node name="$(anon vehicle_spawn)" output="screen" pkg="gazebo_ros" type="spawn_model"
args="-sdf -file $(arg sdf) -model $(arg name) -x $(arg x) -y $(arg y) -z $(arg z) -R 0 -P 0 -Y 0"/>
<!-- mavros instance for ROS communication -->
<include file="$(find mavros)/launch/px4.launch">
<arg name="fcu_url" value="$(arg fcu_url)" />
</include>
when i run posix_sitl_default,I can not receive Command Line(pxh)and i can communicate with them by roslaunch mavros px4.launch fcu_url:=“udp://:14540@127.0.0.1:14557”
Can anyone slove this problem?
best wishes!!