WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-05-2007, 02:58 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
hd in Vizard3.0

Hello. When I run my old code from Vizard 2.5 using the hd with just
these simple lines:


import hd


box = viz.add('box.wrl')
hd.add(box)


The program crashes, with the error:


** ERROR: Failed to load plug-in: 'hd2.dlm'
Loading File: box_textured.wrl
Traceback (most recent call last):
File "<string>", line 11, in ?
File "test.py", line 22, in ?
** Load Time: 0.73 seconds
Scaling image 'beige.jpg' from (120,120) to (128,128)
hd.add(box)
File "C:\Program
Files\WorldViz\Vizard30\python\hd.py", line 244, in add
node._hapticID_ = _hd_.get()[0]
IndexError: list index out of range"



Now I can solve the problem by simply copying and pasting the hd.py from
the python folder in Vizard2.5 into the python folder in Vizard3.0. Is
this an error in the hd file? Should it be replaced?


Thanks!
Maria
Reply With Quote
  #2  
Old 07-05-2007, 04:25 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Vizard 3.0 uses OpenHaptics 2.0 by default. If you want to use an earlier version of OpenHaptics then simply add the following line of code before you import the hd module:
Code:
viz.setOption('hd.version',1)
import hd #Will use OpenHaptics 1.0
Reply With Quote
  #3  
Old 07-08-2007, 04:43 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Thanks. Another question about the HD - if I have invisible objects and I touch them with the haptic pen will the haptic pen list them in it's touch objects?
Reply With Quote
  #4  
Old 07-09-2007, 10:58 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

When you set a node invisible, it will still by touchable in the haptic environment. You can make it invisible to the haptic environment by using the <node3d>.enablehd() command.
Reply With Quote
  #5  
Old 07-09-2007, 09:46 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Quote:
Originally Posted by farshizzo View Post
Hi,

Vizard 3.0 uses OpenHaptics 2.0 by default. If you want to use an earlier version of OpenHaptics then simply add the following line of code before you import the hd module:
Code:
viz.setOption('hd.version',1)
import hd #Will use OpenHaptics 1.0
Thanks. What does the version 1 lack that version 2 has? Where can I obtain version 2 if I need it?
Reply With Quote
  #6  
Old 07-10-2007, 09:11 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The hd module is identical for both version 1 and 2. The OpenHaptics 2.0 runtime is not binary compatible with 1.0, so we need to compile a separate plugin for each version. You can purchase OpenHaptics 2.0 from SensAble.
Reply With Quote
  #7  
Old 07-19-2007, 05:14 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
I have a question. I opened the openhaptics docs and they have all sorts of cool examples, but they are all C code. Does vizard support anything besides the spring, friction, and others in the example folder? Where can I find more documention?
Reply With Quote
  #8  
Old 07-19-2007, 08:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

There are some OpenHaptics features that Vizard still does not support. If there is a specific feature you need we can add it for you.
Reply With Quote
  #9  
Old 07-25-2007, 04:24 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
That's really kind of you. Perhaps the effect I need is already available - basically I am trying to simulate the feeling of pushing a screw into a hole. I created a box with holes in 3dsmax and screws that fit. I made the box have stiffness 1 as well as the screws. I ran into the problem that the haptic pen is only the point - I want the user to feel resistance when the SCREW that the pen is holding is in contact with the box.

My first attempt to solve this was by using collision detection - I thought I could apply a manual force to the pen when I knew the screw and box were colliding. I never succeeded in getting any collision callbacks to work though.

Then I did some math to allow me to know when the screw was touching the box and applied a manual constant force effect to the pen. This worked but was not nice because there was a little jerk when the ce was applied to the pen.

What I really want is the same smooth feeling of resistance you feel when you run the pen tip across the box. I then decided to make it look fake to the user - I hide the pen tip on the back of the screw and put a fake marker on the front of the screw, so then the user feels the right stiffness when the back of the screw hits the box.

This is not terrible, but now I lack the side to side resistance when the screw is in the hole. The screws can't push through the box except over a hole. Yet I want the user to feel the screw is snug in the hole. Right now there is no side to side resistance to keep the screw in the hole. I also don't want the pen to be able to go behind the box and get stuck.

I tried making the box very thick in the z direction, but I still do not get resistance.

Do you have any ideas for creating the effect I want?

Also, is there any command to make the hd pen jump to a certain spot? hd.translate translates the workspace. I want the workspace to stay centered at 000 bu to be able to make the pen tip jump to whatever location I want.

I have attached an old version of the project that uses the constant effect. If you click on a screw you can pick it up and drag it.

Run MOF_Ver1_Demo

Thanks
Reply With Quote
Reply


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


All times are GMT -7. The time now is 12:05 PM.


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