mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-16 08:29:15 +01:00
LP-214 Calc changes
This commit is contained in:
parent
a46bf079de
commit
2ffd179f79
@ -107,10 +107,10 @@ void stabilizedHandler(bool newinit)
|
|||||||
float yawCommand = cmd.Yaw;
|
float yawCommand = cmd.Yaw;
|
||||||
|
|
||||||
// http://shrediquette.blogspot.de/2016/01/some-thoughts-on-camera-tilt.html
|
// http://shrediquette.blogspot.de/2016/01/some-thoughts-on-camera-tilt.html
|
||||||
// Roll_output = cos(camera_tilt) * Roll_input - sin(camera_tilt) * Yaw_input
|
// When Roll right, add negative Yaw.
|
||||||
// Yaw_output = sin(camera_tilt) * Roll_input + cos(camera_tilt) * Yaw_input
|
// When Yaw left, add negative Roll.
|
||||||
cmd.Roll = boundf((cosAngle * rollCommand) - (sinAngle * yawCommand), -1.0f, 1.0f);
|
cmd.Roll = boundf((cosAngle * rollCommand) + (sinAngle * yawCommand), -1.0f, 1.0f);
|
||||||
cmd.Yaw = boundf((cosAngle * yawCommand) + (sinAngle * rollCommand), -1.0f, 1.0f);
|
cmd.Yaw = boundf((cosAngle * yawCommand) - (sinAngle * rollCommand), -1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *stab_settings;
|
uint8_t *stab_settings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user