mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 07:23:34 +08:00
convert -PI to PI attitude range to -1 to 1 for gimbal output
This commit is contained in:
committed by
Lorenz Meier
parent
f76d693592
commit
86cd484b82
@@ -306,17 +306,17 @@ Gimbal::cycle()
|
|||||||
orb_copy(ORB_ID(vehicle_attitude), _att_sub, &att);
|
orb_copy(ORB_ID(vehicle_attitude), _att_sub, &att);
|
||||||
|
|
||||||
if (_attitude_compensation_roll) {
|
if (_attitude_compensation_roll) {
|
||||||
roll = -att.roll;
|
roll = 1.0f / M_PI_F * -att.roll;
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_attitude_compensation_pitch) {
|
if (_attitude_compensation_pitch) {
|
||||||
pitch = -att.pitch;
|
pitch = 1.0f / M_PI_F * -att.pitch;
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_attitude_compensation_yaw) {
|
if (_attitude_compensation_yaw) {
|
||||||
yaw = att.yaw;
|
yaw = 1.0f / M_PI_F * att.yaw;
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user