Robot Devastation
|
Image input manager based in YARP. More...
#include <YarpLocalImageManager.hpp>
Public Member Functions | |
virtual bool | start () |
Start to capture images. More... | |
virtual bool | stop () |
Stop capturing images. | |
virtual bool | isStopped () const |
True if the manager is not active. | |
virtual bool | setEnabled (bool enabled) |
Enables/disables notifications to listeners. | |
virtual bool | configure (const std::string ¶meter, const std::string &value) |
Configures a parameter with a value. | |
virtual Image | getImage () const |
Return the last received image. | |
virtual | ~YarpLocalImageManager () |
Destructor. Used to reset the local static reference after destroying this manager. | |
Public Member Functions inherited from rd::ImageManager | |
bool | addImageEventListener (ImageEventListener *listener) |
Adds a ImageEventListener to the list of observers to be notified of events. | |
bool | removeImageEventListeners () |
Unregisters all the ImageEventListener stored. | |
Static Public Member Functions | |
static bool | RegisterManager () |
Register this manager in the ImageManager registry so that can be used. More... | |
Static Public Member Functions inherited from rd::ImageManager | |
static ImageManager * | getImageManager () |
Get a reference to the ImageManager. More... | |
static ImageManager * | getImageManager (const std::string &id) |
Get a reference to the ImageManager. More... | |
static bool | destroyImageManager () |
Deallocate all the registered ImageManager. | |
Static Public Attributes | |
static const std::string | id = "YARPlocal" |
String that identifies this manager. | |
Protected Member Functions | |
void | onRead (Image &image) |
Yarp event for incoming messages. | |
Private Member Functions | |
YarpLocalImageManager () | |
Constructor. More... | |
YarpLocalImageManager (const YarpLocalImageManager &) | |
YarpLocalImageManager & | operator= (const YarpLocalImageManager &) |
Private Attributes | |
yarp::os::Semaphore | semaphore |
Semaphore to make the image manipulation thread-safe. | |
Image | image |
Last image received. | |
yarp::os::BufferedPort< Image > | imagePort |
Yarp port to communicate with the remote camera. | |
std::string | local_port_name |
Name of the local yarp port. | |
std::string | remote_port_name |
Name of the camera (remote) yarp port. | |
bool | stopped |
bool | enabled |
yarp::dev::PolyDriver | cameraDevice |
int | camera_id |
Used to select when several cameras are attached. | |
Static Private Attributes | |
static YarpLocalImageManager * | uniqueInstance = NULL |
Reference to this manager (unique instance) | |
Additional Inherited Members | |
Static Protected Member Functions inherited from rd::ImageManager | |
static bool | Register (ImageManager *manager, const std::string &id) |
This function allows subclasses to install their unique instances in the singleton register to be selected later by the user. | |
Protected Attributes inherited from rd::ImageManager | |
std::vector< ImageEventListener * > | listeners |
Observers registered to be notified of image events. | |
ImageManager is a singleton text (only one instance of this object can exist, that is is shared by all the users). To use this class, we first have to register the manager with the RegisterManager() method. Then, we can get the reference to the YarpLocalImageManager with ImageManager::getImageManager(), using the corresponding id and access the manager with that reference.
Imnage events are broadcasted to the registered listeners, along with the reference to the manager that triggered them to be able to access the image.
|
private |
Constructor for this class is private, since the singleton can only be instantiated once, and the instantiation is done at the RegisterManager() method.
|
static |
It ensures that only one manager of this type is created (unique instance).
|
virtual |
This function is supposed to be called after ImageManager configuration.
Implements rd::ImageManager.