Public Member Functions | |
ControlInterface () | |
ControlInterface (const String &name, const String &type) | |
ControlInterface (const ControlInterface &ci) | |
const String & | getType () const |
virtual Int | inputSize () const=0 |
virtual String | inputName (Int i) const=0 |
virtual Real | getInput (Int i) const=0 |
virtual const Vector & | getInputs () const=0 |
virtual Int | outputSize () const=0 |
virtual String | outputName (Int i) const=0 |
virtual void | setOutput (Int i, Real value)=0 |
virtual void | setOutputs (const Vector &values)=0 |
virtual bool | isSameKindAs (const ReferencedObject &) const |
virtual bool | isSameKindAs (const Object &) const |
virtual String | className () const=0 |
void | reference () const |
bool | unreference () const |
const int | referenceCount () const |
void | enableOnUnreferenceCall (bool enabled) |
virtual void | onUnreference () const |
virtual const String & | getName () const |
Protected Member Functions | |
void | setType (const String &type) |
virtual void | setName (const String &name) |
Protected Attributes | |
int | _refCount |
bool | onUnreferenceEnabled |
Each interface has a number of inputs and outputs. The meaning of these depend on the specific interface type. Interfaces are also named. Both the type and name are Strings. Type strings are title case with an initial capital letter and name strings are title case with an initial lower case letter.
An example specification of a ControlInterface: type: "ManipulatorForceControl" name: "titanJoints" outputs: i:[0..N-1] - N= num of joints: commanded joint force/torque inputs: i:[0..N-1] - N= num of joints: current joint position
The inputs and outputs of each interface are also named. For example, getInputName(0) on the above interface might return "jointPosition1". ControlInterfaces are obtained via the Controllable method getControlInterface(String interfaceName) by name. e.g. ref<ControlInterface> titan( c->getControlInterface("titanJoints") ); They can then be passed to a Contoller that is expecting a ControlInterface of that type. e.g. controller->setControlInterface(titan); will succeed if the controller was expecting an interface of type "ManipulatorForceControl" and will be silently ignored otherwise. Use the Controller::isConnected() to query if a Controller has been connected to all the ControlInterfaces it needs.
Definition at line 66 of file ControlInterface.
|
Definition at line 69 of file ControlInterface. |
|
Definition at line 70 of file ControlInterface. References base. |
|
Definition at line 72 of file ControlInterface. References base. |
|
|
If enabled, each call to unreference() will also call virtual method onUnreference() Definition at line 115 of file Referenced. References base::Referenced::onUnreferenceEnabled. |
|
|
|
Definition at line 44 of file Named. References base::String. Referenced by physics::Collidable::findNamed(), physics::operator<<(), robot::ToolDescription::operator=(), robot::RobotDescription::operator=(), robot::PlatformDescription::operator=(), robot::ManipulatorDescription::operator=(), base::Named::operator=(), and robot::ManipulatorDescription::operator==(). |
|
Definition at line 75 of file ControlInterface. |
|
|
|
|
|
Definition at line 52 of file ReferencedObject. |
|
Called by unreference() if enabled via enableOnUnreferenceCall(true). Typically overridden in subclasses that wish to know about unreference() calls - for example to handle manually breaking cyclic references Reimplemented in robot::control::ControllableAdaptor::AdaptorControlInterface, and robot::control::ControllableAdaptor. Definition at line 121 of file Referenced. Referenced by base::Referenced::unreference(). |
|
|
|
Increment the reference count by one, indicating that this object has another pointer which is referencing it. Definition at line 65 of file Referenced. References base::Referenced::_refCount. |
|
Return the number pointers currently referencing this object. Definition at line 112 of file Referenced. References base::Referenced::_refCount. Referenced by robot::control::ControllableAdaptor::AdaptorControlInterface::onUnreference(). |
|
|
|
|
|
Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the refence count goes to zero, it is assumed that this object is nolonger referenced and is automatically deleted. Definition at line 81 of file Referenced. References base::Referenced::_refCount, Exception, base::Referenced::onUnreference(), and base::Referenced::onUnreferenceEnabled. |
|
Definition at line 136 of file Referenced. Referenced by base::Referenced::reference(), base::Referenced::referenceCount(), base::Referenced::Referenced(), base::Referenced::unreference(), and base::Referenced::~Referenced(). |
|
Definition at line 137 of file Referenced. Referenced by base::Referenced::enableOnUnreferenceCall(), base::Referenced::Referenced(), and base::Referenced::unreference(). |