Skip to content

Copter: Yaw-rate behavior in SET_ATTITUDE_TARGET changed in Guided #20444

Description

@ajshank

Bug report

The new implementation of Mavlink's SET_ATTITUDE_TARGET (82) in Copter 4.2 has introduced a bug (or 'feature') -- it is no longer possible to set target angles for roll/pitch and only angular rate for yaw for the attitude controller.

In 4.1, the BODY_YAW_RATE_IGNORE field was used to select yaw vs yaw-rate. If ATTITUDE_IGNORE is false, and BODY_YAW_RATE_IGNORE is also false, 4.1's behavior was to choose yaw-rate over the yaw from attitude -- i.e., rate-ignores got priority.

In 4.2, the implementation seems to use both. In this commit, the behavior is different (and somewhat strange). It seems like the rate controller is called for all axes if input quaternion is invalid/zero, and not called if there's any valid attitude. This makes it impossible to run yaw-rate control without yaw. Furthermore, the documentation here may be outdated too.

We do a lot of high-level control which generates target roll/pitch angles, and target yaw-rates (sounds strange, but isn't unusual). It would be nice to retain support for independent yaw-rate control somehow.

Feature

I think there's a broader question here -- what should be done if both attitude and rates are provided (and neither are set to 'ignore'). I would not interpret rate to be the rate at which the provided attitude should be attained; but I suspect others might read it differently. @lthall, thoughts?

Version
4.2 // Copter 4.2.

Platform
[ ] All
[ ] AntennaTracker
[ x ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions