View Single Post
  #5   Spotlight this post!  
Unread 14-01-2009, 18:10
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Getting Live Feed from Axis Camera in Windriver

Quote:
Originally Posted by bobbyt14 View Post
Our team was able to get the video server to work, but the problem is because the example code for it in windriver is broken... here are the steps to get it working (assuming that you've already applied the correct windriver and labview updates):

1) first get the regular dashboard example in windriver to run on the cRio. (the one labeled "dashboardDataExample" - when this correctly loads on the cRio you should see all the lights on the dashboard flashing due to a counter in the code (what is on the dashboard doesn't accurately represent what's happening on the cRio automatically... you have to program it to respond correctly). The battery voltage and robot state should also be the same as is on the DS (anything displayed on the DS should display correctly on the dashboard at all times... this is not affected by the robot code).

2) add the following code to the RobotMain() function in DashboardDataExample.cpp after right before the loop (but not inside it!):

if (StartCameraTask(13, 0, k320x240, ROT_0) == -1) {
//some error message
}
Wait(2.0);
PCVideoServer pc;
INT32 i;
for (i = 0; i<60; i++) {
Wait(1.0);
}
pc.Stop();
for (i = 0; i<10; i++) {
Wait(1.0);
}
pc.Start();
*I just copied this code from the camera server example in windriver because the code works, but that project does not compile correct code.

3) make sure the following headers are declared in DashboardDataExample.cpp:
#include "vxWorks.h"
#include "AxisCamera.h"
#include "BaeUtilities.h"
#include "FrcError.h"
#include "PCVideoServer.h"
the code should now compile are run the video server for you to see on the dashboard.

* if you don't know how to find the dashboard executable, just open Labview, open the dashboard project and either run it or build it into an executable (you'll also have to make sure that your computer is manually configured to the ip address 10.xx.yy.6

*note: with this example, you might run into the compile error that i is declared twice... just remove the INT32 from the second declaration (which should set i to zero right before the main loop).

I'm not too impressed by the documentation FIRST gave us for the camera/video server/dashboard. This all took some searching to figure out.
I was just playing around and I dont think you need to stop then start it again (and wait the 60 seconds...)

so just this works:
Code:
PCVideoServer pc;
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote