Changeset 165 in flair-src for trunk/demos/OpticalFlow/uav


Ignore:
Timestamp:
Mar 7, 2017, 8:26:53 PM (8 years ago)
Author:
Sanahuja Guillaume
Message:

modifs

Location:
trunk/demos/OpticalFlow/uav/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp

    r163 r165  
    1515#include <Uav.h>
    1616#include <Camera.h>
     17#include <V4LCamera.h>
    1718#include <CvtColor.h>
    1819#include <OpticalFlow.h>
     
    123124  uav->GetAhrs()->AddPlot(customReferenceOrientation,DataPlot::Yellow);
    124125  AddDataToControlLawLog(customReferenceOrientation);
     126 
     127  flagCameraLost=false;
    125128}
    126129
     
    196199}
    197200
     201void DemoOpticalFlow::ExtraSecurityCheck(void) {
     202  if(GetUav()->GetType()=="hds_x8") {
     203    if(((V4LCamera*)GetUav()->GetVerticalCamera())->HasProblems() && !flagCameraLost) {
     204      flagCameraLost = true;
     205      Thread::Err("Camera lost\n");
     206      SafeStop();
     207      Land();
     208    }
     209  }
     210}
     211
    198212DemoOpticalFlow::~DemoOpticalFlow() {
    199213}
  • trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.h

    r163 r165  
    5050        void ExtraCheckJoystick(void);
    5151    void ExtraCheckPushButton(void);
     52    void ExtraSecurityCheck(void);
    5253        const flair::core::AhrsData *GetReferenceOrientation(void);
    5354
     
    6970        flair::filter::LowPassFilter* opticalFlowSpeed;
    7071        flair::filter::LowPassFilter* opticalFlowAcceleration;
     72        bool flagCameraLost;
    7173};
    7274
Note: See TracChangeset for help on using the changeset viewer.