Hi everyone,
I’m currently working on a multi-UAV system using ArduPlane 4.7.0-dev and Gazebo Harmonic. I have two aircraft simulated: a leader and a follower. The follower is commanded to follow the leader’s position with a fixed delay using MAV_CMD_DO_REPOSITION commands sent via MAVLink (COMMAND_INT, frame = MAV_FRAME_GLOBAL_RELATIVE_ALT_INT). I use lat, lon ×1e7, and altitude in meters.
The leader moves forward correctly. However, the follower sometimes turns back or diverts to positions that don’t correspond to the leader’s path, but rather appear to match old waypoints or its own past positions. The movement seems erratic: sometimes it goes toward the leader, then unexpectedly deviates backward.
Here’s how I’m controlling the aircraft:
- Mode: FBWA
- arm throttle, then
rc 3 1800
to start - No airspeed sensor is used; instead, TECS and ARSPD parameters were adjusted (listed below)
- DO_REPOSITION commands are sent every 0.5 seconds (2 Hz)
Observations:
- The yaw is calculated and sent explicitly with the command
- The behavior happens randomly, even when the command queue is being fed valid delayed leader positions
- Home and current location seem consistent
- There are no active missions (but could old missions interfere?)
Relevant Parameters:
param show ARSPD*
FBWA> ARSPD2_TYPE 0
ARSPD_AUTOCAL 1
ARSPD_BUS 1
ARSPD_DEVID 0
ARSPD_OFFSET 2013.9212646484375
ARSPD_OFF_PCNT 0
ARSPD_OPTIONS 3
ARSPD_PIN 1
ARSPD_PRIMARY 0
ARSPD_PSI_RANGE 1.0
ARSPD_RATIO 2.0
ARSPD_SKIP_CAL 0
ARSPD_TUBE_ORDR 2
ARSPD_TYPE 2
ARSPD_USE 1
ARSPD_WIND_GATE 5.0
ARSPD_WIND_MAX 0.0
ARSPD_WIND_WARN 0.0
FBWA> param show TECS*
FBWA> TECS_APPR_SMAX 0.0
TECS_CLMB_MAX 30.0
TECS_FLARE_HGT 1.0
TECS_HDEM_TCONST 3.0
TECS_HGT_OMEGA 3.0
TECS_INTEG_GAIN 0.30000001192092896
TECS_LAND_ARSPD 14.0
TECS_LAND_DAMP 1.0
TECS_LAND_IGAIN 0.0
TECS_LAND_PDAMP 0.0
TECS_LAND_PMAX 10
TECS_LAND_SINK 0.25
TECS_LAND_SPDWGT -1.0
TECS_LAND_SRC 0.0
TECS_LAND_TCONST 2.0
TECS_LAND_TDAMP 0.0
TECS_LAND_THR 50.0
TECS_OPTIONS 0
TECS_PITCH_MAX 40
TECS_PITCH_MIN 0
TECS_PTCH_DAMP 0.30000001192092896
TECS_PTCH_FF_K 0.0
TECS_PTCH_FF_V0 12.0
TECS_RLL2THR 10.0
TECS_SINK_MAX 5.0
TECS_SINK_MIN 1.25
TECS_SPDWEIGHT 1.5
TECS_SPD_OMEGA 2.0
TECS_SYNAIRSPEED 1
TECS_THR_DAMP 0.5
TECS_TIME_CONST 4.0
TECS_TKOFF_IGAIN 0.0
TECS_VERT_ACC 7.0
Question:
Could this behavior be caused by:
- A
DO_REPOSITION
misbehavior in ArduPlane 4.7-dev? - Incorrect usage of yaw or altitude in the command?
- SITL/Gazebo NED vs NWU frame mismatch?
- Old mission data still interfering?
I’d appreciate any insights or suggestions.
Thanks in advance