Hi everyone,
I am working on an ArduPilot Rover project and would like to ask about heading alignment in Follow mode.
My system has two parts:
-
Air side: an STM32 board simulating a UAV
-
Ground side: a rover using Pixhawk 4
-
Firmware: ArduRover 4.7.0
-
Ground station: Mission Planner
Both the air side and the ground side use RTK for accurate positioning. Both sides also have heading information from antennas.
The STM32 receives and parses the RTK data, then sends the target latitude, longitude, and heading information to the rover using MAVLink through a radio link.
Currently, the rover is switched to Follow mode using the RC transmitter. After entering Follow mode, the rover can receive the STM32 RTK position and follow the STM32 successfully.
Now I want to improve one behavior:
When the rover moves close to the STM32 position, I want the rover to stop and then rotate in place until its heading is the same as the STM32 heading.
The STM32 heading is in the range of 0–360 degrees. The rover supports turning in place.
My desired behavior is:
-
The rover follows the STM32 position in Follow mode.
-
When the rover reaches the target area near the STM32, the rover stops.
-
The rover rotates in place.
-
The rover’s heading becomes aligned with the STM32 heading.
-
The rover keeps the same heading as the STM32 as much as possible.
Is there a recommended way to implement this in ArduRover?
Should I send a specific MAVLink command or message to control the rover yaw/heading after it reaches the target position? Or should this be handled by changing parameters, using Guided mode, or adding custom control logic?
Any suggestions about the correct method, relevant parameters, or MAVLink messages would be very helpful.
Thank you.