1 Preface
Overview
What is Haptics?
Audience
Resources for Learning the Openhaptics Toolkit
The Developer Support Center
2 Introduction
What is Openhaptics 3.5.0?
QuickHaptics Micro API Classes
DeviceScape Class
QHWIN32 or QHGLUT Class
World Space
Camera
Shape Class
Cursor Class
Design of a Typical QuickHaptics Micro API Program
Overview of HLAPI vs. HDAPI
When to Use One Over the Other
What Parts Can be Used Together
Servo Loop
3 QuickHaptics Micro API Programming
Introduction
Choosing Win32 API vs. GLUT
Initial Declarations for Win32 vs. GLUT Programs
Win32 API
GLUT: OpenGL Utility Toolkit
Conventions Used in QuickHaptics Examples
Example 1 - Creating a Shape (SimpleShere)
Example 2 - Adding Texture and Motion (Earthspin)
Example 3 - Defining Multiple Primitive Objects (ComplexScene)
Box Parameters
Remaining Shapes
Text
EXAMPLE 4—TRIMESH MODELS AND EVENT CALLBACKS (PICKAPPLES)
EXAMPLE 5—MULTIPLE WINDOWS AND VIEWS (MULTIPLEWINDOWS)
Enabling Haptics in a Window
Assigning Window Titles
Setting Camera Views
EXAMPLE 6—USING DEFORMATION PROPERTIES (SPONGYCOW)
EXAMPLE 7—DEFINING CUSTOM FORCE LAWS (SKULLCOULOMBFORCE)
Declaring and Creating Objects
GraphicsCallback Function
startServoLoopCallback Function
dataobject Pointer
startEffectCB and stopEffectCB Functions
computeForceCB Function
forcefield Function
EXAMPLE 8—HAPTIC RENDERING OF LARGE MODELS (SHAPEDEPTHFEEDBACK)
EXAMPLE 9—A DENTAL SIMULATOR (TEETHCAVITYPICK)
dOxygen Manual pages
TriMesh Class Reference
Public Member Functions
Summary of Default Values
4 CREATING HAPTIC ENVIRONMENTS
Introduction to Forces
Force Rendering
Motion Dependent
Time Dependency
Contact and Constraints
Combining Haptics with Graphics
State Synchronization
Event Handling
Combining Haptics with Dynamics
HAPTIC UI CONVENTIONS
Gravity Well Selection
View-Apparent Gravity Well Selection
Depth Independent Manipulation
Relative Transformations
Coupling Visual and Haptic Cues
Stabilize Manipulation with Motion Friction
5 SETTING UP MICROSOFT VISUAL STUDIO DEVELOPER ENVIRONMENT
Choosing the Application Platform and Configuration
Setup the Character Set
Setup the Include Directories
Setup the Runtime Library
Setup the Library Directories
Setup the Library Dependencies
6 HDAPI OVERVIEW
Getting Started
The Device
The Scheduler
Developing HDAPI Applications
Microsoft WIN32 Versus Console Applications
Design of Typical HDAPI Program
7 HDAPI PROGRAMMING
Haptic Device Operations
Initialization
Current Device
Device Capabilities
Haptic Frames
Scheduler Operations
Synchronous Calls
Asynchronous Calls
State
Get State
Set State
Synchronization of State
Calibration Interface
Types of Calibration
Querying Calibration
When to Calibrate
Calling Calibration
Force/Torque Control
Haptic Device Cartesian Space
Touch (Phantom) Joint Space
Force/Torque Control Parameters
Syntax and Examples
DAC Values for Motors
Error Reporting and Handling
Cleanup
8 HLAPI OVERVIEW
Generating Forces
Leveraging OPENGL
Proxy Rendering
Design of Typical HLAPI Program
Threading
Servo Thread
Collision Thread
9 HLAPI PROGRAMMING
Device Setup
Rendering Contexts
Haptic Frames
Rendering Shapes
Begin/End Shape
Shape Identifiers
Shape Types
Depth Buffer
Feedback Buffer
Optimizing Shape Rendering
Adaptive Viewport
Haptic Camera View
Culling with Spatial Partitions
Which Shape Type Should I Use?
Mapping Haptic Device to Graphics Scene
The Haptic Workspace
Matrix Stacks
Touch-workspace Matrix
View-touch Matrix
Mapping
Basic Mapping
Advanced Mapping
Drawing a 3D Cursor
Material Properties
Stiffness
Damping
Friction
Popthrough
Surface Constraints
Snap Distance
Combining Constraints
Pushing and Popping Attributes
Effects
Events
Event Callbacks
Types of Events
Events and Threading
Calibration
Dynamic Objects
Direct Proxy Rendering
SCP Depth of Penetration
Multiple Devices
Extending HLAPI
Intersect Callback
Closest Feature Callback
Custom Effects
Integrating HDAPI and HLAPI
10 DEPLOYING OPENHAPTICS APPLICATIONS
Run-time Configuration
Deployment Licensing
11 UTILITIES
Vector/Matrix Math
Vector Utilities
Default constructor
Constructor from three values
Constructor from an array
Assignment
Usual operations:
Magnitude:
Dot product:
Cross product:
Normalize:
Matrix Utilities
Default constructor
Constructor from sixteen values
Constructor from an array
Assignment
Get values
Usual operations
Invert
Transpose:
Create a rotation
Workspace to Camera Mapping
Snap Constraints
C++ Haptic Device Wrapper
HDUERROR
HDURECORD
Haptic Mouse
Setup
Haptic Mouse Transitioning
Customized Workspace Mapping
Additional Resources
12 TROUBLESHOOTING
Device Initialization
Frames
Thread Safety
Race Conditions
Calibration
Buzzing
Check that the scheduler is not being overloaded.
Scale down forces
Check the position of the device
Check force calculations
Add damping/smoothing
Detect and abort
Force Kicking
No Forces
Device Stuttering
Error Handling