12 #include <yarp/os/Stamp.h>
13 #include <yarp/dev/DeviceDriver.h>
14 #include <yarp/os/Log.h>
15 #include <yarp/os/LogStream.h>
17 using namespace yarp::os;
20 #include "FirewireCameraDC1394-DR2_2.h"
26 bool DragonflyDeviceDriver2Rgb::getImage(yarp::sig::ImageOf<yarp::sig::PixelRgb>& image)
31 bool DragonflyDeviceDriver2Rgb::getImage(yarp::sig::ImageOf<yarp::sig::PixelMono>& image)
36 int DragonflyDeviceDriver2Rgb::width ()
const
38 return RES(system_resources)->
width();
41 int DragonflyDeviceDriver2Rgb::height ()
const
46 bool DragonflyDeviceDriver2Raw::getImage(yarp::sig::ImageOf<yarp::sig::PixelMono>& image)
51 int DragonflyDeviceDriver2Raw::width ()
const
53 return RES(system_resources)->
width();
56 int DragonflyDeviceDriver2Raw::height ()
const
63 DragonflyDeviceDriver2::DragonflyDeviceDriver2(
bool raw) :
64 raw(raw), system_resources(NULL)
79 if(config.check(
"pixelType"))
81 if(config.find((
"pixelType")).asVocab32()==VOCAB_PIXEL_MONO)
83 else if((config.find((
"pixelType")).asVocab32()==VOCAB_PIXEL_RGB))
87 yError()<<
"DragonflyDeviceDriver2: invalid pixelType:"<<yarp::os::Vocab32::decode(config.find((
"pixelType")).asVocab32());
95 fprintf(stderr,
"DragonflyDeviceDriver2: can't open camera\n");
397 if(width<=0 || height<=0){
398 yError()<<
"DragonflyDeviceDriver: invalid width or height";
431 camera->busType = BUS_FIREWIRE;
432 camera->deviceDescription =
"DragonFly2";
496 if(feature == YARP_FEATURE_WHITE_BALANCE)
504 if(feature == YARP_FEATURE_WHITE_BALANCE)
CFWCamera_DR2_2 * RES(void *res)
virtual bool setResetDC1394()
virtual bool setModeDC1394(int feature, bool auto_onoff)
virtual bool setTransmissionDC1394(bool bTxON)
virtual unsigned int getISOSpeedDC1394()
virtual unsigned int getFPSDC1394()
virtual double getSharpness()
virtual unsigned int getColorCodingDC1394()
virtual bool setDefaultsDC1394()
virtual bool getTransmissionDC1394()
virtual int getRgbHeight()
const yarp::os::Stamp & getLastInputStamp()
virtual bool hasFeatureDC1394(int feature)
virtual bool getWhiteBalanceDC1394(double &b, double &r)
virtual double getBrightness()
virtual unsigned int getVideoModeMaskDC1394()
virtual bool setPowerDC1394(bool onoff)
virtual bool setHue(double v)
virtual bool setShutter(double v)
virtual unsigned int getBytesPerPacketDC1394()
virtual bool setWhiteBalanceDC1394(double b, double r)
virtual unsigned int getVideoModeDC1394()
virtual bool setCaptureDC1394(bool bON)
virtual bool setBrightness(double v)
bool CaptureImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image)
virtual bool setFeatureDC1394(int feature, double value)
virtual bool getWhiteBalance(double &blue, double &red)
virtual bool hasOnePushDC1394(int feature)
virtual bool setRgbFOV(double horizontalFov, double verticalFov)
virtual bool getFormat7WindowDC1394(unsigned int &xdim, unsigned int &ydim, int &x0, int &y0)
virtual bool setOperationModeDC1394(bool b1394b)
virtual bool setBytesPerPacketDC1394(unsigned int bpp)
virtual unsigned int getFPSMaskDC1394()
virtual bool setRgbMirroring(bool mirror)
virtual bool getOperationModeDC1394()
virtual bool hasAutoDC1394(int feature)
virtual bool getRgbFOV(double &horizontalFov, double &verticalFov)
virtual bool setBroadcastDC1394(bool onoff)
virtual bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations)
virtual bool getRgbResolution(int &width, int &height)
virtual bool setExposure(double v)
virtual bool setRgbResolution(int width, int height)
virtual bool setSharpness(double v)
virtual double getExposure()
virtual bool hasManualDC1394(int feature)
virtual double getGamma()
virtual int getRgbWidth()
virtual double getFeatureDC1394(int feature)
virtual bool getFormat7MaxWindowDC1394(unsigned int &xdim, unsigned int &ydim, unsigned int &xstep, unsigned int &ystep, unsigned int &xoffstep, unsigned int &yoffstep)
virtual bool getRgbIntrinsicParam(yarp::os::Property &intrinsic)
virtual bool setGamma(double v)
virtual bool setActiveDC1394(int feature, bool onoff)
virtual bool setIris(double v)
virtual bool setFPSDC1394(int fps)
virtual unsigned int getColorCodingMaskDC1394(unsigned int video_mode)
virtual bool hasOnOffDC1394(int feature)
virtual bool getActiveDC1394(int feature)
virtual bool setISOSpeedDC1394(int speed)
virtual bool setColorCodingDC1394(int coding)
virtual bool getModeDC1394(int feature)
virtual double getShutter()
virtual bool setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0)
virtual bool setWhiteBalance(double blue, double red)
virtual bool getRgbMirroring(bool &mirror)
virtual bool setVideoModeDC1394(int video_mode)
virtual double getSaturation()
virtual bool setOnePushDC1394(int feature)
virtual bool setSaturation(double v)
bool Create(yarp::os::Searchable &config)
virtual bool setGain(double v)
virtual bool setColorCodingDC1394(int coding)
Set image color coding.
virtual bool setActiveDC1394(int feature, bool onoff)
Switch feature on/off.
virtual bool setPowerDC1394(bool onoff)
Switch camera power ON/OFF.
virtual bool getActiveDC1394(int feature)
Is feature ON or OFF?
virtual bool setMode(int feature, FeatureMode mode)
virtual unsigned int getColorCodingDC1394()
Get image color coding.
virtual bool setWhiteBalance(double blue, double red)
Set White Balance.
virtual ~DragonflyDeviceDriver2()
Destructor.
virtual unsigned int getVideoModeDC1394()
Get camera acquisition mode.
virtual unsigned int getFPSMaskDC1394()
Get supported framerates mask.
virtual bool getTransmissionDC1394()
Is image transmission ON or OFF?
virtual bool hasOnOff(int feature, bool *HasOnOff)
virtual bool close(void)
Closes the device driver.
virtual bool hasManualDC1394(int feature)
Has feature Manual mode?
virtual bool getRgbFOV(double &horizontalFov, double &verticalFov)
Get the field of view (FOV) of the rgb camera.
virtual double getBrightness()
Get Brightness.
virtual bool getFormat7WindowDC1394(unsigned int &xdim, unsigned int &ydim, int &x0, int &y0)
Get image dimensions in Format 7 mode.
virtual bool setDefaultsDC1394()
Set camera features to default.
virtual double getExposure()
Get Exposure.
virtual bool setCaptureDC1394(bool bON)
Switch image capture ON/OFF.
virtual double getSharpness()
Get Sharpness.
virtual bool setVideoModeDC1394(int video_mode)
Set camera acquisition mode.
virtual bool setBroadcastDC1394(bool onoff)
Set feature commands propagation ON/OFF.
virtual bool getFormat7MaxWindowDC1394(unsigned int &xdim, unsigned int &ydim, unsigned int &xstep, unsigned int &ystep, unsigned int &xoffstep, unsigned int &yoffstep)
Get maximum image dimensions in Format 7 mode.
virtual double getFeatureDC1394(int feature)
Get feature value.
virtual unsigned int getBytesPerPacketDC1394()
Get Firewire communication packet size.
virtual bool setOnePushDC1394(int feature)
Trigger feature One Push adjust.
virtual bool getModeDC1394(int feature)
Is feature mode Auto or Manual?
virtual bool hasAutoDC1394(int feature)
Has feature Auto mode?
virtual bool setTransmissionDC1394(bool bTxON)
Set image transmission ON/OFF.
virtual bool setIris(double v)
Set Iris.
virtual bool hasFeatureDC1394(int feature)
Is feature present?
virtual bool setRgbResolution(int width, int height)
Set the resolution of the rgb image from the camera.
virtual bool setModeDC1394(int feature, bool auto_onoff)
Switch feature Auto/Manual.
virtual bool setFPSDC1394(int fps)
Set camera framerate.
virtual int getRgbWidth()
Return the width of each frame.
virtual double getSaturation()
Get Saturation.
virtual bool setWhiteBalanceDC1394(double b, double r)
Set White Balance.
virtual double getGain()
Get Gain.
virtual bool setActive(int feature, bool onoff)
virtual double getHue()
Get Hue.
virtual bool getOperationModeDC1394()
Get Operation Mode.
virtual bool getFeature(int feature, double *values)
virtual bool getRgbSupportedConfigurations(yarp::sig::VectorOf< yarp::dev::CameraConfig > &configurations)
Get the possible configurations of the camera.
virtual yarp::os::Stamp getLastInputStamp()
Implements the IPreciselyTimed interface.
virtual bool setResetDC1394()
virtual unsigned int getFPSDC1394()
Get camera framerate.
virtual bool setOperationModeDC1394(bool b1394b)
Set Operation Mode.
virtual bool hasManual(int feature, bool *hasManual)
virtual bool getWhiteBalanceDC1394(double &b, double &r)
Get White Balance.
virtual bool hasOnePush(int feature, bool *hasOnePush)
virtual bool hasAuto(int feature, bool *hasAuto)
virtual bool setGain(double v)
Set Gain.
virtual bool hasOnOffDC1394(int feature)
Can be feature turned on/off?
virtual double getGamma()
Get Gamma.
virtual bool setBytesPerPacketDC1394(unsigned int bpp)
Set Firewire communication packet size.
virtual unsigned int getISOSpeedDC1394()
Get camera Firewire ISO speed.
virtual bool setGamma(double v)
Set Gamma.
virtual bool setRgbFOV(double horizontalFov, double verticalFov)
Set the field of view (FOV) of the rgb camera.
virtual bool setShutter(double v)
Set Shutter.
virtual bool setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0)
Set image dimensions in Format 7 mode.
virtual bool setOnePush(int feature)
virtual bool getActive(int feature, bool *isActive)
virtual unsigned int getVideoModeMaskDC1394()
Get supported video mode mask.
virtual bool hasOnePushDC1394(int feature)
Has feature Manual mode?
virtual bool setHue(double v)
Set Hue.
virtual bool setExposure(double v)
Set Exposure.
virtual bool setFeature(int feature, double values)
virtual bool setISOSpeedDC1394(int speed)
Set camera Firewire ISO speed.
virtual bool setSharpness(double v)
Set Sharpness.
virtual bool setSaturation(double v)
Set Saturation.
virtual bool getCameraDescription(CameraDescriptor *camera)
virtual int getRgbHeight()
Return the height of each frame.
virtual bool getRgbIntrinsicParam(yarp::os::Property &intrinsic)
Get the intrinsic parameters of the rgb camera.
virtual bool getWhiteBalance(double &blue, double &red)
Get White Balance.
virtual bool open(yarp::os::Searchable &config)
Open the device driver.
virtual bool hasFeature(int feature, bool *hasFeature)
virtual unsigned int getColorCodingMaskDC1394(unsigned int video_mode)
Get supported color coding mask.
virtual bool getRgbMirroring(bool &mirror)
Get the mirroring setting of the sensor.
virtual double getShutter()
Get Shutter.
virtual bool getMode(int feature, FeatureMode *mode)
virtual bool getRgbResolution(int &width, int &height)
Get the resolution of the rgb image from the camera.
virtual bool setBrightness(double v)
Set Brightness.
virtual bool setFeatureDC1394(int feature, double value)
Set feature value.
virtual double getIris()
Get Iris.
virtual bool setRgbMirroring(bool mirror)
Set the mirroring setting of the sensor.
FeatureMode TRANSL_MODE(bool mode)