WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1  
Old 01-04-2008, 10:41 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Wanda button events on flock of birds

Hi,
I am able to track the positions using my FOB (1 bird).
There are three buttons and a joystick control on the wanda.
Are there any functions in Vizard to use the events generated by these buttons and joysticks? I saw the documentation of flockofbirds plugin but couldn't find any. If not, do i need to write my own plugin <where to get information about writing my own plugin>?
Kindly point me to some sample codes if it exists.

Thank you,

sincerely,
-Atul
Reply With Quote
  #2  
Old 01-06-2008, 07:12 AM
mspusch mspusch is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 223
Hi Atul,

I believe there have been similar discussions before, please have a look at

http://www.worldviz.com/forum/showthread.php?t=678

and see if that helps.

Have fun!
Reply With Quote
  #3  
Old 01-06-2008, 04:50 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Thank you for the reply.
I followed the discussion you indicated. My problem is that my joystick is not working neither the wanda buttons. I can only retrieve the orientation of the wanda. Is there a method to access the joystick or wanda button action?
regards,
-Atul
Reply With Quote
  #4  
Old 01-07-2008, 09:36 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
According to Ascension, the Wanda is a standard plug-n-play joystick device. This means you should be able to use our joystick module to access the joystick/button data. There are a few example scripts that come with Vizard showing how to use the joystick module and they are also included in the documentation.
Reply With Quote
  #5  
Old 01-08-2008, 01:42 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Quote:
Originally Posted by farshizzo View Post
According to Ascension, the Wanda is a standard plug-n-play joystick device. This means you should be able to use our joystick module to access the joystick/button data. There are a few example scripts that come with Vizard showing how to use the joystick module and they are also included in the documentation.
Hi:
I tried using the joystick code into my fob code as follows

PHP Code:
import viz
import sid

viz
.go()
BAUD_FOB 38400
PORT_FOB 
1
sensor 
viz.add('flockofbirds.dls')
viz.tracker()
pos = [0,0,0]
room viz.add("room.wrl")
room.translate(0,0,3)
table viz.add("table.wrl")
table.translate(0,0,3)
def onkeydown(key):
    if 
key == 'a':
        
pos sensor.get()
        print 
pos
viz
.callback(viz.KEYDOWN_EVENT,onkeydown)

##to see whether joystick works o not
def joydown(button):
    print 
"Joystick worked!!" 
Joystick action is not printing anything
Moreover, I don't have any idea, how to use the buttons on the wanda.
Also, for the information, when I run winbird.exe <Ascension's program> The position and orientations are registered properly but joystick or buttons don't do anything.
I am not sure if the joystick and buttons are working alright or not. Please let me know if there is any method to test that.
Thank you,

-Atul
Reply With Quote
  #6  
Old 01-08-2008, 02:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you can't get the joystick/buttons working with Ascension's software then you will need to contact them for support.
Reply With Quote
  #7  
Old 01-08-2008, 10:31 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Quote:
Originally Posted by farshizzo View Post
If you can't get the joystick/buttons working with Ascension's software then you will need to contact them for support.
I have contacted Ascension for joystick and button stuff.

However, one issue is that the position and orientation BOTH are changed in virtual world when I move wanda in real world in case of Ascension's software winbird. When I tried to replicate that behavior in Vizard <as posted in the snippet posted in my previous post in this thread> I can only see the orientations changing and not the positions. What could be possible reason for this.

Thanks again for replying,
regards,
-Atul
Reply With Quote
  #8  
Old 01-10-2008, 03:33 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I'm not sure why the position data is not being updated in Vizard. I tested it out here and it works fine. Are you sure the switches on your flock of birds device is setup correctly?
Reply With Quote
  #9  
Old 01-11-2008, 10:26 AM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Quote:
Originally Posted by farshizzo View Post
I'm not sure why the position data is not being updated in Vizard. I tested it out here and it works fine. Are you sure the switches on your flock of birds device is setup correctly?
I have set up dipswitch setting to be
1 - down
2 - up
3 - down
4 - up
5 - up
6 - up
7 - up
8 - up
following your suggestion on http://www.worldviz.com/forum/showthread.php?t=1293
However, I want to share an observation that the trackd daemon doesn't identify the sensors in this configuration of dipswitch. The trackd daemon runs properly when I set the dipswitch to be
1 - down
2 - up
3 - down
4 - up
5 - up
6 - up
7 - down
8 - up
however in this case vizard doesn't identify the fob and gives error like "not found on com1".
I am puzzled as what settings for dipswitch should I keep
Thanks and regards,
-Atul
Reply With Quote
  #10  
Old 01-11-2008, 05:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Having switches 4-7 up means you have a single bird in standalone mode. When you have multiple birds attached, then the first bird will have switch 7 down. It seems Trackd does not use standalone mode when only 1 bird is attached.
Reply With Quote
  #11  
Old 01-11-2008, 06:09 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
So, it seems that my dipswitch setting is correct as I have one bird in standalone mode.
Vizard can read the data from sensor but when I move the wanda...only orientation changes in the virtual environment and not the position. However, if I use the get() method, Vizard perfectly returns the position and orientation in its canonical (posn + quat) format.



regards,
-Atul
Reply With Quote
  #12  
Old 01-17-2008, 05:22 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Use of Buttons on FOB Wanda

Quote:
Originally Posted by farshizzo View Post
If you can't get the joystick/buttons working with Ascension's software then you will need to contact them for support.
Now my wanda buttons are responding on the Ascension's software.
I tried to register the wanda button events using the mouse callbacks mouseDNhandler and mouseUPhandler but it works only with mouse not with wanda buttons still.
Are there specific callback for the wanda buttons?
i searched on the forum for sample codes but couldn't find any.

thanks,

-Atul
Reply With Quote
  #13  
Old 01-18-2008, 03:04 PM
Atul Thakur Atul Thakur is offline
Member
 
Join Date: Oct 2007
Posts: 15
Finally I can use the wanda buttons in my code. Just for the benefit of others I would share the solution that worked for me.
As pointed out on this thread earlier by Farshizzo that wanda is plug and play device, somehow it was not acting that way for me. I mean, wanda was not acting as mouse. To make it as a mouse I made some registry settings.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\sermouse and change the value of start = 3.
Rebooting the computer is required after this.
After this all the mouse callbacks in Vizard can be used for wanda device also.
However, after this change trackd doesn't work properly. So, to make it work the same registry variable stated above should be set to 4.

Thanks for all the help.

-Atul
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flock of Birds recognized, but no data sent sjroorda Vizard 9 03-01-2016 08:48 PM
Flock of Birds Atul Thakur Vizard 6 12-20-2007 12:18 PM
Flock of Birds question (again) Elittdogg Vizard 24 12-04-2007 09:37 AM
Flock of Birds Elittdogg Vizard 9 10-02-2007 01:53 PM
Flock of birds extended range problem theuberk Vizard 4 07-30-2007 09:31 AM


All times are GMT -7. The time now is 05:11 AM.


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