WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-23-2007, 02:18 PM
Jerry Jerry is offline
Member
 
Join Date: Jun 2004
Posts: 105
Intersense reset

According to the help documentation, if I do

ori = viz.add('intersense.dls')
ori.command(2)

ori.get() should come back 0,0,0 for yaw, pitch, and roll, but this
does not happen.

Is there something I'm missing or is this a bug?
Reply With Quote
  #2  
Old 08-23-2007, 02:42 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The command you are issuing will perform all subsequent resets in a local reference frame. You will have to issue a reset() command afterwards and wait a frame for the intersense data to be updated.
Reply With Quote
  #3  
Old 08-28-2007, 11:31 AM
Jerry Jerry is offline
Member
 
Join Date: Jun 2004
Posts: 105
That still doesn't work. If I do this:

ori = viz.add('intersense.dls')
ori.command(2)
ori.reset()
print ori.get()

the values of yaw, pitch, and roll are not equal to zero.

What I want to do is zero all three axes.
Reply With Quote
  #4  
Old 08-28-2007, 02:00 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Are you waiting a frame so the intersense data is updated before issuing the reset command?
Reply With Quote
  #5  
Old 08-28-2007, 02:10 PM
Jerry Jerry is offline
Member
 
Join Date: Jun 2004
Posts: 105
Yes. I have reset() and command() assigned to different
keys. I press the command() key and then, after waiting for
what must be longer than one frame, I press the reset() key.
Reply With Quote
  #6  
Old 08-28-2007, 03: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
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


All times are GMT -7. The time now is 04:19 AM.


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