WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
  #1  
Old 04-21-2005, 03:29 AM
sjroorda sjroorda is offline
Member
 
Join Date: Apr 2005
Posts: 13
Flock of Birds recognized, but no data received

Using the trial version of Vizard 2.51 (running Windows XP) to see if it addresses my needs, I try to add tracker functionality. I have a Flock of Birds (Ascension), and it is recognized by Vizard, but no data is received. Are there any known problems with this tracker?

Neither an example program works, nor the script made using the tutorial.

My code:
Code:
sensor = viz.add('flockofbirds.dls');
sensor.reset();
viz.tracker();
Manually triggering events (data = sensor.get(); print data) prints only non-changing values.

Output of Vizard is
flockofbirds.dls - WorldViz Flock of Birds Driver v0.1

Using FoB with another program works well!

Last edited by sjroorda; 04-21-2005 at 06:33 AM.
Reply With Quote
  #2  
Old 04-21-2005, 11:40 AM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Our FOB plug-in is admittedly not the most sophisticated. It limits include a single bird operation and hard-coded settings such as COM1 at 115.2kbs. I'm copying the C code below that initializes and updates the Bird below. Perhaps by looking at our initialization statements, you'll see what might be causing yours to not work.

A preferred method to connect to a FOB is to use the open-source VRPN protocol. Vizard fully support VRPN devices and from our experience most users are pleased with the results they get from this method. We have a small redistribution of VRPN along with a sample Vizard script that you can immediately download and test out. You'll need to edit the vrpn.cfg file to connect to a FOB rather than run in the test mode which it's in right now (see the readme.txt file).

You can download the VRPN demo here:

http://www.worldviz.com/download/index.php?id=19

If you have any further troubles, please don't hesitate to ask further questions.


Here's the guts of the Vizard FOB plug-in:

PHP Code:
void InitializeSensor(void *sensor)
{
    
BOOL birdFound FALSE;
    
WORD comport 1;
    for(
int i 1<= 2i++) {
        
comport i;
        if(
birdRS232WakeUp(1,TRUE,1,&comport,115200,2000,2000)) {
            
birdFound TRUE;
            break;
        }
    }

    if(!
birdFound) {
        
printf("** ERROR: Could not find bird on COM 1 or 2\n");
        ((
VRUTSensorObj *)sensor)->status FALSE;
        return;
    }

    ((
VRUTSensorObj *)sensor)->status TRUE;

    if(
ANGLE_MODE == SENSOR_QUATERNION)
        
birdRS232SendCommand(1,1,"\\",1);

    
birdGetDeviceConfig(1,1,&devconfig);
    
birdStartFrameStream(1);
}

