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 <networkWrappers/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 () | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. | |
bool | close () override |
Close the DeviceDriver. | |
void | run () override |
Main body of the new thread. | |
bool | attachAll (const yarp::dev::PolyDriverList &p) override |
Attach to a list of objects. | |
bool | detachAll () override |
Detach the object (you must have first called attach). | |
bool | perform_first_check (int elems) |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
DeviceDriver () | |
DeviceDriver (const DeviceDriver &other)=delete | |
DeviceDriver (DeviceDriver &&other) noexcept=delete | |
DeviceDriver & | operator= (const DeviceDriver &other)=delete |
DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
virtual | ~DeviceDriver () |
virtual std::string | id () const |
Return the id assigned to the PolyDriver. | |
virtual void | setId (const std::string &id) |
Set the id for this device. | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. | |
Public Member Functions inherited from yarp::os::Thread | |
Thread () | |
Constructor. | |
virtual | ~Thread () |
Destructor. | |
virtual void | onStop () |
Call-back, called while halting the thread (before join). | |
bool | start () |
Start the new thread running. | |
bool | stop () |
Stop the thread. | |
virtual void | beforeStart () |
Called just before a new thread starts. | |
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(). | |
virtual bool | threadInit () |
Initialization method. | |
virtual void | threadRelease () |
Release method. | |
bool | isStopping () |
Returns true if the thread is stopping (Thread::stop has been called). | |
bool | isRunning () |
Returns true if the thread is running (Thread::start has been called successfully and the thread has not stopped). | |
long int | getKey () |
Get a unique identifier for the thread. | |
int | setPriority (int priority, int policy=-1) |
Set the priority and scheduling policy of the thread, if the OS supports that. | |
int | getPriority () |
Query the current priority of the thread, if the OS supports that. | |
int | getPolicy () |
Query the current scheduling policy of the thread, if the OS supports that. | |
bool | join (double seconds=-1) |
The function returns when the thread execution has completed. | |
void | setOptions (int stackSize=0) |
Set the stack size for the new thread. | |
Public Member Functions inherited from yarp::dev::IMultipleWrapper | |
virtual | ~IMultipleWrapper () |
Destructor. | |
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. | |
static long int | getKeyOfCaller () |
Get a unique identifier for the calling thread. | |
static void | yield () |
Reschedule the execution of current thread, allowing other threads to run. | |
static void | setDefaultStackSize (int stackSize) |
Set the default stack size for all threads created after this point. | |
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 107 of file VirtualAnalogWrapper.h.
|
default |
|
delete |
|
delete |
|
inline |
Definition at line 119 of file VirtualAnalogWrapper.h.
|
overridevirtual |
Attach to a list of objects.
drivers | the polydriver list that you want to attach to. |
Implements yarp::dev::IMultipleWrapper.
Definition at line 243 of file VirtualAnalogWrapper.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 235 of file VirtualAnalogWrapper.cpp.
|
overridevirtual |
Detach the object (you must have first called attach).
Implements yarp::dev::IMultipleWrapper.
Definition at line 282 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 106 of file VirtualAnalogWrapper.cpp.
|
delete |
|
delete |
Definition at line 298 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 319 of file VirtualAnalogWrapper.cpp.
|
protected |
Definition at line 151 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 150 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 149 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 148 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 144 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 142 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 146 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 154 of file VirtualAnalogWrapper.h.
|
protected |
Definition at line 153 of file VirtualAnalogWrapper.h.