Hi,
I am new to ArduPilot and am having some issues setting up a follow scenario in a SITL configuration. I am running two ArduCopters in a Docker container and controlling them via MAVProxy and QGroundControl. Here’s how I launch my simulation to successfully simulate two drones:
Drone 1 Setup
For Drone 1 SITL:
cd ardupilot
sudo docker run --network host -it --rm -v $PWD:/ardupilot ardupilot-dev bash -c "cd ArduCopter && sim_vehicle.py -v ArduCopter -I0 --sysid 1 --console --map --out=udp:127.0.0.1:14550 -w"
For Drone 1 MAVProxy:
cd ardupilot
mavproxy.py --master=udp:127.0.0.1:14550
output add 127.0.0.1:14560
Drone 2 Setup
For Drone 2 SITL:
cd ardupilot
sudo docker run --network host -it --rm -v $PWD:/ardupilot ardupilot-dev bash -c "cd ArduCopter && sim_vehicle.py -v ArduCopter -I1 --sysid 2 --console --map --out=udp:127.0.0.1:14551 -w"
For Drone 2 MAVProxy:
cd ardupilot
mavproxy.py --master=udp:127.0.0.1:14551
output add 127.0.0.1:14560
To set up for Drone 2 following Drone 1, I created ardupilot/ArduCopter/scripts/modules/MAVLink and pulled Lua from the ArduPilot repo
On Drone 1, I run param set SCR_ENABLE 1, then a reboot, and after rebooting, I see it successfully load follow-target-send.lua. I can also watch FOLLOW_TARGET and see data moving. I then run param set FOLT_ENABLE 1, set mode to guided, takeoff, and move to some other position. On Drone 2, I run param set FOLL_ENABLE 1 and param set FOLL_SYSID 1.
The issue I have not been able to solve is how I set up the networking, such that the follow target data is transferred to Drone 2. I have tried adding an additional output to Drone 1’s MAVProxy and an additional master to Drone 2’s MAVProxy (or adding an additional output to Drone 1’s SITL launcher). However, I am never able to get Drone 2 to follow Drone 1.
If anyone could provide some information on this topic, it would be greatly appreciated.
