- Timestamp:
- Mar 7, 2017, 8:26:53 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.cpp
r163 r165 15 15 #include <Uav.h> 16 16 #include <Camera.h> 17 #include <V4LCamera.h> 17 18 #include <CvtColor.h> 18 19 #include <OpticalFlow.h> … … 123 124 uav->GetAhrs()->AddPlot(customReferenceOrientation,DataPlot::Yellow); 124 125 AddDataToControlLawLog(customReferenceOrientation); 126 127 flagCameraLost=false; 125 128 } 126 129 … … 196 199 } 197 200 201 void 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 198 212 DemoOpticalFlow::~DemoOpticalFlow() { 199 213 } -
trunk/demos/OpticalFlow/uav/src/DemoOpticalFlow.h
r163 r165 50 50 void ExtraCheckJoystick(void); 51 51 void ExtraCheckPushButton(void); 52 void ExtraSecurityCheck(void); 52 53 const flair::core::AhrsData *GetReferenceOrientation(void); 53 54 … … 69 70 flair::filter::LowPassFilter* opticalFlowSpeed; 70 71 flair::filter::LowPassFilter* opticalFlowAcceleration; 72 bool flagCameraLost; 71 73 }; 72 74 -
trunk/lib/FlairFilter/src/ButterworthLowPass_impl.cpp
r162 r165 79 79 for(uint32_t j=0;j<nbCol;j++) { 80 80 f[i*nbCol+j]->setup(1. / T->Value(), cutoff->Value()); 81 settingsChanged(f[i*nbCol+j],input->Value(i, j));81 //settingsChanged(f[i*nbCol+j],input->Value(i, j)); 82 82 } 83 83 } … … 103 103 for(uint32_t j=0;j<nbCol;j++) { 104 104 f[i*nbCol+j]->setup(1. / delta_t, cutoff->Value()); 105 settingsChanged(f[i*nbCol+j],input->ValueNoMutex(i, j));105 //settingsChanged(f[i*nbCol+j],input->ValueNoMutex(i, j)); 106 106 } 107 107 } -
trunk/lib/FlairMeta/src/HdsX8.h
r157 r165 30 30 std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";} 31 31 bool isReadyToFly(void) const; 32 virtual std::string GetType(void) const{return "hds_x8";} 32 33 33 34 private: -
trunk/lib/FlairMeta/src/SimuX4.h
r160 r165 31 31 ~SimuX4(); 32 32 void StartSensors(void); 33 virtual std::string GetType(void) const{return "x4_simu";} 33 34 34 35 private: -
trunk/lib/FlairMeta/src/SimuX8.h
r160 r165 30 30 ~SimuX8(); 31 31 void StartSensors(void); 32 virtual std::string GetType(void) const{return "simu_x8";} 32 33 33 34 private: -
trunk/lib/FlairMeta/src/Uav.h
r157 r165 64 64 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";} 65 65 virtual bool isReadyToFly(void) const { return true;} 66 virtual std::string GetType(void) const=0; 66 67 67 68 protected: -
trunk/lib/FlairMeta/src/UavStateMachine.h
r122 r165 227 227 228 228 const sensor::TargetController *GetJoystick(void) const; 229 MetaDualShock3 *joy; 229 230 230 231 gui::Tab *setupLawTab, *graphLawTab; … … 297 298 filter::Pid *uYaw; 298 299 filter::PidThrust *uZ; 299 300 MetaDualShock3 *joy;301 300 filter::TrajectoryGenerator1D *altitudeTrajectory; 302 301 }; -
trunk/lib/FlairMeta/src/XAir.h
r157 r165 30 30 std::string GetDefaultVrpnAddress(void) const{return "192.168.147.197:3883";} 31 31 bool isReadyToFly(void) const; 32 virtual std::string GetType(void) const{return "xair";} 32 33 33 34 private: -
trunk/lib/FlairSensorActuator/src/V4LCamera.cpp
r137 r165 75 75 awb = new CheckBox(GetGroupBox()->LastRowLastCol(), "awb:"); 76 76 fps = new Label(GetGroupBox()->NewRow(), "fps"); 77 78 hasProblems=false; 77 79 } 78 80 … … 95 97 96 98 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 97 105 // fps counter 98 106 fpsCounter++; … … 100 108 fpsNow = GetTime(); 101 109 fps->SetText("fps: %.1f", 102 110 fpsCounter / ((float)(fpsNow - fpsPrev) / 1000000000.)); 103 111 fpsCounter = 0; 104 112 fpsPrev = fpsNow; … … 147 155 } 148 156 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 } 149 163 150 164 output->GetMutex(); … … 161 175 } 162 176 177 bool V4LCamera::HasProblems(void) { 178 return hasProblems; 179 } 180 163 181 void V4LCamera::SetAutoGain(bool value) { 164 182 cvSetCaptureProperty(capture, CV_CAP_PROP_AUTOGAIN, value); -
trunk/lib/FlairSensorActuator/src/V4LCamera.h
r137 r165 59 59 */ 60 60 ~V4LCamera(); 61 62 //hack for ps3eye in hds uav 63 //TODO: put this in ps3eye class 64 bool HasProblems(void); 61 65 62 66 protected: … … 116 120 */ 117 121 virtual void SetContrast(float value); 118 122 119 123 private: 120 124 /*! … … 138 142 139 143 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; 142 145 gui::CheckBox *autogain, *awb, *autoexposure; 143 146 gui::Label *fps; 147 bool hasProblems; 144 148 }; 145 149 } // end namespace sensor
Note:
See TracChangeset
for help on using the changeset viewer.