Overview
Home
Overview
Hardware
News
Download
License
Documentation
Reference
Help
FAQs
Contributing
Contact
Links
GNU/Linux Port
What is Haptik?

The Haptik library is an open source library with a component based architecture that acts as an Hardware Abstraction Layer to provide uniform access to haptic devices.

It does not contain graphic primitives, physics related algorithms or complex class hierarchies, but instead exposes a set of interfaces that hide differences between devices to the applications.
In this way any dependency for a particular hardware device, driver version, sdk related dlls is removed from both code and executables, thus ensuring that your application will always run on any systems no matter what drivers you have installed or not (and even if no real device is present).

Support for each class of devices is provided through dynamically loaded plugins so its easy to add support for new devices and features. At runtime, and only when needed, Haptik loads the plugins and query each one of them for the set of supported devices, and present these informations to the application.
Dynamic loading allows to remove compile-time dependency from a particular set of dlls. In this way, through Haptik, applications always use the highest available driver version for a particular device but can run even on older ones. For example Phantom devices support is provided by three plugins: Phantom42, Phantom40, Phantom31, each one tailored on a particular driver version. Haptik takes care for you of selecting the appropriate one at runtime.

Thanks to its component architecture both backward and future compatibility are guaranteed at binary level with absolutely no need for recompilation, i.e. your application executables will run unchanged on new devices, new drivers, new library and plugin versions.

Haptik has a very simple API. Three simple lines of code are enough to start using any device, and some useful features, like device enumeration, automatic default selection, device info querying, autorecalibration, are already built in.
The Haptik Library is easy to adopt even in already existing projects because it has an absolutely non-invasive API, and supports many different execution models (callback based or polled access) and callback schemes (procedures, object-method) to best fit requirements of different applications. It easily integrates with both OpenGL and DirectX based applications by supporting both coordinate systems and providing data in a format that can be directly used by both APIs.

When using Haptik many lines of code could be erased and only few must be added, so you do not have to re-design your application. Moreover Haptik has no performance impact with respect to direct use of devices native APIs.

Currently bundled plugins contains support for devices from SensAble, Force Dimension and MPB Technologies, software only virtual devices to be used when no hardware is attached and some extended features such as recording/playback of device movements as well as network transparency through any TCP/IP based network.

Haptik is written in C++ but it can be used with many different languages/environments such as Matlab and Simulink, and from Java applications and applets.

For more info please refer to the Documentation Section or check out the FAQs.

Current Feature List
  • x86/x64
  • Device Enumeration
  • Device Info
  • Default device automatic selection
  • Automatic Driver Fallback
  • Multithreaded-aware Internal Synchronization
  • Support for both callbacks and polling
  • Support for direct Object/Method invocation
  • Configurable Callback Rates
  • Configurable Force Feedback Cutoff
  • Support for left-handed (DirectX) and right-handed (OpenGL) coordinate systems
  • Per-application and per-system configuration
  • Centralized Logging Facilities
  • Debug Output to development IDEs
  • Dynamic Loading/Unloading of unused Plugins
  • Torque Support
  • Bundled Plugins for all SensAble PHANToM devices (PHANToM Desktop, Premium, Premium 6DoF and Omni) on drivers version 4.2(required for Omni), 4.0, 3.1
  • Autorecalibration on PHANToM Desktops
  • Bundled Plugin for ForceDimensions Delta 3DoF/6DoF and Omega devices on drivers version 3.1, 3.0
  • Bundled Plugin for MPB Technologies Freedom and Cubic devices
  • Bundled Plugin for Haption Virtuose devices
  • Bundled Plugin for Novint Falcon devices
  • Multithreaded mouse-based virtual device
  • Remote devices support through TCP/IP networks
  • Recording playback capabilities
  • Java JNI Interface
  • Matlab Mex Interface
  • Simulink Interface
  • Python binding
Example Code

This is a minimal sample of using Haptik from C++ (error handling omitted).
A procedure callback is used to implement an horizontal plane.

#include <conio.h>
#include <RSLib\Haptik.hpp>
using namespace RSLib;

void Callback(HaptikData& data)
{	
   data.forceFeedback = Vector3(0, data.position.y < 0 ? -data.position.y : 0, 0);
}

