MPC_YAW_MODE 0 vs 3

Could someone explain the specific difference(s) in a multicopter’s behavior when setting MPC_YAW_MODE to 0: Towards Waypoint vs 3: Along Trajectory? They appear to result in similar behavior to me, but there must be something fundamentally different between these that I’m not seeing. I can’t seem to find a detailed explanation of the different modes for MPC_YAW_MODE.

  • Towards Waypoint means that the orientation of the vehicle depends on the current position of the drone and the next waypoint.

  • Along Trajectory means that the orientation is based on the velocity vector of the trajectory

Both give similar results but IMO, Along trajectory is nicer when having a larger waypoint acceptance radius (NAV_ACC_RAD) as the turn looks more coordinated.

Hi @bresch, thanks for this explanation. I agree Along Trajectory allows a nicer turn with a larger NAV_ACC_RAD, which is actually why I’ve been using Along Trajectory. However, I’m wondering if Along Trajectory can cause the aircraft to drift off course when doing a survey mission. I have been experiencing this lately and I’m trying to figure out why it’s happening. Is the velocity vector for Along Trajectory generated from the drone’s previous motion, or is it calculated looking forward into the future? If it’s based on previous motion I could see how Along Trajectory could allow drifting behavior to occur if, for instance, the drone was being pushed by a crosswind. Check out the screenshots of a couple of my flight logs. I have had this happen on about 8 flights over the past few weeks.


The heading is based on the velocity vector of the reference trajectory, it shouldn’t cause the behavior you’re showing in those screenshots.

To check how the reference trajectory is, you need to look at the trajectory_setpoint message; it contains the reference position, velocity, acceleration and jerk.

Thanks @bresch. Sounds like Along Trajectory isn’t causing this issue. I’ll have to do some more troubleshooting to figure out what’s causing the drifting behavior. Thanks.

Hi,
I actually have another question about this parameter. Could you please tell me the difference between MPC_YAW_MODE 0 and 4?
Thanks in advance!

In mode 4, the drone doesn’t start to move towards the next waypoint before the heading is aligned towards the next waypoint. In mode 0, the drone doesn’t need to stop; it will turn and go for the next waypoint at the same time.

1 Like

Hello,

@Arktix , I am also encountered similar problematic trajectories as the images you posted in my survey mission, have you been able to find out the root cause of the trajectories?