virtualAnalogServer
: 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>
Public Member Functions | |
VirtualAnalogWrapper ()=default | |
VirtualAnalogWrapper (const VirtualAnalogWrapper &)=delete | |
VirtualAnalogWrapper (VirtualAnalogWrapper &&)=delete | |
VirtualAnalogWrapper & | operator= (const VirtualAnalogWrapper &)=delete |
VirtualAnalogWrapper & | operator= (VirtualAnalogWrapper &&)=delete |
~VirtualAnalogWrapper () override | |
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 | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
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... | |
Protected Attributes | |
std::mutex | mMutex |
bool | mIsVerbose {false} |
int | mNSubdevs {0} |
std::vector< int > | mChan2Board |
std::vector< int > | mChan2BAddr |
double | lastRecv {0.0} |
bool | first_check {false} |
std::vector< AnalogSubDevice > | mSubdevices |
yarp::os::BufferedPort< yarp::os::Bottle > | mPortInputTorques |
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... | |
virtualAnalogServer
: 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 62 of file VirtualAnalogWrapper.h.
|
default |
|
delete |
|
delete |
|
inlineoverride |
Definition at line 74 of file VirtualAnalogWrapper.h.
|
overridevirtual |
Attach to a list of objects.
p | the polydriver list that you want to attach to. |
Implements yarp::dev::IMultipleWrapper.
Definition at line 215 of file VirtualAnalogWrapper.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 207 of file VirtualAnalogWrapper.cpp.
|
overridevirtual |
Detach the object (you must have first called attach).
Implements yarp::dev::IMultipleWrapper.
Definition at line 254 of file VirtualAnalogWrapper.cpp.
|
overridevirtual |
Open the DeviceDriver.
config | is 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). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 110 of file VirtualAnalogWrapper.cpp.
|
delete |
|
delete |
bool VirtualAnalogWrapper::perform_first_check | ( | int | elems | ) |
Definition at line 270 of file VirtualAnalogWrapper.cpp.
|
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 289 of file VirtualAnalogWrapper.cpp.
|
protected |
Definition at line 106 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 105 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 104 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 103 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 99 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 97 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 101 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 109 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 108 of file VirtualAnalogWrapper.h.