![]() |
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
How to get real time position of a object which is connected to a haptic device
How to get real time position of a object which is connected to a haptic device?
My haptic device is phantom omni I tried to print it out, it shows [0,0,0] all the time. I need to read the real time position and then apply different functions based on different positions. |
|
#2
|
|||
|
|||
|
Do you get changing positions with the following code?
Code:
import viz
import vizact
viz.go()
sensable = viz.add('sensable.dle')
device = sensable.addHapticDevice()
def printPosition():
print device.getPosition()
vizact.ontimer(0,printPosition)
|
|
#3
|
|||
|
|||
|
Thanks Jeff.
May I ask how can I get the real-time spring force I applied? I tried <effect>.getMagnitude(). But what I get is a constant I set in addSpringEffect. <device>.addSpringEffect( gain=None ,magnitude=None ,position=None ,referenceFrame=None ) Position here represents the effect position, right? And what is the relationship between magnitude and spring force? In F = k(P-X), magnitude is the max spring force? |
|
#4
|
|||
|
|||
|
Quote:
Code:
import vizmat def getSpringForce(): #get effect position and gain. P = springEffect.getPosition() k = springEffect.getGain() #get haptic device position X = device.getPosition() #return force return k * vizmat.Distance(P,X) Quote:
Quote:
|
|
#5
|
|||
|
|||
|
Thank you so much!!!
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Real time collision and object navigation | sunil.nair | Vizard | 11 | 10-04-2013 09:10 PM |
| how to hide 3D virtual object behind real object? | Darkmax | Vizard | 3 | 05-29-2012 10:39 AM |
| Time - seconds are longer than real seconds | clowenth | Vizard | 6 | 05-19-2010 10:14 AM |
| Can you link the position of a tracker to the orientation of an object? | michaelrepucci | Vizard | 1 | 09-19-2008 11:23 AM |
| timer question | Elittdogg | Vizard | 5 | 10-10-2007 03:49 PM |