|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
29 bool ok = open(
"source",
32 "device to read from (string or nested properties)");
39 "device to write to (string or nested properties)");
55 if (config.
check(key, name, comment)) {
59 p.setMonitor(config.getMonitor(),
75 yCInfo(DEVICEPIPE,
"\"--%s <name>\" not set", key);
84 yCInfo(DEVICEPIPE,
"Devices closing");
103 source.view(imgSource);
104 source.view(sndSource);
105 source.view(imgSndSource);
106 source.view(sourceType);
110 sink.view(imgSndSink);
113 if (sourceType !=
nullptr) {
115 imgSndSource =
nullptr;
118 if (sinkType !=
nullptr) {
120 imgSndSink =
nullptr;
125 if (imgSndSource !=
nullptr && imgSndSink !=
nullptr) {
131 "piped %zux%zu image, %zux%zu sound",
136 }
else if (imgSource !=
nullptr && imgSink !=
nullptr) {
140 yCInfo(DEVICEPIPE,
"piped %zux%zu image", tmp.width(), tmp.height());
141 }
else if (sndSource !=
nullptr && sndSink !=
nullptr) {
145 sndSource->
getSound(tmp, 4410, 4410, 0);
148 "piped %zux%zu sound",
152 yCInfo(DEVICEPIPE,
"Don't know how to pipe between these devices.");
153 yCInfo(DEVICEPIPE,
"Piping is very limited at the moment.");
154 yCInfo(DEVICEPIPE,
"You're probably better off writing some short custom code.");
A simple collection of objects that can be described and transmitted in a portable way.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
virtual bool renderSound(const yarp::sig::Sound &sound)=0
Render a sound using a device (i.e.
A base class for nested structures that can be searched.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
size_t getSamples() const
Get the number of samples contained in the sound.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
bool isValid() const
Check if device is valid.
#define YARP_LOG_COMPONENT(name,...)
virtual bool putAudioVisual(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image, yarp::sig::Sound &sound)=0
Write an image and sound.
virtual bool hasAudio()=0
size_t getChannels() const
Get the number of channels of the sound.
bool open(const std::string &txt)
Construct and configure a device by its common name.
virtual bool hasVideo()=0
An interface for the device drivers.
Read a YARP-format image to a device.
virtual bool isString() const
Checks if value is a string.
Read a YARP-format sound block from a device.
bool updateService() override
Give the service the chance to run for a while.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Read a YARP-format image from a device.
virtual bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image)=0
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied.
Read a YARP-format image and sound from a device.
virtual bool putImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image)=0
Write an image to the device.
A container for a device driver.
bool close() override
Close the DeviceDriver.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
Write a YARP-format image and sound to a device.
Bottle tail() const
Get all but the first element of a bottle.
#define yCInfo(component,...)
An interface to the operating system, including Port based communication.
Class for storing sounds.
virtual bool getSound(yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s)=0
Get a sound from a device.
virtual bool getAudioVisual(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image, yarp::sig::Sound &sound)=0
Get an image and sound.
std::string toString() const override
Return a standard text representation of the content of the object.
A single value (typically within a Bottle).
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A class for storing options and configuration information.