void UpdateSensor(void *sensor)
{
    
// Update the sensor data fields (see sensor.h)
    // Fields 0-2: reserved for x, y, z position data
    // Fields 3-5: reserved for yaw, pitch, roll
    // or
    // Fields 3-6: reserved for quaternion data
    //
    // eg:
    // ((VRUTSensorObj *)sensor)->data[0] = newX;

    
if (birdFrameReady(1))
    {
        
BIRDFRAME frame;
        
birdGetMostRecentFrame(1,&frame);

        
BIRDREADING *preading;
        
preading = &frame.reading[0];

        
double pos_scale devconfig.wScaling;

        
pos[0] = (float)(preading->position.nX pos_scale 32767.0f) * 0.0254f;
        
pos[1] = (float)(preading->position.nY pos_scale 32767.0f) * 0.0254f;
        
pos[2] = (float)(preading->position.nZ pos_scale 32767.0f) * 0.0254f;

        ((
VRUTSensorObj *)sensor)->data[0] = pos[1] - offset[1];
        ((
VRUTSensorObj *)sensor)->data[1] = -(pos[2] - offset[2]) + height;
        ((
VRUTSensorObj *)sensor)->data[2] = pos[0] - offset[0];

        if(
ANGLE_MODE == SENSOR_EULER2) {
            
yaw preading->angles.nAzimuth AngleConversion;
            ((
VRUTSensorObj *)sensor)->data[3] = yaw yawOffset;
            ((
VRUTSensorObj *)sensor)->data[4] = -preading->angles.nElevation AngleConversion;
            ((
VRUTSensorObj *)sensor)->data[5] = preading->angles.nRoll AngleConversion;
        } else if (
ANGLE_MODE == SENSOR_QUATERNION) {
            ((
VRUTSensorObj *)sensor)->data[3] = preading->quaternion.nQ0 QuatConversion;
            ((
VRUTSensorObj *)sensor)->data[4] = preading->quaternion.nQ1 QuatConversion;
            ((
VRUTSensorObj *)sensor)->data[5] = preading->quaternion.nQ2 QuatConversion;
            ((
VRUTSensorObj *)sensor)->data[6] = preading->quaternion.nQ3 QuatConversion;
        }


    }

Reply With Quote
  #3  
Old 05-09-2005, 04:33 AM
sjroorda sjroorda is offline
Member
 
Join Date: Apr 2005
Posts: 13
Thank you for this code. I tried a little, and found out it the problem wasn't Vizard directly, but the FoB itself. I don't know the exact problem yet, but after having played with the program WinBIRD that was delivered with the Flock of Birds, after a while Vizard worked, too. Strange, but nice...
Reply With Quote
  #4  
Old 05-27-2005, 01:45 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Our Ascension Flock of Birds plug-in now works well with 1 or more birds. The plug-in expects the Flock of Birds system to be in normal address mode and will not work in other modes (plug-in attached in following message).

Vizard parameters are:

NUM_FOB = 1 or 2
PORT_FOB = 1 (default)
BAUD_FOB = 115200 (default)


In normal address mode, you enter a binary number using dip switches 4, 5, 6, 7 to adjust the bird stack to how many birds are present. If only 1 bird is present, then set all to 0. Otherwise, set each bird box according to its sequential number.

Baud rate is set with dips 1,2,3. For the default mode (115.2kbs), leave 1,2,3 ON (which is the DOWN position).

The transmitter should be plugged into the first bird in the chain. The RS-232 null model cable should also come off the first bird in the chain.

When changing bird settings, switch to STBY before changing, then back to FLY after changing.

After Vizard has connected to the bird/s, then the status light will glow red and stay on.


Here's a sample script:

PHP Code:
import viz
viz
.go()

NUM_FOB 2

ball 
viz.add('white_ball.wrl')
ball.color(viz.RED)
flock1 viz.add('flockofbirds.dls')
ball.link(flock1)

ball viz.add('white_ball.wrl')
ball.color(viz.BLUE)
flock2 viz.add('flockofbirds.dls')
ball.link(flock2)

viz.add('tut_ground.wrl')

viz.clearcolor(viz.GRAY)

viz.move(0,0,-8)

def onkeydown(key):
    
#The keyboard button 'key' is being pressed
    
if key == 'r':
        
flock1.reset()
        
flock2.reset()
        print 
'reset!'

viz.callback(viz.KEYDOWN_EVENT,onkeydown
Reply With Quote
  #5  
Old 05-27-2005, 01:58 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
New Flock of Birds plug-in

Place this file in your vizard25/plugins folder, replacing the existing file. This adds the functionality described in the previous message.
Attached Files
File Type: zip flockofbirds.zip (3.5 KB, 2660 views)
Reply With Quote
  #6  
Old 06-30-2006, 05:28 AM
giancamati giancamati is offline
Member
 
Join Date: Jun 2006
Posts: 27
What is the event associated to the Bird? How can I map and implement a new behaviour of those events.

Best Regards.
Giancarlo Amati
Reply With Quote
  #7  
Old 07-07-2006, 08:43 AM
giancamati giancamati is offline
Member
 
Join Date: Jun 2006
Posts: 27
Unhappy

Hello everybody,

I have the following question: I connected 2 FlockOfBirds together and set the NUM_FOB = 2

now I create two tracker linked to two spheres.
The Vizard does not warn with any error message, so I suppose it is able to recognize 2 FOB but, the two sphere are not sinchronized with the FOB. It seems that Vizard receives only zeros parameters.

Any Idea about that?

Thank you so much
Reply With Quote
  #8  
Old 07-18-2006, 09:28 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
In earlier posts you seem to have indicated that you got your FOB working with Vizard. Can you summarize what does and what does not work for you? If you've modified the sample script above in any way, could you please post your script so that I may look at it.

Also, are you getting any sign of life from the FOB from the indicator lights?
Reply With Quote
  #9  
Old 03-01-2016, 07:36 AM
jsnow jsnow is offline
Registered User
 
Join Date: Mar 2016
Posts: 1
tobin,

"You can download the VRPN demo here:

http://www.worldviz.com/download/index.php?id=19 " :

Forbidden

You don't have permission to access /download/ on this server.

Apache/2.2.22 (Ubuntu) Server at www.worldviz.com Port 80

Not work link, please link
Thank.
Reply With Quote
  #10  
Old 03-01-2016, 08:48 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The ascension plug-in is included with Vizard. There is no need for an additional download to use the flock of birds.
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 02:08 AM.


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