Follow heading instead of waypoint?

I’m working on an autonomous sailboat. I’m in the process of selecting hardware now. I’m curious if there is a way in ArduPilot to tell the vehicle to follow a particular heading rather than go to a waypoint.

When sailing downwind, following waypoints makes sense. You let the autopilot control the rudder and trim your sails to whatever relative wind you sense. However, when going upwind, the strategy is different. Sailboats cannot go directly upwind. They talk left and right in a zigzag. You want to use the rudder to point a specific angle off the wind (e.g., 45 degrees). If you turn closer to the wind, you stop and then drift backwards without control. If you fall off the wind, you’re lengthening your already zigzagging path.

So, is there a way to tell the vehicle that I want a particular heading, and I don’t care if my track drifts left or right? I suppose I could fake this with a waypoint on this heading but many miles away… Is there a simper way?

Hello,

This isn’t implemeted yet. If you know how to/can use MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED (use speed + yaw speed) or MAV_CMD_NAV_SET_YAW_SPEED (use speed + yaw error) you can do it pretty easily but that is in GUIDED mode not AUTO and you need to send the command continuously

Thank you Khancyr. I’m new to Ardupilot though I am a firmware engineer by trade.

I gather that MAVLINK_MSG_ID_* are C macros for using inside code that runs on the autopilot and MAV_CMD_* are messages the AP can receive over serial.

MAV_CMD_NAV_SET_YAW_SPEED controls the relative heading. I wonder how often I’d need to send this command to stay on a heading.

Hello,

both are mavlink message that can be send.
For both, you need to send the message at least once every 3s otherwise it will stop !

I assume rover doesn’t have the equivalent of cruse mode?

Hi khancryr,
can you explain me how to send continously the waypoints and the commands in the guided mode for rover?
I studied the rover wiki about the controls modes and at the section on guided mode is only explained how to send commands with the mouse( Guided mode — Rover documentation ).
To clarify my task, I’ve to implement a follow me mode on a rover. On the formum I haven’t find specific information about the continously messages sending.
Thanks