H3D API  2.4.1
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
H3D::SpaceWareHapticsDevice Class Reference

A fake haptics device where the position and orientation is controlled via a SpaceWare device such as the SpaceMouse or SpaceTraveller. More...

#include <H3D/SpaceWareHapticsDevice.h>

Inheritance diagram for H3D::SpaceWareHapticsDevice:
Inheritance graph

Classes

class  SetMainButton
 SetMainButton is set to true if any of the buttons on the SpaceWare device is pressed. More...
 

Public Member Functions

 SpaceWareHapticsDevice (Inst< SFVec3f > _devicePosition=0, Inst< SFRotation > _deviceOrientation=0, Inst< TrackerPosition > _trackerPosition=0, Inst< TrackerOrientation > _trackerOrientation=0, Inst< SFMatrix4f > _positionCalibration=0, Inst< SFRotation > _orientationCalibration=0, Inst< SFVec3f > _proxyPosition=0, Inst< WeightedProxy > _weightedProxyPosition=0, Inst< SFFloat > _proxyWeighting=0, Inst< SFBool > _mainButton=0, Inst< SFBool > _secondaryButton=0, Inst< SFInt32 > _buttons=0, Inst< SFVec3f > _force=0, Inst< SFVec3f > _torque=0, Inst< SFInt32 > _inputDOF=0, Inst< SFInt32 > _outputDOF=0, Inst< SFInt32 > _hapticsRate=0, Inst< SFInt32 > _desiredHapticsRate=0, Inst< SFNode > _stylus=0, Inst< SFHapticsRendererNode > _hapticsRenderer=0, Inst< MFVec3f > _proxyPositions=0, Inst< SFBool > _followViewpoint=0, Inst< GetValueSafeField< SFVec3f > > _set_devicePosition=0, Inst< GetValueSafeField< SFRotation > > _set_deviceOrientation=0, Inst< SetMainButton > _set_mainButton=0, Inst< SFFloat > _posSensitivity=0, Inst< SFFloat > _ornSensitivity=0)
 Constructor.
 
virtual void updateDeviceValues ()
 updateDeviceValues is specialized to update the values of the SpaceWareSensor.
 
- Public Member Functions inherited from H3D::H3DFakeHapticsDevice
 H3DFakeHapticsDevice (Inst< SFVec3f > _devicePosition=0, Inst< SFRotation > _deviceOrientation=0, Inst< TrackerPosition > _trackerPosition=0, Inst< TrackerOrientation > _trackerOrientation=0, Inst< SFMatrix4f > _positionCalibration=0, Inst< SFRotation > _orientationCalibration=0, Inst< SFVec3f > _proxyPosition=0, Inst< WeightedProxy > _weightedProxyPosition=0, Inst< SFFloat > _proxyWeighting=0, Inst< SFBool > _mainButton=0, Inst< SFBool > _secondaryButton=0, Inst< SFInt32 > _buttons=0, Inst< SFVec3f > _force=0, Inst< SFVec3f > _torque=0, Inst< SFInt32 > _inputDOF=0, Inst< SFInt32 > _outputDOF=0, Inst< SFInt32 > _hapticsRate=0, Inst< SFInt32 > _desiredHapticsRate=0, Inst< SFNode > _stylus=0, Inst< SFHapticsRendererNode > _hapticsRenderer=0, Inst< MFVec3f > _proxyPositions=0, Inst< SFBool > _followViewpoint=0, Inst< GetValueSafeField< SFVec3f > > _set_devicePosition=0, Inst< GetValueSafeField< SFRotation > > _set_deviceOrientation=0, Inst< GetValueSafeField< SFBool > > _set_mainButton=0, Inst< GetValueSafeField< SFBool > > _set_secondaryButton=0, Inst< GetValueSafeField< SFBool > > _set_pauseDeviceTransform=0, Inst< SFFloat > _gripperAngle=0, Inst< GetValueSafeField< SFFloat > > _set_gripperAngle=0, Inst< SFFloat > _gripperForce=0)
 Constructor.
 
 ~H3DFakeHapticsDevice ()
 Destructor.
 
