mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
CameraStab: change ResponseTime type from float to int16
This commit is contained in:
parent
2eb5130a7c
commit
e11904c42f
@ -154,14 +154,15 @@ static void attitudeUpdated(UAVObjEvent* ev)
|
||||
break;
|
||||
case CAMERASTABSETTINGS_STABILIZATIONMODE_AXISLOCK:
|
||||
input_rate = accessory.AccessoryVal * cameraStab.InputRate[i];
|
||||
if (abs(input_rate) > cameraStab.MaxAxisLockRate)
|
||||
if (fabs(input_rate) > cameraStab.MaxAxisLockRate)
|
||||
csd->inputs[i] = bound(csd->inputs[i] + input_rate * csd->dT / 1000.0f, cameraStab.InputRange[i]);
|
||||
break;
|
||||
default:
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
csd->inputs_filtered[i] = (cameraStab.ResponseTime[i] / (cameraStab.ResponseTime[i] + csd->dT)) * csd->inputs_filtered[i]
|
||||
+ (csd->dT / (cameraStab.ResponseTime[i] + csd->dT)) * csd->inputs[i];
|
||||
float rt = (float)cameraStab.ResponseTime[i];
|
||||
csd->inputs_filtered[i] = (rt / (rt + csd->dT)) * csd->inputs_filtered[i]
|
||||
+ (csd->dT / (rt + csd->dT)) * csd->inputs[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<field name="Inputs" units="channel" type="enum" elementnames="Roll,Pitch,Yaw" options="Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5,,None" defaultvalue="None"/>
|
||||
<field name="InputRange" units="deg" type="uint8" elementnames="Roll,Pitch,Yaw" defaultvalue="20"/>
|
||||
<field name="InputRate" units="deg/s" type="uint8" elementnames="Roll,Pitch,Yaw" defaultvalue="50"/>
|
||||
<field name="ResponseTime" units="ms" type="float" elementnames="Roll,Pitch,Yaw" defaultvalue="150"/>
|
||||
<field name="ResponseTime" units="ms" type="uint16" elementnames="Roll,Pitch,Yaw" defaultvalue="150"/>
|
||||
<field name="StabilizationMode" units="" type="enum" elementnames="Roll,Pitch,Yaw" options="Attitude,AxisLock" defaultvalue="Attitude"/>
|
||||
<field name="MaxAxisLockRate" units="deg/s" type="float" elements="1" defaultvalue="1"/>
|
||||
<field name="OutputRange" units="deg" type="uint8" elementnames="Roll,Pitch,Yaw" defaultvalue="20"/>
|
||||
|
Loading…
Reference in New Issue
Block a user