Mavros multi-vehicle simulation
Hello,
I'm trying to setup a simulation environment for a multi-vehicle system using mavros and I have come up with some issues:
My idea is to run multiple APM SITL (Ardu Copter) instances, each of those connected to a mavros node via TCP (to simulate a serial connection of an onboard computer) and use UDP Mavlink bridge to connect all vehicles to QGroundControl.
1) APM_SITL <--(TCP:5760)--> mavros <--(UDP:14550/1)--> QGroundControl
I modified sim_vehicle.sh so that it doesn't directly launch mavproxy. Then I connect mavros via serial and use gcs_url to create the mavlink bridge to QGroundControl (listening on UDP 14550):
roslaunch mavros apm2.launch fcu_url:=tcp://localhost:5760 gcs_url:=udp://localhost:14551@localhost:14550
Doing this I'm able to see the vehicle in QGroundControl but for some reason the connection doesn't seem to work properly and I see no changes in the system when I run a mavros program.
When I do not disable mavproxy (that is, I run each SITL instance with mavproxy connected to TCP 5760) and connect QGroundControl via UDP, it works fine. But if I try to connect mavros via TCP (to one of the two other open serial ports 5762 or 5763) I get this same issue: https://groups.google.com/forum/#!topic/drones-discuss/I8sGdE-g8I0
2) mavros <--(TCP:5762)--> APM_SITL <--(TCP:5760)--> mavproxy <--(UDP:14550/1)--> QGroundControl
Another issue I'm encountering is the use of different system ID's. I can change the parameter in APM (SYSID_THISMAV) but don't really know how to use tgt_system and tgt_component
Any help is highly appreciated!