Arduplane Follow Change Speed

I try change follower plane speed with AIRSPEED_ params, but can not changing. I want to detect the leader plane on the follower plane’s camera. So I have to fly a little closer. The distance right now is 115m. The speed of both is 13 - 14m/s

Follower plane params (RIGHT):

AIRSPEED_CRUISE 20.0
AIRSPEED_MAX 30
AIRSPEED_MIN 10
AIRSPEED_STALL 0.0
FOLL_ALT_TYPE 0 # absolute
FOLL_DIST_MAX 20.0
FOLL_ENABLE 1 # Enabled
FOLL_OFS_TYPE 1 # Relative to lead vehicle heading
FOLL_OFS_X -20.0
FOLL_OFS_Y 20.0
FOLL_OFS_Z 0.0
FOLL_OPTIONS 0 # None
FOLL_POS_P 0.10000000149011612
FOLL_SYSID 0
FOLL_YAW_BEHAVE 1 # Face Lead Vehicle

Leader Plane params (LEFT):

AIRSPEED_CRUISE 12.0
AIRSPEED_MAX 30
AIRSPEED_MIN 9
AIRSPEED_STALL 0.0
FOLL_ALT_TYPE 0 # absolute
FOLL_DIST_MAX 100.0
FOLL_ENABLE 1 # Enabled
FOLL_OFS_TYPE 1 # Relative to lead vehicle heading
FOLL_OFS_X 0.0
FOLL_OFS_Y 0.0
FOLL_OFS_Z 0.0
FOLL_OPTIONS 0 # None
FOLL_POS_P 0.10000000149011612
FOLL_SYSID 0
FOLL_YAW_BEHAVE 1 # Face Lead Vehicle

The follow parameters only apply on the follow plane. They have no effect on the leader.

The obvious problem is FOLL_SYSID on the follow plane- this should be the SYSID_THISMAV of the leader plane. The leader plane and follow plane must have different SYSID_THISMAV values.

The other problem I see is FOLL_DIST_MAX - this will stop following as soon as the follow plane is > 100m from the leader. Definitely not what you want. You should set this to something large like 1000.

If you are running the plane_follow.lua script you should also have a set of ZP* parameters - please post those.

Please read the “readme”.md file for plane_follow:

The result is the same as the old values. Still far away in distance(115m). I write with Python (pymavlink). I use mission_item_send() command.

Follower:
SYSID_ENFORCE 0 # NotEnforced
SYSID_MYGCS 255
SYSID_THISMAV 1
FOLL_ALT_TYPE 0 # absolute
FOLL_DIST_MAX 1000.0
FOLL_ENABLE 1 # Enabled
FOLL_OFS_TYPE 1 # Relative to lead vehicle heading
FOLL_OFS_X -10.0
FOLL_OFS_Y 10.0
FOLL_OFS_Z 0.0
FOLL_OPTIONS 0 # None
FOLL_POS_P 0.10000000149011612
FOLL_SYSID 2
FOLL_YAW_BEHAVE 1 # Face Lead Vehicle

Leader:
SYSID_ENFORCE 0 # NotEnforced
SYSID_MYGCS 255
SYSID_THISMAV 2
FOLL_ENABLE 0 # Disabled

Do you have the script installed? where are the ZP* parameters?

When I say ‘param show ZP*’ I don’t get any output. I connect via UDP in Python code, not a Lua script, and enter the latitude, longitude and altitude values ​​of the plane (ROS2 topic) as parameters to the MAV_CMD_NAV_WAYPOINT command with Pymavlink mission_item_send(). Since I’m running ROS2 Humble, it’s constantly doing this in a loop. He follows but cannot get close.
Follower:
GUIDED> param show ZP*
GUIDED>

Leader:
CIRCLE> param show ZP*
CIRCLE>

Ah! Follow mode is not fully implemented in Plane, hence my script. If you look at my plane_follow.lua script, I had to add some logic, including two PID controllers to get the follow plane to correctly match the speed of the leader.

If you are trying to implement this in python or ROS2, you have a lot of work to do.

Thanks, I will try to do it with PID control.