Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multicopter attitude setpoint flag absolute yaw control #16010

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Oct 21, 2020

Describe problem solved by this pull request
to avoid sawtooth setpoints because of scheduling.
Hopefully fixes #15996

Describe your solution
I did not use the yaw_body field since we'd like to get rid of the X_body fields. For multicopter that's already possible and fixed-wing/VTOL uses those uORB message fields internally before filling the quaternion...

Describe possible alternatives
The only catch I currently see is that we have to be careful about the definition of yaw. See #13535

Test data / coverage
SITL still flies. I didn't check the ripples being gone.

This allows to disable absolute yaw control while still using
the attitude quaternion.
Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; can you do a test on a real vehicle?

@@ -246,6 +246,9 @@ MulticopterAttitudeControl::Run()
if (_vehicle_attitude_setpoint_sub.updated()) {
vehicle_attitude_setpoint_s vehicle_attitude_setpoint;
_vehicle_attitude_setpoint_sub.update(&vehicle_attitude_setpoint);
const float yaw_weight = vehicle_attitude_setpoint.absolute_heading_valid ? _param_mc_yaw_weight.get() : 0.f;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at it now I think the controller itself should be able to handle not controlling yaw independent of the outside resetting parameters so architecturally it's not ideal to put it here. I think I'll correct that and add unit tests before we move ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants