1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

LP-385 - Add MinimumTimeInterval which define a hard minimum limit between two consecutive shots in auto mode. This is needed to ensure camera can keep up with trigger without loosing shots

This commit is contained in:
Alessio Morale 2016-08-29 20:24:58 +02:00
parent 8114d7771e
commit d000dd63c6
2 changed files with 7 additions and 3 deletions

View File

@ -137,6 +137,7 @@ static void CameraControlTask()
{
bool trigger = false;
PositionStateData pos;
uint32_t timeSinceLastShot = PIOS_DELAY_DiffuS(ccd->lastTriggerTimeRaw);
if (checkActivation()) {
if (ccd->manualInput != ccd->lastManualInput && ccd->manualInput != CAMERASTATUS_Idle) {
@ -145,10 +146,12 @@ static void CameraControlTask()
ccd->outputStatus = ccd->manualInput;
ccd->activity.Reason = CAMERACONTROLACTIVITY_REASON_MANUAL;
} else {
if (ccd->autoTriggerEnabled) {
// MinimumTimeInterval sets a hard limit on time between two consecutive shots, i.e. the minimum time between shots the camera can achieve
if (ccd->autoTriggerEnabled &&
timeSinceLastShot > (ccd->settings.MinimumTimeInterval * 1000 * 1000)) {
// check trigger conditions
if (ccd->settings.TimeInterval > 0) {
if (PIOS_DELAY_DiffuS(ccd->lastTriggerTimeRaw) > ccd->settings.TimeInterval * (1000 * 1000)) {
if (timeSinceLastShot > ccd->settings.TimeInterval * (1000 * 1000)) {
trigger = true;
ccd->activity.Reason = CAMERACONTROLACTIVITY_REASON_AUTOTIME;
}

View File

@ -7,8 +7,9 @@
<field name="OutputValues" units="%" type="float" elementnames="Idle,Shot,Video" defaultvalue="0,-1,1" />
<field name="InputValues" units="%" type="float" elementnames="Idle,Shot,Video" defaultvalue="0,-1,1" />
<field name="TriggerPulseWidth" units="ms" type="uint8" elements="1" defaultvalue="50"/>
<field name="TimeInterval" units="s" type="float" elements="1" defaultvalue="0"/>
<field name="TimeInterval" units="s" type="float" elements="1" defaultvalue="5"/>
<field name="SpaceInterval" units="m" type="float" elements="1" defaultvalue="0"/>
<field name="MinimumTimeInterval" units="s" type="float" elements="1" defaultvalue="2.5"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>