When publishing to /mavros/setpoint_raw/attitude using mavros_msgs/AttitudeTarget in ArduPilot Plane (GUIDED mode), the vehicle performs an unintended yaw to the right, even when:
- Quaternion is identity (
w=1, x=0, y=0, z=0)
type_mask = 7 (IGNORE_ROLL_RATE | IGNORE_PITCH_RATE | IGNORE_YAW_RATE)
- Body rates are set to zero
- Thrust is constant
- Message is streamed at 20 Hz
The vehicle does not maintain heading and instead starts yawing to the right.
Expected Behavior
With identity quaternion (no rotation) and body rates ignored:
- The vehicle should maintain its current attitude
- No yaw change should occur
- No lateral drift should be observed
Actual Behavior
- The aircraft gradually yaws to the right.
- Heading changes even though quaternion corresponds to no rotation.
- Behavior differs from direct MAVLink
SET_ATTITUDE_TARGET sent via pymavlink (which works correctly).
Test Details
MAVROS Version
1.20.1
Firmware
- ArduPilot Plane
- GUIDED mode
Topic Used
- /mavros/setpoint_raw/attitude
Message Published
type_mask: 7
orientation:
w: 1.0
x: 0.0
y: 0.0
z: 0.0
body_rate:
x: 0.0
y: 0.0
z: 0.0
thrust: 0.6
Published at 20 Hz with valid header.stamp.
Additional Observations
- Sending the same
SET_ATTITUDE_TARGET directly via pymavlink (bypassing MAVROS) produces correct behavior (no yaw drift).
msgid 82 is confirmed to be sent when publishing via MAVROS.
- The issue only appears when using MAVROS
/setpoint_raw/attitude.
This suggests a possible:
- ENU → NED frame conversion issue
- Quaternion frame interpretation mismatch
- Yaw axis handling difference between MAVROS and direct MAVLink
Questions
- Is there a known issue with ENU/NED conversion for ArduPlane in
setpoint_raw/attitude?
- Should yaw be handled differently for fixed-wing vehicles?
- Is MAVROS applying an unintended frame transformation to quaternion?
When publishing to
/mavros/setpoint_raw/attitudeusingmavros_msgs/AttitudeTargetin ArduPilot Plane (GUIDED mode), the vehicle performs an unintended yaw to the right, even when:w=1, x=0, y=0, z=0)type_mask = 7(IGNORE_ROLL_RATE | IGNORE_PITCH_RATE | IGNORE_YAW_RATE)The vehicle does not maintain heading and instead starts yawing to the right.
Expected Behavior
With identity quaternion (no rotation) and body rates ignored:
Actual Behavior
SET_ATTITUDE_TARGETsent via pymavlink (which works correctly).Test Details
MAVROS Version
1.20.1
Firmware
Topic Used
Message Published
Published at 20 Hz with valid header.stamp.
Additional Observations
SET_ATTITUDE_TARGETdirectly via pymavlink (bypassing MAVROS) produces correct behavior (no yaw drift).msgid 82is confirmed to be sent when publishing via MAVROS./setpoint_raw/attitude.This suggests a possible:
Questions
setpoint_raw/attitude?