void main()
{
   IHaptikDeviceInterface device;
   device = Haptik(Haptik::LeftHanded).GetHaptikDeviceInterface();
   device->Init( FUNCTION_ADDRESS(Callback) );
   device->Start();
   
   while( !kbhit() );
   
   device->Release();
}
Please note that this is is just one way (procedure callback) of accessing devices through Haptik.
Refer to the Developer's Manual for a description of all allowed usage patterns.
Screenshots

Click to see fullsize images


Mouse Spectre

Java and Java Applets

Matlab/Simulink
Change Log

A software isn't finished until the last user is dead.
-Anonymous
Version 1.2 - March 27th 2014
-------------------------------
Library:      Ported to x64
Skeleton:     Moving to template-based delegates to implement callbacks on x64
Phantom51OH:  New plugin, using OpenHaptics 3.2 to target version 5.1 of Phantom drivers
All:          Moved to Visual Studio 2013
Delta:        Added support for DHD-API 3.5


Version 1.2 - February 17th 2012
-------------------------------
Library:      Fixed bug resulting in overwritten configuration file.
Phantom42OH:  fixed configuration search path for OpenHaptics 3 on Windows 7
Falcon:       workaround for bug in novint drivers affecting hdlGetVersion function


Version 1.2 - January 27th 2011
-------------------------------
Library:      Configuration options exposed to code. Haptik class supports setting handness.
Falcon:       support for Novint Falcon
Phantom42OH:  support for OpenHaptics 3.0
All:          lots of small bug-fixes


Version 1.1rc1 - November 7th 2006
----------------------------------

[20061106]Misc:      Moved all samples to the new RSLib.
[20061106]Setup:     Fixed a bug preventing automatic updates check to work.
[20061106]Misc:      Added a template class for storing interfaces.
[20061102]All:       Most plugins now support per-device settings.
[20061101]Spectre:   Mouse capture frozen due to a wxWidget problem.
[20061030]Spectre:   Spectre devices will be automatically added if needed, and correctly reused.
[20061029]Spectre:   Reimplemented using wxWidgets. Now available on linux, too.
                     Some cool Windows features have been moved to conditional code.
[20061024]Phantom:   Reimplemented using a single callback to work around the umpteenth bug 
                     in the HD-API / OpenHaptics toolkit. This was necessary to cope to 
                     unpredicatable behavior of HD-API which missbeave (without reporting any 
                     error, of course) if devices are inited or callback are scheduled after 
                     the scheduler has started when two omnis are used.
                     - thanks to Simone Tartari for reporting and testing.
[20061022]Setup:     Directories are now added for all flavours of Visual Studio/C++ Express.
[20061022]Setup:     Fixed a bug in the directory-adding utilities.
[20061020]All:       Removed direct use of MessageBoxes.
[20061018]Matlab:    Removed registry access to prevent.
[20061018]Library:   Added a setting to prevent display of splashscreen.
[20061017]All:       Moved (almost) everything to the new RSLib.
[20061002]Virtuose:  Written Virtuose plugin (still alpha).
[20060928]Delta:     Added support for new 3.1beta DHD drivers.
                     - thanks to Francois Conti from Force Dimension for providing the new Omega33.
[20060917]All:       Plugin code factorized into a common skeleton.
[20060901]Delta:     Added support for "Delta.BaseAngleDeg" setting.
[20060725]Python:    Added a prototype python binding using SWIG
                     - thanks to Michael Oren for testing.
[20060628]Freedom:   Fixed a regression bug in the initialization code.
                     - thanks to Iman Brouwer for fixing.
[20060610]Freedom:   Added verbose logging and error reporting.
[20060610]Freedom:   Fixed a bug in the callback affecting Win2K.
[20060610]Delta:     Fixed a bug in the callback affecting Win2K.
[20060528]Phantom42: Added HD-API error reporting.
[20060525]Library:   Added closing notification.
[20060525]Phantom42: Added massive logging.
[20060524]Phantom42: Fixed number of button count for omni devices.
[20060524]Java:      Changed jni and java classes to report also multiple buttons.
                     - thanks to Jonathan Winterflood for reporting.
[20060512]Java:      Repackaged classes in org.haptiklibrary package.
                     - thanks to Ruida Cheng for testing.
