logo资料库

OpenHaptics_Toolkit_ProgrammersGuide3.5.pdf

第1页 / 共155页
第2页 / 共155页
第3页 / 共155页
第4页 / 共155页
第5页 / 共155页
第6页 / 共155页
第7页 / 共155页
第8页 / 共155页
资料共155页,剩余部分请下载后查看
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
OpenHaptics® Toolkit Version 3.5.0Programmer’s Guide Original Instructions
TABLE OF CONTENTS 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 20 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 2 2 2 2 3 3 4 4 5 6 6 6 6 9 9 10 10 11 11 11 13 13 13 13 13 14 14 15 16 17 19 20 20 25 26 27 27 28 30 40
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 40 41 41 41 41 43 44 50 59 59 59 60 63 64 64 64 65 66 66 67 67 67 67 68 68 68 68 68 68 69 70 71 72 73 73 75 76 77 77 77 78 81 82 83 84 84
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 84 84 85 85 86 86 87 87 88 88 89 89 89 89 89 91 91 91 92 93 93 94 94 95 96 96 96 97 98 98 98 99 100 100 100 102 102 102 102 103 104 105 105 106 106 108 108
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: 108 109 109 109 109 110 110 111 112 112 112 113 113 113 114 115 115 116 117 117 118 119 119 120 122 122 123 123 123 124 125 127 128 128 128 130 131 131 131 131 131 131 131 131 131 131 131
Matrix Utilities Default constructor Constructor from sixteen values Constructor from an array Assignment Get values Usual operations Invert 132 Transpose: Create a rotation Workspace to Camera Mapping Snap Constraints C++ Haptic Device Wrapper HDUERROR HDURECORD Haptic Mouse Setup 137 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 132 132 132 132 132 132 132 132 133 133 135 135 136 136 137 138 138 138 139 139 139 140 142 142 143 145 145 146 146 146 146 147 148 148 148
Copyright ©2018. 3D Systems, Inc. All rights reserved. The content of this manual is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by 3D Systems, Inc. This document is copyrighted and contains proprietary information that is the property of 3D Systems, Inc. Touch, Geomagic Touch, Geomagic Touch X, Geomagic OpenHaptics, Geomagic, Phantom, Phantom Desktop, Phantom Omni, Sensable, 3D Systems, and the 3D Systems logo are registered trademarks, and Touch is a trademark, of 3D Systems, Inc. Use of the Cubify.com website constitutes acceptance of its Terms of Service and Privacy Policy. Any names, places, and/or events in this publication are not intended to correspond or relate in any way to individuals, groups or associations. Any similarity or likeness of the names, places, and/or events in this publication to those of any individual, living or dead, place, event, or that of any group or association is purely coincidental and unintentional. Warranty No warranties of any kind are created or extended by this publication. 3D Systems warrants that the Touch haptic device will be free from defects in materials and workmanship, during the applicable warranty period, when used under the normal condi- tions described in the documentation provided to you, including the respective User Guide. 3D Systems will promptly repair or replace the Touch, if required, to make it free of defects during the warranty period. This warranty excludes repairs required during the warranty period because of abnormal use or conditions (such as riots, floods, misuse, neglect or improper service by anyone except 3D Systems or its authorized service provider). For consumers who are covered by consumer protection laws or regulations in their country of purchase or, if different, their country of residence, the benefits conferred by our standard warranty are in addition to, and operate concurrently with, all rights and remedies conveyed by such consumer protection laws -and regulations, including but not limited to these additional rights. Limitation of Liability 3D SYSTEMS WILL NOT BE RESPONSIBLE FOR CONSEQUENTIAL, EXEMPLARY OR INCIDENTAL DAMAGES (SUCH AS LOSS OF PROFIT OR EMPLOYEE’S TIME) REGARDLESS OF THE REASON. IN NO EVENT SHALL THE LIABILITY AND/OR OBLIGATIONS OF 3D SYSTEMS ARISING OUT OF THE PURCHASE, LEASE, LICENSE AND/OR USE OF THE EQUIPMENT BY YOU OR OTHERS EXCEED THE PURCHASE PRICE. 1 OpenHaptics Unity Plugin User Guide
1 PREFACE Thank you for downloading the OpenHaptics Toolkit version 3.5.0! Should you encounter any difficulties while setting up or learning the application, we provide a variety of resources to help you learn the product. These are described below in “Resources for Learning the OpenHaptics Toolkit”. Overview This guide explains the OpenHaptics® toolkit. This document will introduce you to the architecture of the toolkit, how it works, and what you can do with it. The guide will also introduce you to the fundamental components of creating haptic environments. and walk you through installing the toolkit and deploying your haptically enabled application. What is Haptics? Haptics is the science of incorporating the sense of touch and control into computer applications through force (kinesthetic) or tactile feedback. By using special input/output devices—called haptic devices—with a haptically enabled application, users can feel and manipulate virtual three-dimensional objects. The type of feedback used to convey the sense of touch is determined by the type of haptic device being used. Application areas for haptics are varied and continually expanding. These include: • • • • • • Surgical simulation and medical training Painting, sculpting, and CAD Military applications such as aerospace and military training and simulation Assistive technology for the blind or visually impaired Simple interaction techniques with the standard user interface such as opening/closing windows, and interacting with menus Gaming Audience This guide assumes that the reader has an intermediate to advanced background in software development, is familiar with the C programming language, and is somewhat familiar with 3D graphics programming. Although the core OpenHaptics toolkit is C based, some of the utility libraries and the source code examples use C++. The QuickHaptics™ micro API is implemented in the C++ programming language and makes use of the Standard Template Library (STL). To learn more about C++ programming, it is recommended that you consult a reference such as the C++ Primer Plus by Stephen Prata or Ivor Horton’s Beginning Visual C++ 2005. To learn more about Open GL® functions and commands, see OpenGL, A Primer by Edward Angel. For additional information about haptics, see the Developer Support Center. 2 OpenHaptics Unity Plugin User Guide
分享到:
收藏