I am using PX4 software-in-the-loop app to simulate multi vehicles setup which I am able to complete.
For each simulated vehicle, there is a configuration file which defines the vehicle configurations/parameters, see this.
In the end of the configuration file, the mavlink instances and the streamed information are set, see this
According to those settings, there are three different UDP ports that are being set.
There is also another UDP port which allows external interface (e.g. with MAVROS) with the SITL which is defined by the
SITL_UDP_PRT parameter in this line.
My question is, why there are 3 different ports for the mavlink instance(s)? are they necessary? what are they used for?
These ports are namely 14556, 14557, 14540 .