#include <P_Feedback.h>
Inheritance diagram for Feedback:
Public Methods | |
Feedback () | |
Constructor: initialize variables, but do not establish any connection. More... | |
virtual | ~Feedback () |
virtual const char * | device_name () const=0 |
Device name; must be unique to other Feedback subclasses. More... | |
virtual Feedback * | clone ()=0 |
int | start (const SensorConfig *config) |
Establish connection to remote device in the start() method, not in the constructor. More... | |
virtual void | update ()=0 |
virtual void | addconstraint (float k, const float *location)=0 |
corresponding functions that should just add force on to whatever is already present --- since forces and jacobians add linearly, this works! Units are all NEWTONS. More... | |
virtual void | addforcefield (const float *origin, const float *force, const float *jacobian)=0 |
virtual void | addplaneconstraint (float k, const float *point, const float *normal)=0 |
virtual void | zeroforce ()=0 |
zeros out the constructed force (does not send a message to the haptic until sendforce is called!). More... | |
virtual void | forceoff ()=0 |
stop forces (actually sends a message). More... | |
virtual void | sendforce (const float *initial_pos)=0 |
send the force that has been constructed -- we have this so the force can be built up in several parts, using the additive functions, and no incorrect forces are ever sent. The argument is the current position of the corresponding tracker - it may be used to check that the force doesn't exceed the max. More... | |
void | set_maxforce (float m) |
set/get maxforce The max force is given by "maxforce" - if it is less than 0, no maximum is enforced. More... | |
float | get_maxforce () const |
Protected Methods | |
virtual int | do_start (const SensorConfig *) |
Do device-specific startup configuration. Return success. More... | |
Protected Attributes | |
float | maxforce |
Common notes for VMDTracker, Feedback, and Buttons classes, collectively referred to as devices in what follows.
Constructor: The constructor must not require any input arguments. The reason for this is that an instance of every class is created and held in an associative store so that it can be referenced by its device_name() string. This instantiation is done independently of any device configuration, such as what would be found in the .vmdsensors file. Constructors should thus do nothing but initialize member data to NULL or default values.
device_name(): This pure virtual function supplies a string by which the device can be accessed in an associative store (since classes aren't first-class objects in C++). The name must be unique to that class, among all devices of that type.
clone(): This should do nothing more that return an instance of the class.
do_start(const SensorConfig *): Here's where the action is: This method will be called from the base class start() method after general initialization is done. This method is where the subclass should, e.g., establish a connection to a remote device. If there is no class-specific initialization to do then the subclass need not override this method.
start() should be called only once in a device's life, when it is first added to a Tool.
Definition at line 65 of file P_Feedback.h.
|
Constructor: initialize variables, but do not establish any connection.
Definition at line 68 of file P_Feedback.h. References maxforce. |
|
Definition at line 69 of file P_Feedback.h. |
|
corresponding functions that should just add force on to whatever is already present --- since forces and jacobians add linearly, this works! Units are all NEWTONS.
Implemented in VRPNFeedback. Referenced by Tool::setconstraint. |
|
Implemented in VRPNFeedback. Referenced by Tool::setforcefield. |
|
Implemented in VRPNFeedback. Referenced by Tool::addplaneconstraint, and Tool::setplaneconstraint. |
|
Implemented in VRPNFeedback. |
|
Device name; must be unique to other Feedback subclasses.
Implemented in VRPNFeedback. |
|
Do device-specific startup configuration. Return success.
Reimplemented in VRPNFeedback. Definition at line 118 of file P_Feedback.h. Referenced by start. |
|
stop forces (actually sends a message).
Implemented in VRPNFeedback. Referenced by Tool::forceoff. |
|
Definition at line 112 of file P_Feedback.h. References maxforce. |
|
send the force that has been constructed -- we have this so the force can be built up in several parts, using the additive functions, and no incorrect forces are ever sent. The argument is the current position of the corresponding tracker - it may be used to check that the force doesn't exceed the max.
Implemented in VRPNFeedback. Referenced by Tool::sendforce. |
|
set/get maxforce The max force is given by "maxforce" - if it is less than 0, no maximum is enforced.
Definition at line 111 of file P_Feedback.h. References maxforce. Referenced by VRPNFeedback::do_start, and start. |
|
Establish connection to remote device in the start() method, not in the constructor.
Definition at line 77 of file P_Feedback.h. References do_start, SensorConfig::getmaxforce, and set_maxforce. Referenced by Tool::add_feedback. |
|
Implemented in VRPNFeedback. |
|
zeros out the constructed force (does not send a message to the haptic until sendforce is called!).
Implemented in VRPNFeedback. Referenced by Tool::setconstraint, Tool::setforcefield, and Tool::setplaneconstraint. |
|
Definition at line 115 of file P_Feedback.h. Referenced by Feedback, get_maxforce, VRPNFeedback::sendforce, and set_maxforce. |