View Single Post
  #6  
Old 08-28-2007, 02:32 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Sorry, I forgot to mention that these reset modes only work when the intersense is in quaternion mode. After adding the intersense you will need to issue the following command:
Code:
isense.quat()
Also, the built-in link objects already support these reset modes. I would recommend using them since it is independent of the actual hardware. Here is an example script that shows how to use the different link reset modes with an intersense:
Code:
import viz
viz.go()

#Add ground
ground = viz.add('tut_ground.wrl')

#Add intersense
PORT_INTERSENSE = 1
isense = viz.add('intersense.dls')

#Add node
node = viz.add('marker.wrl')
node.translate(0,1.5,4)
viz.startlayer(viz.LINES)
viz.vertexcolor(viz.RED)
viz.vertex(0,0,0)
viz.vertex(0,0.5,0)
viz.endlayer(parent=node)

#Link sensor to node
link = viz.link(isense,node)

#Create keyboard events
vizact.onkeydown('r',isense.reset)
vizact.onkeydown('1',link.reset,viz.RESET_ORI_LOCAL)
vizact.onkeydown('2',link.reset,viz.RESET_ORI_WORLD)
vizact.onkeydown('3',link.reset,viz.RESET_ORI_RAW)
Reply With Quote