22#include <yarp/dev/FrameGrabberInterfaces.h>
41 pythonCameraHelper_.setInjectedProcess([
this](
const void *
pythonBuffer,
size_t size) { pythonPreprocess(
pythonBuffer, size); });
42 pythonCameraHelper_.setInjectedUnlock([
this]() { mutex.post(); });
43 pythonCameraHelper_.setInjectedLock([
this]() { mutex.wait(); });
75 if (!fromConfig(config))
80 if (!pythonCameraHelper_.
openAll())
91 return pythonCameraHelper_.
closeAll();
138 camera->deviceDescription =
"UltraPython camera";
144 if (!FeatureHelper::exists(
feature))
154 if (!FeatureHelper::existsForWrite(
feature))
161 if (FeatureHelper::isAbsolute(
feature))
171 if (!FeatureHelper::existsForRead(
feature))
178 if (FeatureHelper::isAbsolute(
feature))
230 if (FeatureHelper::exists(
feature))
268 if (config.
check(
"verbose"))
274 if (config.
check(
"period"))
276 auto tmp = config.
find(
"period");
277 period =
tmp.asInt32();
282 if (config.
check(
"honorfps"))
285 auto tmp = config.
find(
"honorfps");
291 if (!config.
check(
"subsampling"))
310 if (config.
check(
"cammodel"))
315 if (config.
check(
"d"))
320 if (config.
check(
"flip"))
325 if (config.
check(
"crop"))
330 if (config.
check(
"dual"))
335 if (config.
check(
"framerate"))
340 if (config.
check(
"pixelType"))
345 if (config.
check(
"horizontalFov"))
350 if (config.
check(
"verticalFov"))
354 if (config.
check(
"principalPointX"))
358 if (config.
check(
"principalPointY"))
362 if (config.
check(
"retificationMatrix"))
366 if (config.
check(
"distortionModel"))
375void UltraPythonDriver::pythonPreprocess(
const void *
pythonbuffer,
size_t size)
380int UltraPythonDriver::remapControlYARPtoXilinx(
int feature)
const
@ YARP_FEATURE_BRIGHTNESS
const yarp::os::LogComponent & ULTRAPYTHON()
const yarp::os::LogComponent & ULTRAPYTHON()
static constexpr int hiresFrameRate_
static constexpr unsigned int V4L2_CONTRAST_ULTRA_PYTHON
static constexpr unsigned int V4L2_BLUEBALANCE_ULTRA_PYTHON
bool step(unsigned char *yarpbuffer)
void setHonorFps(bool value)
void setStepPeriod(double msec)
static constexpr int lowresFrameRate_
static constexpr unsigned int V4L2_EXPOSURE_ULTRA_PYTHON
bool setControl(uint32_t v4lCtrl, double value, bool absolute)
static constexpr unsigned int V4L2_GREENBALANCE_ULTRA_PYTHON
double getControl(uint32_t v4lCtrl, bool absolute)
static constexpr unsigned int V4L2_REDBALANCE_ULTRA_PYTHON
void setSubsamplingProperty(bool value)
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
Get an image from the frame grabber.
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
bool getCameraDescription(CameraDescriptor *camera) override
Get a basic description of the camera hw.
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
int height() const override
Return the height of each frame.
bool setOnePush(int feature) override
Set the requested feature to a value (saturation, brightness ... )
int width() const override
Return the width of each frame.
bool hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
~UltraPythonDriver() override
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
bool setFeature(int feature, double value) override
Set the requested feature to a value (saturation, brightness ... )
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool close() override
Close the DeviceDriver.
bool setActive(int feature, bool onoff) override
Set the requested feature on or off.
bool getFeature(int feature, double *value) override
Get the current value for the requested feature.
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ... )
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
void wait()
Decrement the counter, even if we must wait to do that.
void post()
Increment the counter.
An abstraction for a time stamp and/or sequence number.
size_t width() const
Gets width of image in pixels.
unsigned char * getRawImage() const
Access to the internal image buffer.
void resize(size_t imgWidth, size_t imgHeight)
Reallocate an image to be of a desired size, throwing away its current contents.
size_t height() const
Gets height of image in pixels.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCTrace(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
void delay(double seconds)
Wait for a certain number of seconds.
An interface to the operating system, including Port based communication.