RPiCamera::RPiCamera() : currentBuf(0), timeStamp(0), storedTimeStamp(Platform->getTime()) { #if DEBUG_NUCAMERA_VERBOSITY > 4 debug << "RPiCamera::RPiCamera()" << endl; #endif // Set current camera to unknown. m_settings.activeCamera = CameraSettings::BOTTOM_CAMERA; //Read camera settings from file. CameraSettings fileSettings; fileSettings.LoadFromFile(CONFIG_DIR + string("Camera.cfg")); debug << "Loading settings from " << CONFIG_DIR + string("Camera.cfg") << endl; // Open device openCameraDevice("/dev/video0"); //Initialise initialiseCamera(); //readCameraSettings(); forceApplySettings(fileSettings); readCameraSettings(); loadCameraOffset(); // enable streaming setStreaming(true); }
CognitionConfigurationDataProvider::CognitionConfigurationDataProvider() : theFieldDimensions(0), theCameraInfo(0), theCameraSettings(0), theCameraCalibration(0), theColorTable64(0), theRobotDimensions(0), thePassParameters(0), theDamageConfiguration(0), theHeadLimits(0), theColorConfiguration(0) { theInstance = this; readFieldDimensions(); readCameraInfo(); readCameraSettings(); readCameraCalibration(); readColorTable64(); readRobotDimensions(); readPassParameters(); readDamageConfiguration(); readHeadLimits(); readColorConfiguration(); }
NaoCamera::NaoCamera(const char* device, CameraInfo::Camera camera, int width, int height, bool flip, const CameraSettings::CameraSettingsCollection& settings, const Matrix5uc& autoExposureWeightTable) : camera(camera), WIDTH(width), HEIGHT(height) { VERIFY((fd = open(device, O_RDWR | O_NONBLOCK)) != -1); mapBuffers(); queueBuffers(); setImageFormat(); setFrameRate(1, 30); checkSettingsAvailability(); specialSettings.horizontalFlip.value = flip ? 1 : 0; setControlSetting(specialSettings.horizontalFlip); specialSettings.verticalFlip.value = flip ? 1 : 0; setControlSetting(specialSettings.verticalFlip); setSettings(settings, autoExposureWeightTable); writeCameraSettings(); readCameraSettings(); startCapturing(); }
NAOCamera::NAOCamera() : currentBuf(0), timeStamp(0), storedTimeStamp(Platform->getTime()) { #if DEBUG_NUCAMERA_VERBOSITY > 4 debug << "NAOCamera::NAOCamera()" << endl; #endif // Set current camera to unknown. m_settings.activeCamera = CameraSettings::UNKNOWN_CAMERA; //Read camera settings from file. CameraSettings fileSettings; fileSettings.LoadFromFile(CONFIG_DIR + string("Camera.cfg")); // Open device openCameraDevice("/dev/video0"); // Set Bottom Camera setActiveCamera(CameraSettings::BOTTOM_CAMERA); initialiseCamera(); readCameraSettings(); m_cameraSettings[1] = m_settings; //forceApplySettings(fileSettings); forceApplySettings(fileSettings); // set to top camera setActiveCamera(CameraSettings::TOP_CAMERA); initialiseCamera(); readCameraSettings(); m_cameraSettings[0] = m_settings; //forceApplySettings(fileSettings); forceApplySettings(fileSettings); setActiveCamera(CameraSettings::BOTTOM_CAMERA); loadCameraOffset(); // enable streaming setStreaming(true); }