WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Wanda button events on flock of birds (https://forum.worldviz.com/showthread.php?t=1297)

Atul Thakur 01-04-2008 10:41 PM

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 ?
Kindly point me to some sample codes if it exists.

Thank you,

sincerely,
-Atul

mspusch 01-06-2008 07:12 AM

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!

Atul Thakur 01-06-2008 04:50 PM

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

farshizzo 01-07-2008 09:36 AM

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.

Atul Thakur 01-08-2008 01:42 PM

Quote:

Originally Posted by farshizzo (Post 4843)
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 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

farshizzo 01-08-2008 02:34 PM

If you can't get the joystick/buttons working with Ascension's software then you will need to contact them for support.

Atul Thakur 01-08-2008 10:31 PM

Quote:

Originally Posted by farshizzo (Post 4853)
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 I can only see the orientations changing and not the positions. What could be possible reason for this.

Thanks again for replying,
regards,
-Atul

farshizzo 01-10-2008 03:33 PM

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?

Atul Thakur 01-11-2008 10:26 AM

Quote:

Originally Posted by farshizzo (Post 4864)
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 :confused:
Thanks and regards,
-Atul

farshizzo 01-11-2008 05:34 PM

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.

Atul Thakur 01-11-2008 06:09 PM

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

Atul Thakur 01-17-2008 05:22 PM

Use of Buttons on FOB Wanda
 
Quote:

Originally Posted by farshizzo (Post 4853)
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

Atul Thakur 01-18-2008 03:04 PM

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


All times are GMT -7. The time now is 04:29 PM.

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