Error mgs during multi vehicle simulation

I followed the instruction as mentioned here:-
https://dev.px4.io/en/simulation/multi-vehicle-simulation.html
when I run launch file

roslaunch px4 multi_uav_mavros_sitl.launch

works fine for default programme but when I added code for one more drone (UAV1 iris_3) and run

roslaunch px4 multi_uav_mavros_sitl.launch

I get following error message although I can see UAVs in Gazebo simulator.

[multi_uav_mavros_sitl.launch] is neither a launch file in package [px4] nor is [px4] a launch file name
The traceback for the exception was written to the log file.

here is the code which I added for 3rd UAV inside launch file:-

<group ns="uav3">
    <arg name="fcu_url" default="udp://:14543@localhost:14558"/>
    <arg name="gcs_url" value=""/>
    <arg name="tgt_system" value="3"/> 
    <arg name="tgt_component" value="1"/>
    <arg name="rcS3" default="$(find px4)/posix-configs/SITL/init/$(arg est)/$(arg vehicle)_3"/>
    <arg name="ID" value="3"/>
    <include file="$(find px4)/launch/single_vehcile_spawn.launch">
        <arg name="x" value="1"/>
        <arg name="y" value="1"/>
        <arg name="z" value="0"/>
        <arg name="R" value="0"/>
        <arg name="P" value="0"/>
        <arg name="Y" value="0"/>
        <arg name="vehicle" value="$(arg vehicle)"/>
        <arg name="rcS" value="$(arg rcS3)"/>
        <arg name="mavlink_udp_port" value="14563"/>
        <arg name="ID" value="$(arg ID)"/>
    </include>

    <include file="$(find mavros)/launch/node.launch">
        <arg name="pluginlists_yaml" value="$(arg pluginlists_yaml)" />
        <arg name="config_yaml" value="$(arg config_yaml)" />

        <arg name="fcu_url" value="$(arg fcu_url)" />
        <arg name="gcs_url" value="$(arg gcs_url)" />
        <arg name="tgt_system" value="$(arg tgt_system)" />
        <arg name="tgt_component" value="$(arg tgt_component)" />
    </include>
</group>

I don’t know the reason but If I run that command inside firmware directory It runs successfully and other than that It gives that error

If you can fully describe how you setup your environment and try this with the current launch file on the master branch, I can try to figure this out.

I installed px4:-

mkdir -p ~/src
cd ~/src
git clone https://github.com/PX4/Firmware.git
cd Firmware
git submodule update --init --recursive

I run updated launch file. It runs inside Firmware directory but gives the same error if I try to run from different directories.

What did you do after that code snippet? i.e between git submodule update --init --recursive and roslaunch px4 multi_uav_mavros_sitl.launch, source and setting env variable commands?

Yes, I source the env and set variable every time before I run launch file.

I can’t reproduce this without a complete list of the commands you’re using.

Here is what I am doing which works fine:

cd Firmware_clone
git submodule update --init --recursive
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd):$(pwd)/Tools/sitl_gazebo
roslaunch px4 multi_uav_mavros_sitl.launch

but I run the last command (launch file) even for 2 UAV (default case) from other the directory I am getting that error.

Did you build SITL?

cd Firmware_clone
git submodule update --init --recursive

> make posix_sitl_default sitl_gazebo`

source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd):$(pwd)/Tools/sitl_gazebo
roslaunch px4 multi_uav_mavros_sitl.launch

Yes tried with building SITL.

Actually, according to https://github.com/PX4/Devguide/pull/473 you need both these lines because the sitl_gazebo target doesn’t build SITL itself.

make posix_sitl_default
make posix_sitl_default sitl_gazebo

I run complete sequence of command this time including both commands (suggested by you) but got same problem and for

make posix_sitl_default

I got

ninja: no work to do.