Q) What is The Haptik Library?
A) Haptik is a small component-based library to access haptic devices in a uniform way. Using Haptik you write (and compile) once and then your application will run on
every supported devices without caring about driver versions, installed SDKs, missing DLLs. Your applications will run even on systems without a haptic device!
Q) How can I render graphically with Haptik?
A) You can't. Haptik is only for haptic device access. Anyway Haptik easily integrates with both OpenGL and DirectX by supporting both their coordinate systems and
exposing matrices in the format used by both. Moreover it can also be used within higher level frameworks.
Q) What devices are implemented in Haptik?
A) Support for each particular device is actually implemented in plugins and not in the library itself. Currently bundled with Haptiks you get plugins for
PHANToMs and Delta/Omega. Support for other devices is easily added through new plugins, therefore once you got the plugin for a class of devices those devices can be
directly used in any of your existing Haptik applications.
Q) What does it means that Haptik ensures binary compatibility?
A) It means that an application built to use Haptik will always run with never version of libraries and plugins without recompiling even if major changes have
made to the underlying interfaces and protocols.Therefore old applications executables can use new devices without being recompiled.
Q) Is Haptik C++ only?
A) While Haptik is written in C++ (and a bit of x86 assembly) and C/C++ application is the most common usage scenario, it can be used from many
languages/environments. Current release provides binding for Matlab and Simulink as well as for Java, which allows to use Haptik, and thus haptic devices, also through
a web browser. Future release will likely include support for C# and Lua. Only Perl will never be supported for religious issues.
Q) Is there a 64 bits version of Haptik?
A) Yes, but right now only the library itself, the Phantom plugin and the Matlab interface have been ported. Everything else will be ported when needed (i.e. some user requests a certain plugin and takes care of testing everything actually works) as we don't want to release untested software and we don't have the resources/hardware availability anymore to test everything ourselves.
Q) Is there any difference in the API between the 32 bits and 64 bits version of Haptik?
A) Nope. As long as you use the provided macros to pass the callbacks your code stays completely unchanged.
Q) I have read all the FAQs but Haptik still doesn't work as expected! What can I do?
A) Haptik is developed and tested on some Windows XP workstations and on a Kubuntu Linux system, and it should work also on different systems but sometimes a
simple flag in a system API call could cause problems. The Java Runtime Environment (JRE) version is 1.5.0, while the Matlab version is 6.5 R13. If you're not able to
run Haptik on your systems please mail us and we will solve the compatibility problem. If you're succesfully running Haptik on very different systems please
let us know.
Q) Is Haptik still maintained? the website hasn't been updated for ages
During the last years, the plugins have been often updated, the novint falcon for instance is fully supported since beginning of 2008 and the "new" openhaptics 3 is now supported as well.
The core library itself hasn't been actually changed in ages, but we see this as a good thing, a sign that we managed to design it properly back then.
The new 1.2 version contains actually a single very minor change, to fix what was probably the only real design error, forcing applications to specify handness through the configuration file - which can now be controlled in code.
However, given that there has been no mayor feature addition but only bugfixes, SDKs updates and minor improvements we have been mostly sending updated code and new dlls to users requesting them, and a recent change in domain registrar has temporarily "killed" the mailing list, which is still waiting for some spare time to be put back in place.
This is unfortunately a consequence of the way software projects are considered in research... once you cannot "extract" any more papers from them, they stop receiving the time (and the money) you could invest in them at the beginning, so in order not to cut the development itself (as we are the first Haptik users and use it daily) we had to trim down to the minimum all the rest - including taking care of the website - with the unfortunate consequence that the library seems kind of abandoned when it's not.
So the short answer is: rest assured Haptik is alive, with a niche yet loyal set of users, and we'll be willing to help with any issue you may encounter if you plan to use it for your projects.
Q) My device gets not listed by Haptik!
A) Make sure you have a plugin for your device type and that this plugin is listed in the configuration file for your application.
Q) I've added the plugin to the configuration file but my device still doesn't get listed!
A) Make sure your plugin could be loaded. Each plugin has usually dependencies from device related dlls. For example the Phantom31 plugin depends from files that
gets installed with Phantom Drivers 3.1 and could not be loaded by the os if they have not been installed. The Library will report in the Debug Output window of your
debugger and in the log file what plugins gets loaded and what failed.
Q) I have a working application but when using a PHANToM Desktop I get no forces!
A) Try disabling the autorecalibration feature setting Phantom.AutoRecalibratePeriod = 0. If set to a value different than 0 the Phantom plugin automatically
tries every N milliseconds to recalibrate the device if needed. During recalibration forces gets disabled for safety, therefore it can happen that 1) your device easily
loses calibration. 2) plugin start autorecalibrating and suspends forces 3) you did not move the device around the workspace so it didn't recalibrate and forces stay
Q) I'm using OpenGL. The Z axis looks inverted!
A) Make sure you've set in the configuration file LeftHanded = FALSE for every device. This is usually the default if not specified but depends on plugin
For users of version 1.2 just pass RightHanded as an argument to the Haptik class constructor.
Q) I'm using DirectX. The Z axis looks inverted!
A) Make sure you've set in the configuration file LeftHanded = TRUE for every device. By default they're usually set to FALSE.
For users of version 1.2 just pass LeftHanded as an argument to the Haptik class constructor.
Q) I've my fullscreen app which gets blocked when Haptik outputs message boxes!
A) There is an entry in the configuration file, HaptikLibrary.allowMessageBoxes, which usually prevents message boxes to be displayed. Unfortunately no one can
prevent plugins from using message boxes functions (which they do for example when recalibrating). This will surely addressed in a future subversion release by
including the ability for plugins to route messages through the application and not directly to the user.By the way if your application can't survive the focus loss
caused by message boxes as well as unpredicable events like firewalls messages, users alt-tabbing, resolution changes, and all those kind of Unavoidable &
Unpredictable Events (TM) than you should reconsider taking a few hours to make it more robust ;)
Q) I've built a new device. How can I expose through Haptik?
A) You have to build a related plugin. Among the examples there is a template project for Visual Studio .NET that you can use. Support for other compilers will be
provided in a future minor release. By the way you can simply reuse sources for other compilers. If you have problems feel free to contact us, will be glad to help
Q) I would add extended behaviours to a particular device, but I can't modify the plugin. What can I do?
A) Haptik supports a feature we call Internal Recursion, that is a plugin can use devices exposed by other plugins to implement its own, which allows to easily
extend device behaviours by chaining plugins. Among the examples there is a completely useless add-white-noise plugin which shows that.
Q) I have an old application compiled to use Haptik prior of version 1.0. Can I use with version 1.0?
A) No, you can't. Interfaces and structures in 0.X releases where not final, as clearly stated in the documentation, and so they've been changed in 1.0. We have
to choose between saving backward binary compatibility between 0.X and 1.0 or between 1.0 and 1.X...and we choosed the latter. By the way, interfaces and structures in
1.0 are final, that is they will never change, but runtime mechanisms have been implemented in the library and headers have been modified (the reserved fields and
parameters...) in order to allow minor modifications to be included in 1.X versions without breaking code and binary compatibility. Major modifications will be released
with new set of structures and interfaces (i.e. IHaptikDevice2) which will coexist side by side with older ones. Recompiling applications using 0.X versions is usually
enough. The only breaking mod is the Rate(...) method being renamed SetRate(...).
Q) I have an old plugin compiled for Haptik version 0.X. Can I use it with version 1.0?
A) No, you can't. As for the interfaces and structures used by applications also those used by plugins have been changed to allow for minor mods preserving
backward binary compatibility. Recompiling plugins is usually enough. Only check all your calls to IHaptikLibraryLower::SetVariable because a change in the return type
has inverted semantic.
Q) Can I use Haptik from Java?
A) Yes you can. Haptik can be used through a set of JNI (Java Native Interface) based classes which reflects the C++ API.
Q) I am launcing a Java application using Haptik but I get a message from the library which states that Haptik.Config.txt can't be loaded!
A) Make sure a configuration file is in the current directory or in the Haptik.Library.dll directory.
Q) Can I use Haptik in an Java Applet?
A) Yes you can. but you must instruct your Java Runtime Environment (JRE) to allow the loading of the JNI interface. read the next faq...
Q) I have a working Java application using Haptik but when I run it as an applet from the browser I get the following exception
"java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.haptik_java)"
A) Java Applets have more restriction than standard Java applications. The exception is caused by the runtime refusing to load the JNI interface to Haptik
(haptik_java.dll). You can instruct your JRE to grant this loading by adding the following line:
permission java.lang.RuntimePermission "loadLibrary.haptik_java";
in the java.policy file which is usually located on windows systems in
(search your disk for java.policy if you can't find it).
Q) I have a working Java application using Haptik but when I run it from the browser I get the following exception
"java.lang.UnsatisfiedLinkError: no haptik\java in java.library.path"!
A) When running a Java Applet the actual application using Haptik is your browser, therefore dlls loading rules (i.e. a needed dll should be in the same directory of the executable or in the system path) apply to the browser executable and not to the applet page. You must ensure that the haptik_java.dll (as well as all the Haptik binaries) are in a system path directory or in the browser directory. Usually putting all Haptik binaries (including the JNI interface) in the same system-path-included directory is the
Q) I have a working Java application using Haptik but when I run it from the browser I get a message from the library which states that Haptik.Config.txt can't be
A) Same as before. The browser is using Haptik and config file loading rules (i.e. application current directory or directory containing Haptik.Library.dll) apply to the
browser. You must ensure a configuration file is either in the browser current directory (which is different from browser executables directory!) or in the Haptik
binaries directory. If you're experiencing strange behaviours check out the Haptik log file to see if the configuration file getting loaded is the one you want (also
make sure the log file you're reading is not an old one).
Q) I am using a Java3D application.The Z axis looks inverted!
A) Java3D uses a right handed reference frame (just like OpenGL). Make sure your devices are configured as right handed in the used configuration file.
Q) I am using a Haptik Applet but when I make changes to code nothing actually changes!
A) This a more a Java/Browser related issue. Current Java/Browsers implementations are very fragile and not well standardized as they should, therefore
loading/unloading/reloading/caching of applets by browser is almost unpredictable and differs from vendor to vendor and sometimes amongst different versions. The only
way to ensure that your newly compiled applet get used is to close all browser's windows and then reopen a new one.
Q) Can I use Haptik from Matlab?
A) Yes you can. Haptik has a mex interface (haptik_matlab.dll) and a bunch of m-files which implements a class that you can use on the command line or in your m-files.
Q) Can I use Haptik from 64 bit Matlab?
A) Yes you can, but currently only the Phantom plugin has been ported to 64 bits.
Q) Can I use Callbacks in Matlab?
A) Yes you can, but you shouldn't. Unfortunately big parts of latest Matlab versions are written in Java so current releases are
indecently slooow. Moreover it seems impossible to make invocations to the matlab engine from more than one thread without crashing the JVM and so callbacks are
actually implemented using matlab timers, which are based on java timers, which are unreliable, resulting in a poor user experience.
Q) Can I use Haptik in a Simulink model?
A) Yes you can. Haptik has a simulink s-function block which can be used in any model. Remember to add a realtime-delayer
block to ensure your simulation doesn't runs too fast. Support fro real time workshop will be added in a future minor releases.