- Public Member Functions inherited from H3D::H3DHapticsDevice
 H3DHapticsDevice (Inst< SFVec3f > _devicePosition=0, Inst< SFRotation > _deviceOrientation=0, Inst< TrackerPosition > _trackerPosition=0, Inst< TrackerOrientation > _trackerOrientation=0, Inst< SFMatrix4f > _positionCalibration=0, Inst< SFRotation > _orientationCalibration=0, Inst< SFVec3f > _proxyPosition=0, Inst< WeightedProxy > _weightedProxyPosition=0, Inst< SFFloat > _proxyWeighting=0, Inst< SFBool > _mainButton=0, Inst< SFBool > _secondaryButton=0, Inst< SFInt32 > _buttons=0, Inst< SFVec3f > _force=0, Inst< SFVec3f > _torque=0, Inst< SFInt32 > _inputDOF=0, Inst< SFInt32 > _outputDOF=0, Inst< SFInt32 > _hapticsRate=0, Inst< SFInt32 > _desiredHapticsRate=0, Inst< SFNode > _stylus=0, Inst< SFHapticsRendererNode > _hapticsRenderer=0, Inst< MFVec3f > _proxyPositions=0, Inst< SFBool > _followViewpoint=0, Inst< SFVec3f > _deviceVelocity=0, Inst< TrackerVelocity > _trackerVelocity=0, Inst< SFString > _profiledResult=0, Inst< SFVec3f > _deviceAngularVelocity=0, Inst< TrackerAngularVelocity > _trackerAngularVelocity=0)
 Constructor.
 
virtual ~H3DHapticsDevice ()
 Destuctor.
 
Vec3f getPreviousProxyPosition (unsigned int layer=0)
 Get the proxy position from the previous loop for a certain layer. More...
 
const vector< Vec3f > & getPreviousProxyPositions ()
 Get all previous proxy positions.
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
HAPI::HAPIHapticsDevice * getHAPIDevice ()
 Get the HAPIHapticsDevice that is encapsulated by this node.
 
virtual ErrorCode initDevice ()
 Does all the initialization needed for the device before starting to use it.
 
virtual ErrorCode releaseDevice ()
 Perform cleanup and let go of all device resources that are allocated. More...
 
virtual ErrorCode enableDevice ()
 Enable the device. Positions can be read and force can be sent.
 
virtual ErrorCode disableDevice ()
 Temporarily disable the device. More...
 
H3DUtil::PeriodicThreadBasegetThread ()
 Get the thread that is used to run this haptics device.
 
virtual void postInit ()
 This function is called for all devices in a DeviceInfo node for which the initDevice has been called. More...
 
virtual void preRender ()
 This function is called at the start of each scenegraph loop before any calls to other HapticDevice functions and can be used to perform any necessary operation that are needed for the other calls to function properly.
 
virtual void postRender ()
 This function is called at the end of each scenegraph loop after all calls to other HapticDevice functions and can be used to perform any necessary operation that are needed.
 
virtual void renderShapes (const HapticShapeVector &shapes, unsigned int layer=0)
 Perform haptic rendering for the given HapticShape instances. More...
 
virtual void renderStylus ()
 Render the stylus of the device wint OpenGL.
 
virtual void renderEffects (const HapticEffectVector &effects)
 Perform haptic rendering for the given HAPIForceEffect instances. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual void render ()
 the render() function is used for the depth-first rendering traversal of the scene-graph. More...
 
virtual void traverseSG (TraverseInfo &ti)
 traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 

Public Attributes

H3DUniquePtr< SFFloatposSensitivity
 posSensitivity defines how fast the movement of the haptics device should be when using the SpaceWare device. More...
 