[20060517]Library:   Added header compatibility with Visual C++ 2005.
[20060302]Library:   Removed dependancies from boost library.
[20051128]Phantom:   Prevent MessageBoxes if HaptikLibrary.allowMessageBoxes = FALSE.
                     for use with matlab.
[20051124]Setup:     Current User / Local Machine installation.
[20051124]Setup:     Automatic setup of VC Directories.
[20051124]Library:   Haptik now runs also for non-admin users.
[20051123]Phantom42: Errors are logged.
[20051123]Phantom42: Using READ access when opening phantom registry keys 
                     (should run with users privileges now).
[20051123]Library:   Moved from MessageBox to a custom dialog.
[20051122]Setup:     Moving to Inno Setup.
[20051122]Library:   Automatically check for updates during splash screen.
[20051121]Library:   Use HKLM if present otherwise go for HKCU.
[20051119]Spectre:   Fixed regression-bug in Mouse spectre affecting context menu.


Version 1.0final - November 17th 2005
-------------------------------------
All:     Moved to the new RSLib
Library: Preventing buffering of log file to get usable log even when 
         sensable api crashes
Library: Runtime detection of GetModuleHandleEx to allow running on Win2K 
         - thanks to Cord Westhoff for testing
Spectre: Runtime detection of SetLayeredWindowAttributes to allow running 
         on Win2K - thanks to Cord Westhoff for testing
Phantom: Added support for verbose logging
Phantom: Discovered issue with HD.DLL from Open Haptics Academic Edition 
         - thanks to Dominik Schmidt for reporting
Phantom: Added plugin for OpenHaptics and code to recognize 
         loaded HD.DLL version
Matlab:  Added FAQs on matlab error messages
Betamax: Added support for polling mode
Freedom: Completed freedom plugin. Untested.


Version 1.0beta - 17 June 2005
------------------------------

Library: Minor Bug Fixes.
Library: Added configuration option to disable MessageBoxes.
Library: Added TLS usage for temporary data.
Library: Added Partial Unloading of Plugins.
Library: Added Mutex syncronization on IHaptikLibrary and 
         IHaptikLibraryLower interfaces.
Library: Added Output Debug strings on DEBUG builds.
Library: Improved support for TLS data.
Library: Rewritten Initialization code to implement full support for 
         internal-recursion based plugins.
Library: Configuration file now uses "\r\n" for line terminator.
Library: Added detection of Debug Plugins to avoid crashes on unloading.
All:     Expanded IHaptikDevice Interface to include Recalibration,
         Runtime Callback change, user data.
All:     Added an additional UserData struct to Callbacks to allow single 
         callback for multiple devices.
All:     Modified the InvokeCallback function to better support future 
         binary compatibility.
Phantom: Moved 31 & 40 to Intel C++ to compile on Visual C++ 2003. 
         See notes on how to setup system and directories.
Phantom: Added Watchdog timer.
Phantom: Added autocalibration for phantom desktop.
Phantom: Updated Workspace dimensions and limits for all models.
Delta:   Added support for 6DOF, torque, wrist orientatation, 
         maxTorque setting.
Delta:   Removed flag TIME_KILL_SYNCHRONOUS on systems not supporting.
Delta:   Updated Workspace dimensions and limits for all models.
Spectre: Removed flag TIME_KILL_SYNCHRONOUS on systems not supporting.
Spectre: Corrected bug in extraction of LPARAM.
Spectre: Better handling of sticky clicks.
Spectre: Corrected issues with RIGHT HANDED coords wrongly reported.
Spectre: Added Full Torque support.
Matlab:  Added Support for Matlab & Simulink.
Betamax: Implemented a recording/playing prototype.
Java:    Added JNI interface.
Remote:  Added support for direct connection.
Docs:    Added FAQs


Version 0.8 - December 2004
---------------------------

Library: Added checks for missing config file and no plugin loaded.
Library: Dynamic Loading Rewritten.
All:     Minor Bug Fixes.
Spectre: Support for key forwarding added.
Spectre: Support for captured mouse mode added.
Remote:  Support for Direct Connection.


Version 0.7 - June 2004
-----------------------

First Web Release
Last Updated on 2014/03/27 21:17:04 UTC info@haptiklibrary.org