WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-21-2012, 11:38 AM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
SenSable Open Haptics/Vizard SensAble Plugin

Hello All,

I'm using XP 32-bit (Open Haptics 3.0) and Windows 7 64-bit (Open Haptics 3.0) with Vizard 4. I am trying to get the SensAble Vizard Plugin to run, but get the same error on both machines.

sensable3.dle SensAble Extension
** ERROR: Failed to connect to haptic device (Invalid value specified for a function that is attempting to set a value.)
** ERROR: Failed to create extension sensor with sensable3.dle
** ERROR: Flagged linkable failed (linkable is invalid)
** ERROR: Link failed (source linkable is invalid)


Does anyone have any ideas? Same results occur with Open Haptics 2.0.

Thanks!
Reply With Quote
  #2  
Old 09-21-2012, 12:22 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you post your script code?
Reply With Quote
  #3  
Old 09-21-2012, 12:32 PM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
import ctypes
import numpy
import viztask
import time
import threading
nidaq = ctypes.windll.nicaiu # load the DLL
viz.go()

int32 = ctypes.c_long
uInt32 = ctypes.c_ulong
uInt64 = ctypes.c_ulonglong
float64 = ctypes.c_double
TaskHandle = uInt32
read = int32()
# the constants
DAQmx_Val_Cfg_Default = int32(-1)
DAQmx_Val_Volts = 10348
DAQmx_Val_Rising = 10280
DAQmx_Val_FiniteSamps = 10178
DAQmx_Val_ContSamps = 10123
DAQmx_Val_GroupByChannel = 0
DAQmx_Val_GroupByScanNumber= 1 #interleaved
##############################
# initialize variables
taskHandle = TaskHandle(0)
max_num_samples = 2
data = numpy.zeros((max_num_samples,),dtype=numpy.float64 )

print
def CHK(err):
if err < 0:
buf_size = 100
buf = ctypes.create_string_buffer('\000' * buf_size)
nidaq.DAQmxGetErrorString(err,ctypes.byref(buf),bu f_size)
raise RuntimeError('nidaq call failed with error %d: %s'%(err,repr(buf.value)))

#Main Program
CHK(nidaq.DAQmxCreateTask("",ctypes.byref(taskHand le)))
CHK(nidaq.DAQmxCreateAIVoltageChan(taskHandle,"Dev 2/ai0:1","",DAQmx_Val_Cfg_Default,float64(-13.0),float64(13.0),DAQmx_Val_Volts,None))
CHK(nidaq.DAQmxCfgSampClkTiming(taskHandle,"",floa t64(1),DAQmx_Val_Rising,DAQmx_Val_ContSamps,uInt64 (max_num_samples))); #(samples/sec/channel) #ContSamps
CHK(nidaq.DAQmxStartTask(taskHandle))

# stop/clear when I want to end program by mouseclick
def onMouseDown(button):
if button == viz.MOUSEBUTTON_LEFT:
CHK(nidaq.DAQmxStopTask(taskHandle))
CHK(nidaq.DAQmxClearTask(taskHandle))
viz.callback(viz.MOUSEDOWN_EVENT,onMouseDown)

def obtain_value():# continuosly read the DAQ values
CHK(nidaq.DAQmxReadAnalogF64(taskHandle,1,float64(-1),DAQmx_Val_GroupByChannel,data.ctypes.data,max_n um_samples,ctypes.byref(read),None))
print data

x=0
def loop(): # loop which call for DAQ values to continuosly be read
while x < 10:
obtain_value()
viz.director(loop)

viz.clearcolor(1,0,0) #proves I can use vizard interface with continuous data aquisition

# add haptics
sensable=viz.add('sensable3.dle')
device = sensable.addHapticDevice(name = 'Left')
device.workspace.setScale([100,100,100])
device.workspace.setPosition([0,0,0])
[/CODE]
Reply With Quote
  #4  
Old 09-21-2012, 12:35 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Are you sure Left is the correct name of the device? If not, leave the name blank, and the plugin will connect to the default device. If you only have one device connected, then you really don't need to specify a name. Try this instead:
Code:
device = sensable.addHapticDevice()
Reply With Quote
  #5  
Old 09-21-2012, 12:38 PM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
THANKS for fixing my dumb mistake! The name was changed.

Last edited by mhead10; 09-21-2012 at 12:47 PM.
Reply With Quote
  #6  
Old 09-21-2012, 01:07 PM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
I just restarted my computer and the error came back

Anymore thoughts? The error seems to be coming from the
Code:
device = sensable.addHapticDevice()
If I comment it out I get no error. I'm now leaving it blank because I want the default haptic device object to be connected.

Last edited by mhead10; 09-21-2012 at 01:16 PM.
Reply With Quote
  #7  
Old 09-22-2012, 05:45 AM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
I uninstalled and reinstalled Open Haptics 3.0 x64 onto my Windows 7 64-bit system. Now I just get the following error:
Code:
** ERROR: Failed to load plug-in: 'sensable3.dle'
this in turn creates the following as well
Code:
 device = sensable.addHapticDevice()
AttributeError: 'VizExtension' object has no attribute 'addHapticDevice'
I get the same errors with all variation of O.H.'s 3.0 and 2.0. I'm guessing for some reason O.H.'s 3.0 can't be found because I know it's installed. My control panel shot is attached.

Any guesses why Vizard thinks Open Haptics isn't installed?

Thanks
Attached Thumbnails
Click image for larger version

Name:	open_haptics-3.0.jpg
Views:	1695
Size:	23.6 KB
ID:	528  
Reply With Quote
  #8  
Old 09-24-2012, 12:33 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
This seems to indicate that the 32-bit OpenHaptics 3.0 binaries (i.e. hd.dll and hl.dll) were not installed properly. Even if you are running on a 64-bit system, you still need the 32-bit binaries, since Vizard is a 32-bit application.

You might need to double check with SensAble to make sure their 64-bit installer still supports 32-bit applications.
Reply With Quote
  #9  
Old 09-25-2012, 11:29 AM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
To make a long story short, I finally found using the newest driver from SensAble's website (4.2.133) instead of what comes packaged with Open Haptics 3.0 (4.2) fixed my problem.

Thanks for your help farshizzo
Reply With Quote
  #10  
Old 10-06-2012, 10:57 AM
mhead10 mhead10 is offline
Member
 
Join Date: Mar 2012
Posts: 40
If I'm now using two devices, how do I determine what the names are?

For instance, previously I could use one device with the following code:

Code:
device = sensable.addHapticDevice()
However, now I'm using two devices, and thus need to figure out what their names are. Therefore, how do you determine the names? Where are the names assigned? Is this a guess and check method?

I have tried, Left, Right, left, right, 1,2, and 3 and unfortunately I cannot connect.

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Vizard Sensor Plugin farshizzo Plug-in development 25 08-01-2019 01:24 AM
Sensable Open Haptics-"Failed to load plug-in: 'sensable3.dle'" mhead10 Vizard 2 09-04-2012 02:40 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 12:01 PM


All times are GMT -7. The time now is 02:50 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC