예제 #1
0
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);
}
예제 #2
0
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);
}