Front Page › Forums › H3D API 2.0 Alpha › H3D with Quanser’s 5dof wand
- This topic has 9 replies, 5 voices, and was last updated 15 years, 4 months ago by daniel.
-
AuthorPosts
-
January 22, 2008 at 6:29 pm #730574clemjoeParticipant
I would like to interface Quanser’s 5 DOF Wand with H3D. Can anyone please guide me as to where/how to start?
January 23, 2008 at 7:40 am #730577MarkusKeymasterIn HAPI.h there is a line “//#define HAVE_QUANSERAPI” take away the comments and recompile. When that is done you should choose “QuanserDevice” in the settings program and run H3DLoad or H3DViewer. You could also choose device “None” in the settings program and specify your own DeviceInfo in the X3D-file you load at startup.
The quanser support in H3D Api is untested. If you are running H3D API 2.0 alpha it coult compile. If you try trunk version (which you should, since it contains much less bugs) then I do not even know if it will compile with Quanser support since I have had it disabled for a long time.
January 24, 2008 at 9:07 am #730583MarkusKeymasterI just got to know that I might have misunderstood. H3DAPI does not yet have support for the 5 DOF quanser wand but only for the 3 DOF pantograph. Sorry for being misleading.
So in order to use Quanser with H3D API you would have to edit QuanserHapticsDevice or add your own HAPIHapticsDevice which interfaces to the wand.
January 24, 2008 at 2:42 pm #730586clemjoeParticipantThank you so much for your response!
I have the driver for the wand in Wincon (with Matlab/Simulink). Maybe a good way would be for the haptic device driver to run on one computer with wincon and the H3D loop to run on another computer.
How can I interface these both using UDP/TCP? Can I do this?
January 28, 2008 at 11:57 am #730594MarkusKeymasterH3DAPI does not have any built in functions for interfacing via UDP/TCP (unless I am wrong again :)) so you would have to write your own interfacing for this. Communication with the device should be done at 1kHz if you want to use it as the other devices are used in H3DAPI. (Since the haptics loop is run in 1kHz).
If you want to use a Haptics device with H3D API that is currently not supported you need to subclass HAPIHapticsDevice in HAPI and implement the important virtual functions. For example see the other devices implemented.
February 6, 2008 at 11:12 pm #730639dvembarParticipantI have been able to compile HAPI with the Quanser wand support enabled and export it as a library. The base project dependencies for H3DAPI all compile without any problems. Since I am not using Pahntom, I removed OpenHaptics Renderer from the list of dependencies and from the project solution.
While compiling H3D API, I am having a few problems with the linker. Specifically:
Linking…
Creating library ……..libH3DApi20_vc7_d.lib and object ……..libH3DApi20_vc7_d.exp
LINK : warning LNK4199: /DELAYLOAD:audiofile.dll ignored; no imports found from audiofile.dll
QuanserDevice.obj : error LNK2001: unresolved external symbol “protected: virtual bool __thiscall HAPI::QuanserHapticsDevice::releaseHapticsDevice(void)” (?releaseHapticsDevice@QuanserHapticsDevice@HAPI@@MAE_NXZ)
QuanserDevice.obj : error LNK2001: unresolved external symbol “protected: virtual bool __thiscall HAPI::QuanserHapticsDevice::initHapticsDevice(void)” (?initHapticsDevice@QuanserHapticsDevice@HAPI@@MAE_NXZ)
QuanserDevice.obj : error LNK2001: unresolved external symbol “protected: virtual void __thiscall HAPI::QuanserHapticsDevice::sendOutput(struct HAPI::HAPIHapticsDevice::DeviceOutput &,double)” (?sendOutput@QuanserHapticsDevice@HAPI@@MAEXAAUDeviceOutput@HAPIHapticsDevice@2@N@Z)
QuanserDevice.obj : error LNK2001: unresolved external symbol “protected: virtual void __thiscall HAPI::QuanserHapticsDevice::updateDeviceValues(struct HAPI::HAPIHapticsDevice::DeviceValues &,double)” (?updateDeviceValues@QuanserHapticsDevice@HAPI@@MAEXAAUDeviceValues@HAPIHapticsDevice@2@N@Z)
……..bin/H3DApi20_vc7_d.dll : fatal error LNK1120: 4 unresolved externalsI checked my linker dependencies and I have H3DUtil10_vc7_d and HAPI10_vc7_d libraries included, along with WinCon which is needed for the Quanser wand and shared memory interaction. I am using VC7 with 2.0a version. Any ideas or pointers would be greatly appreciated.
Edit: I looked at the HAPI10_vc7_d.DLL to see if ?initHapticsDevice@QuanserHapticsDevice@HAPI@@MAE_NXZ was being exported and it is not. ?initHapticsDevice@AnyHapticsDevice@HAPI@@MAE_NXZ is being exported. I looked at the class declaration for QuanserHaptics and AnyHapticsDevice, and there was a missing HAPI_API before the QuanserHapticsDevice in the .h file. However, adding it does not make any difference to the exported functions.
February 7, 2008 at 9:38 am #730643MarkusKeymasterIf you read further up in this thread I correct myself and say that H3D API does not support the Quanser wand. If it supports anything it is the phantograph. We have not tested this though, so it could be completely off.
Why it does not export symbols I do not know. Recompiling after adding the HAPI_API to the class name should work. Soemtimes debug-build of vc7 and vc8 misses small changes that are important.
Also check that the definitions of header files and such are correct.
Does it link with some library by Quanser or not? I can not see us adding this library in the code.
Also check so that the functions have the same arguments and such as the virtual functions in HAPIHapticsDevice that they should override.
December 24, 2008 at 9:29 pm #732282axatanParticipantI have the exact same problem. I would like to use the QuanserHapticsDevice as a starting point to create a connection with Simulink/Wincon environment (And eventually drive the haptics device we are developing through H3DAPI).
It looks like the Wincon Shared Memory libraries are supposed to be compiled with Visual Studio 6.0 (and only 6.0). I have some code (unrelated to H3DAPI) for Wincon Shared Memory access and it won’t compile with anything other than Visual Studio 6.0.
And since H3DAPI won’t compile with 6.0, I can’t find anyway out,,
December 28, 2008 at 6:02 pm #732291danielParticipantIs there no way to compile your libraries with 6.0 as a dll and then link to that from H3DAPI which wou compile woth a newer version? I know this is always a mess with different versions of compilers but sometimes it works. I have never used VS6.0 though.
December 28, 2008 at 6:02 pm #726461clemjoeParticipant -
AuthorPosts
- You must be logged in to reply to this topic.