H3DUniquePtr< SFFloatornSensitivity
 ornSensitivity defines how fast the orientation of the haptics device should move when using the SpaceWare device. More...
 
- Public Attributes inherited from H3D::H3DFakeHapticsDevice
H3DUniquePtr< GetValueSafeField< SFVec3f > > set_devicePosition
 The set_devicePosition field can be used to set the devicePosition field of the haptics device. More...
 
H3DUniquePtr< GetValueSafeField< SFRotation > > set_deviceOrientation
 The set_deviceOrientation field can be used to set the deviceOrientation field of the haptics device. More...
 
H3DUniquePtr< GetValueSafeField< SFBool > > set_mainButton
 The set_mainButton field can be used to set the mainButton field of the haptics device. More...
 
H3DUniquePtr< GetValueSafeField< SFBool > > set_secondaryButton
 The set_secondaryButton field can be used to set the secondaryButton field of the haptics device. More...
 
H3DUniquePtr< GetValueSafeField< SFBool > > set_pauseDeviceTransform
 The set_pauseDeviceTransform field can be used to pause the transform of the haptics device. More...
 
H3DUniquePtr< SFFloatgripperAngle
 Output field for the gripper angle. More...
 
H3DUniquePtr< GetValueSafeField< SFFloat > > set_gripperAngle
 The set_gripperAngle field can be used to set the gripperAngle field. More...
 
H3DUniquePtr< SFFloatgripperForce
 Output field for the gripper force. More...
 
- Public Attributes inherited from H3D::H3DHapticsDevice
H3DUniquePtr< SFVec3fdevicePosition
 The position of the device given in the coordinate system of the device. More...
 
H3DUniquePtr< SFRotationdeviceOrientation
 The orientation of the device given in the coordinate system of the device. More...
 
H3DUniquePtr< TrackerPositiontrackerPosition
 The position of the device in the world coordinates of the API. More...
 
H3DUniquePtr< TrackerOrientationtrackerOrientation
 The orientation of the device in the world coordinates of the API. More...
 
H3DUniquePtr< SFMatrix4fpositionCalibration
 The calibration matrix between devicePosition and trackerPosition. More...
 
H3DUniquePtr< SFMatrix4fadjustedPositionCalibration
 The calibration matrix between devicePosition and trackerPosition adjusted with the movement of the viewpoint.
 
H3DUniquePtr< SFRotationorientationCalibration
 The calibration rotation between deviceOrientation and trackerOrientation. More...
 
H3DUniquePtr< SFRotationadjustedOrnCalibration
 The calibration rotation between deviceOrientation and trackerOrientation adjusted with the movement of the viewpoint.
 
H3DUniquePtr< SFVec3fproxyPosition
 The position of the proxy used in the haptic rendering(layer 0). More...
 
H3DUniquePtr< WeightedProxyweightedProxyPosition
 A weighted position between proxyPosition and trackerPosition. More...
 
H3DUniquePtr< SFFloatproxyWeighting
 The weighting between proxyPosition and trackerPosition when calculating weightedProxyPosition. More...
 
H3DUniquePtr< SFBoolmainButton
 The state of the main button(button 0). More...
 
H3DUniquePtr< SFBoolsecondaryButton
 The state of the secondary button (button 1). More...
 
H3DUniquePtr< SFInt32buttons
 The state of all buttons. More...
 
H3DUniquePtr< SFVec3fforce
 The approximation of the force that has been rendered during the last scenegraph loop. More...
 
H3DUniquePtr< SFVec3ftorque
 The approximation of the torque that has been rendered during the last scenegraph loop. More...
 
H3DUniquePtr< SFInt32inputDOF
 The degrees of freedom supported as input. More...
 
H3DUniquePtr< SFInt32outputDOF
 The degrees of freedom supported as output, i.e. More...
 
