Changeset 165 in flair-src for trunk/lib/FlairSensorActuator/src


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

modifs

Location:
trunk/lib/FlairSensorActuator/src
Files:
2 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);
  • trunk/lib/FlairSensorActuator/src/V4LCamera.h

    r137 r165  
    5959  */
    6060  ~V4LCamera();
     61 
     62    //hack for ps3eye in hds uav
     63  //TODO: put this in ps3eye class
     64  bool HasProblems(void);
    6165
    6266protected:
     
    116120  */
    117121  virtual void SetContrast(float value);
    118 
     122 
    119123private:
    120124  /*!
     
    138142
    139143  gui::Tab *sensor_tab;
    140   gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,
    141       *sat;
     144  gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,*sat;
    142145  gui::CheckBox *autogain, *awb, *autoexposure;
    143146  gui::Label *fps;
     147  bool hasProblems;
    144148};
    145149} // end namespace sensor
Note: See TracChangeset for help on using the changeset viewer.