WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
  #1  
Old 12-12-2003, 01:21 AM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
Unhappy <viewpoint>.link

Hi,

I tried using the link function for a viewpoint doing what is in the help (something like: myview.link(mysensor))
but I get a error message stating that link() requires 3 arguments (2 given). What is the 3rd argument?

David

Last edited by david; 12-12-2003 at 01:24 AM.
Reply With Quote
  #2  
Old 12-12-2003, 10:34 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi David,

Just pass in 0 as the second argument. In the current version you don't need to do this, you might have an older version.
Reply With Quote
  #3  
Old 12-12-2003, 12:55 PM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
need more explanations

Thanks for your answer Farshizzo but I still don't understand.

I ran the following lines:

headTrack = viz.addsensor('is600')
#is600 is a custom plug-in that can track two sensors
headView = viz.add(viz.VIEWPOINT)
headView.link(headTrack,0)

And I got the error
Traceback (most recent call last):
File "<string>", line 2, in ?
File "test_attach_other_viewpoint.py", line 13, in ?
headView.link(headTrack,0)
File "C:\Program Files\Vizard20\viz.py", line 1354, in link
_ipcSend(_VIZ_LINKVIEW,self.id,sensor,id,'',mask,0 ,0,0)
TypeError: function takes exactly 8 arguments (9 given)

Then I tried putting the mask argument (0) first and tried the following script. But apparently the HEAD_LOOK vector is not updating, and I only get the vectors [0,0,1,0] over and over again.

import viz
viz.go()

headTrack = viz.addsensor('is600')
headTrack.command(11)
# Uses only 3 dof to prevent drifting of the scene
# To switch back to 6 dof use command(1)
handTrack = viz.addsensor('is600')
handTrack.command(11)

headView = viz.add(viz.VIEWPOINT)
headView.link(0,headTrack)

handView = viz.add(viz.VIEWPOINT)
handView.link(0,handTrack)

def test(t):
vect = headView.get(viz.HEAD_LOOK)
print 'headLook',vect
vect = handView.get(viz.HEAD_LOOK)
print 'handLook',vect
viz.starttimer(0,3)

viz.starttimer(0)
viz.callback(viz.TIMER_EVENT,'test')
Reply With Quote
  #4  
Old 12-12-2003, 12:59 PM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
BTW

I checked my version of vizard and it seems to be the most up to date... 2.12
Reply With Quote
  #5  
Old 12-12-2003, 01:04 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi David,

Thanks for including the error message, there is a typo in viz.py. The following line:
Code:
_ipcSend(_VIZ_LINKVIEW,self.id,sensor,id,'',mask,0,0,0)
should be changed to:
Code:
_ipcSend(_VIZ_LINKVIEW,self.id,sensor.id,'',mask,0,0,0)
viz.py is in the main vizard directory. After you change this line, save the file and restart vizard. Your problem should be fixed then. Sorry for all the trouble.
Reply With Quote
  #6  
Old 12-12-2003, 03:14 PM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
Thumbs up

It seems to be working. Thanks!
I still have to test with the sensors connected, but it should work. At least I do not get a compilation error

David
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 11:42 AM.


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