H3DUniquePtr< SFInt32hapticsRate
 The update rate of the servoloop of the H3DHapticsDevice. More...
 
H3DUniquePtr< SFInt32desiredHapticsRate
 The desired update rate of the servoloop of the H3DHapticsDevice. More...
 
H3DUniquePtr< SFTimehapticsLoopTime
 The time spent in the last haptics loop(in seconds) A value of -1 means that no haptics loop has been completed yet. More...
 
H3DUniquePtr< SFNodestylus
 The Node used as the visual representation of the stylus. More...
 
H3DUniquePtr< SFBoolinitialized
 true if the device is initialized and ready for calls to updateDeviceValues() and renderObjects(). More...
 
H3DUniquePtr< SFHapticsRendererNodehapticsRenderer
 Specifies the haptics rendering algorithm to use to generate forces from geometric shapes. More...
 
H3DUniquePtr< MFVec3fproxyPositions
 The positions of the proxies for each layer used in haptic rendering(layer 0). More...
 
H3DUniquePtr< SetEnabledset_enabled
 Enable/disable the device. More...
 
H3DUniquePtr< SFBoolenabled
 true if the device is enabled, e.g. More...
 
H3DUniquePtr< SFBoolfollowViewpoint
 true if the device should follow the viewpoint. More...
 
H3DUniquePtr< SFVec3fdeviceVelocity
 The velocity of the device in the coordinate system of the device. More...
 
H3DUniquePtr< TrackerVelocitytrackerVelocity
 The velocity of the device in the world coordinates of the API. More...
 
H3DUniquePtr< SFFloatforceLimit
 The maximum force(in N) we want the device to render. More...
 
H3DUniquePtr< SFFloatforceScale
 Set the scaling of the output force. More...
 
H3DUniquePtr< SFBooldeadmansSwitch
 This is an alternative operational safety mode. More...
 
H3DUniquePtr< SFFloattorqueLimit
 The maximum torque(in Nm) we want the device to render. More...
 
H3DUniquePtr< SFVec3fdeviceAngularVelocity
 The angular velocity of the device in the coordinate system of the device. More...
 
H3DUniquePtr< TrackerAngularVelocitytrackerAngularVelocity
 The angular velocity of the device in the world coordinates of the API. More...
 

Static Public Attributes

static H3DNodeDatabase database
 Node database entry.
 
- Static Public Attributes inherited from H3D::H3DFakeHapticsDevice
static H3DNodeDatabase database
 Node database entry.
 
- Static Public Attributes inherited from H3D::H3DHapticsDevice
static H3DNodeDatabase database
 Node database entry.
 

Protected Attributes

AutoRef< SpaceWareSensorspaceware_sensor
 The SpaceWareSensor node used to control the haptics device.
 
- Protected Attributes inherited from H3D::H3DHapticsDevice
TimeStamp last_effect_change
 The time for the last call to the renderEffects function.
 

Additional Inherited Members

- Public Types inherited from H3D::H3DHapticsDevice
typedef SFMatrix4f PosCalibration
 
typedef SFRotation OrnCalibration
 
- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 

Detailed Description

A fake haptics device where the position and orientation is controlled via a SpaceWare device such as the SpaceMouse or SpaceTraveller.

Examples:

Internal routes:

Member Data Documentation

◆ ornSensitivity

H3DUniquePtr< SFFloat > H3D::SpaceWareHapticsDevice::ornSensitivity

ornSensitivity defines how fast the orientation of the haptics device should move when using the SpaceWare device.

Access type: inputOutput
Default value: 0.05

Referenced by SpaceWareHapticsDevice().

◆ posSensitivity

H3DUniquePtr< SFFloat > H3D::SpaceWareHapticsDevice::posSensitivity

posSensitivity defines how fast the movement of the haptics device should be when using the SpaceWare device.

Access type: inputOutput
Default value: 0.0001

Referenced by SpaceWareHapticsDevice().


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