View Single Post
  #4  
Old 05-31-2016, 05:00 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
It does not look like there is a velocity command. The available commands can be found in the Sensable and standard sensor pages in the Vizard help. You could calculate the velocity between frames or some other time interval. For example:

Code:
import viz
import vizact
import vizmat

viz.go()
viz.addChild('piazza.osgb')
device = sensable.addHapticDevice()

lastPos = [0,0,0]
def calculateVelocity():
	global lastPos
	pos = device.getPosition()
	distance = vizmat.Distance(lastPos,pos)
	velocity = distance/viz.elapsed()
	lastPos = pos
	
vizact.ontimer(0.1,calculateVelocity)
Reply With Quote