I’m working on software for a companion computer that connects to pixhawk/PX4 on a fixed-wing vehicle. At some point mid-flight, I want the companion computer to command the vehicle to loiter around it’s current position. I’m able to do this by sending these commands:
- SET_MODE
main_mode = PX4_CUSTOM_MAIN_MODE_AUTO
sub_mode = PX4_CUSTOM_SUB_MODE_AUTO_LOITER - COMMAND_LONG
command = MAV_CMD_DO_REPOSITION
param5 = (current latitude)
param6 = (current longitude)
My question:
The above commands cause the vehicle to loiter in a clockwise direction. How can I make the vehicle loiter in a counter-clockwise direction?
The mavlink documentation suggests that param4 (yaw) controls the loiter direction. I’ve tried setting yaw to 0, and 1, but this always results in a clockwise loiter.
I’ve looked at the PX4/Firmware code on Github, and it appears that loiter_direction
is hard-coded to 1 (meaning clockwise). Am I missing something, or is there a different sequence of commands to achieve this?
Thanks in advance!