Esempio n. 1
0
ALImageTranscriber::ALImageTranscriber(shared_ptr<Sensors> s,
                                       ALPtr<ALBroker> broker)
    : ThreadedImageTranscriber(s,"ALImageTranscriber"),
      log(), camera(), lem_name(""), camera_active(false),
      image(reinterpret_cast<uint16_t*>(new uint8_t[IMAGE_BYTE_SIZE])),
      table(new unsigned char[yLimit * uLimit * vLimit]),
      params(y0, u0, v0, y1, u1, v1, yLimit, uLimit, vLimit)
{

    try {
        log = broker->getLoggerProxy();
        // Possible values are
        // lowDebug, debug, lowInfo, info, warning, error, fatal
        log->setVerbosity("error");
    }catch (ALError &e) {
        cout << "Could not create a proxy to ALLogger module" << endl;
    }

#ifdef USE_VISION
    registerCamera(broker);
    if(camera_active) {
        try{
            initCameraSettings(BOTTOM_CAMERA);
        }catch(ALError &e){
            cout << "Failed to init the camera settings:"<<
                e.toString()<< endl;
            camera_active = false;
        }
    } else {
        cout << "\tCamera is inactive!" << endl;
    }
#endif

    initTable("/home/nao/naoqi/lib/naoqi/table.mtb");
}
Esempio n. 2
0
ALImageTranscriber::ALImageTranscriber(shared_ptr<Synchro> synchro,
                                       shared_ptr<Sensors> s,
                                       ALPtr<ALBroker> broker)
    : ThreadedImageTranscriber(s,synchro,"ALImageTranscriber"),
      log(), camera(), lem_name(""), camera_active(false),
      image(new unsigned char[IMAGE_BYTE_SIZE])
{
    try {
        log = broker->getLoggerProxy();
        // Possible values are
        // lowDebug, debug, lowInfo, info, warning, error, fatal
        log->setVerbosity("error");
    }catch (ALError &e) {
        std::cerr << "Could not create a proxy to ALLogger module" << std::endl;
    }

#ifdef USE_VISION
    registerCamera(broker);
    if(camera_active) {
        try{
        initCameraSettings(BOTTOM_CAMERA);
        }catch(ALError &e){
            cout << "Failed to init the camera settings:"<<e.toString()<<endl;
            camera_active = false;
        }
    }
    else
        cout << "\tCamera is inactive!" << endl;
#endif
}