YARP
Yet Another Robot Platform
yarp::dev::VirtualAnalogWrapper Class Reference

An analog wrapper for virtual device A virtual device is a software emulated device, for example force-torque computed from a real sensor and then relocated to another part of the robot or some kind of estimated measurement needed by the robot. More...

#include <VirtualAnalogWrapper/VirtualAnalogWrapper.h>

+ Inheritance diagram for yarp::dev::VirtualAnalogWrapper:

Detailed Description

An analog wrapper for virtual device A virtual device is a software emulated device, for example force-torque computed from a real sensor and then relocated to another part of the robot or some kind of estimated measurement needed by the robot.

This virtual wrapper will open a port and accept the incoming estimated measurement and send them to the real robot using the attached device.

Definition at line 72 of file VirtualAnalogWrapper.h.

Public Member Functions

 VirtualAnalogWrapper ()
 
 ~VirtualAnalogWrapper ()
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
void run () override
 Main body of the new thread. More...
 
bool attachAll (const yarp::dev::PolyDriverList &p) override
 Attach to a list of objects. More...
 
bool detachAll () override
 Detach the object (you must have first called attach). More...
 
bool perform_first_check (int elems)
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
virtual ~DeviceDriver ()
 Destructor. More...
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver. More...
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others. More...
 
- Public Member Functions inherited from yarp::os::IConfig
virtual ~IConfig ()
 Destructor. More...
 
virtual bool configure (Searchable &config)
 Change online parameters. More...
 
- Public Member Functions inherited from yarp::os::Thread
 Thread ()
 Constructor. More...
 
virtual ~Thread ()
 Destructor. More...
 
virtual void onStop ()
 Call-back, called while halting the thread (before join). More...
 
bool start ()
 Start the new thread running. More...
 
bool stop ()
 Stop the thread. More...
 
virtual void beforeStart ()
 Called just before a new thread starts. More...
 
virtual void afterStart (bool success)
 Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). More...
 
virtual bool threadInit ()
 Initialization method. More...
 
virtual void threadRelease ()
 Release method. More...
 
bool isStopping ()
 Returns true if the thread is stopping (Thread::stop has been called). More...
 
bool isRunning ()
 Returns true if the thread is running (Thread::start has been called successfully and the thread has not stopped). More...
 
long int getKey ()
 Get a unique identifier for the thread. More...
 
int setPriority (int priority, int policy=-1)
 Set the priority and scheduling policy of the thread, if the OS supports that. More...
 
int getPriority ()
 Query the current priority of the thread, if the OS supports that. More...
 
int getPolicy ()
 Query the current scheduling policy of the thread, if the OS supports that. More...
 
bool join (double seconds=-1)
 The function returns when the thread execution has completed. More...
 
void setOptions (int stackSize=0)
 Set the stack size for the new thread. More...
 
- Public Member Functions inherited from yarp::dev::IMultipleWrapper
virtual ~IMultipleWrapper ()
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::Thread
static int getCount ()
 Check how many threads are running. More...
 
static long int getKeyOfCaller ()
 Get a unique identifier for the calling thread. More...
 
static void yield ()
 Reschedule the execution of current thread, allowing other threads to run. More...
 
static void setDefaultStackSize (int stackSize)
 Set the default stack size for all threads created after this point. More...
 

Constructor & Destructor Documentation

◆ VirtualAnalogWrapper()

yarp::dev::VirtualAnalogWrapper::VirtualAnalogWrapper ( )
inline

Definition at line 75 of file VirtualAnalogWrapper.h.

◆ ~VirtualAnalogWrapper()

yarp::dev::VirtualAnalogWrapper::~VirtualAnalogWrapper ( )
inline

Definition at line 83 of file VirtualAnalogWrapper.h.

Member Function Documentation

◆ attachAll()

bool VirtualAnalogWrapper::attachAll ( const yarp::dev::PolyDriverList p)
overridevirtual

Attach to a list of objects.

Parameters
pthe polydriver list that you want to attach to.
Returns
true/false on success failure.

Implements yarp::dev::IMultipleWrapper.

Definition at line 218 of file VirtualAnalogWrapper.cpp.

◆ close()

bool VirtualAnalogWrapper::close ( void  )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 210 of file VirtualAnalogWrapper.cpp.

◆ detachAll()

bool VirtualAnalogWrapper::detachAll ( )
overridevirtual

Detach the object (you must have first called attach).

Returns
true/false on success failure.

Implements yarp::dev::IMultipleWrapper.

Definition at line 257 of file VirtualAnalogWrapper.cpp.

◆ open()

bool VirtualAnalogWrapper::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 113 of file VirtualAnalogWrapper.cpp.

◆ perform_first_check()

bool VirtualAnalogWrapper::perform_first_check ( int  elems)

Definition at line 273 of file VirtualAnalogWrapper.cpp.

◆ run()

void VirtualAnalogWrapper::run ( )
overridevirtual

Main body of the new thread.

Override this method to do what you want. After Thread::start is called, this method will start running in a separate thread. It is important that this method either keeps checking Thread::isStopping to see if it should stop, or you override the Thread::onStop method to interact with it in some way to shut the new thread down. There is no really reliable, portable way to stop a thread cleanly unless that thread cooperates.

Implements yarp::os::Thread.

Definition at line 292 of file VirtualAnalogWrapper.cpp.


The documentation for this class was generated from the following files: