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

modifs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/V4LCamera.cpp

    r137 r165  
    7575  awb = new CheckBox(GetGroupBox()->LastRowLastCol(), "awb:");
    7676  fps = new Label(GetGroupBox()->NewRow(), "fps");
     77 
     78  hasProblems=false;
    7779}
    7880
     
    9597
    9698  while (!ToBeStopped()) {
     99    //check for ps3eye deconnection in hds uav
     100    if(cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH)<0) {
     101      Thread::Warn("camera disconnected\n");
     102      hasProblems=true;
     103    }
     104   
    97105    // fps counter
    98106    fpsCounter++;
     
    100108      fpsNow = GetTime();
    101109      fps->SetText("fps: %.1f",
    102                    fpsCounter / ((float)(fpsNow - fpsPrev) / 1000000000.));
     110       fpsCounter / ((float)(fpsNow - fpsPrev) / 1000000000.));
    103111      fpsCounter = 0;
    104112      fpsPrev = fpsNow;
     
    147155    }
    148156    new_time = GetTime();
     157   
     158    //check for ps3eye deconnection in hds uav
     159    if(new_time-cam_time>100*1000*1000) {
     160      Thread::Warn("delta trop grand\n");
     161      hasProblems=true;
     162    }
    149163
    150164    output->GetMutex();
     
    161175}
    162176
     177bool V4LCamera::HasProblems(void) {
     178  return hasProblems;
     179}
     180
    163181void V4LCamera::SetAutoGain(bool value) {
    164182  cvSetCaptureProperty(capture, CV_CAP_PROP_AUTOGAIN, value);
Note: See TracChangeset for help on using the changeset viewer.