I actually just got Team 3375's camera working, This is what I did.
1.Connect the camera to the computer with a crossover cable. Set Computers IP to 192.168.0.91 Subnet Mask to 225.225.225.0 Gateway Blank or 192.168.0.1 (Try both I forget)
2. Run the Axis camera utility thing.
3. Connect the camera back to port 2 with the crossover cable
3. Go into WindRiver and add this to the Initialization part of your program
Put this in your includes
Quote:
#include "vxWorks.h"
#include "Vision/AxisCamera2010.h"
#include "PCVideoServer.h"
|
Quote:
AxisCamera &camera = AxisCamera::getInstance();
camera.writeResolution(k640x480);
camera.writeBrightness(10);
|
Here is my whole file so you can't mess up putting the code in the right spot
Quote:
#include "WPILib.h"
#include "vxWorks.h"
#include "Vision/AxisCamera2010.h"
#include "PCVideoServer.h"
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
public:
RobotDemo(void):
myRobot(1, 2), // these must be initialized in the same order
stick(1) // as they are declared above.
{
GetWatchdog().SetExpiration(0.1);
AxisCamera &camera = AxisCamera::getInstance();
camera.writeResolution(k640x480);
camera.writeBrightness(10);
}
void Autonomous(void)
{
GetWatchdog().SetEnabled(false);
myRobot.Drive(0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
myRobot.Drive(0.0, 0.0); // stop robot
}
/**
* Runs the motors with arcade steering.
*/
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{
GetWatchdog().Feed();
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(RobotDemo);
|
4. Reboot the robot
If this doesn't work, make sure your Driver Station has a compass in the bottom right hand corner, if not then reinstall the Driver Station , and that your cRIO is flashed with v19
To do this, just use the Simple Robot template, The camera demonstration thing doesn't work for me.
Another note, the camera feed lags if you select the top window, select the bottom window and the feed is much more "real time"
Question to some of the other teams, My live feed has a light blue line down the middle about 2 pixels wide, I have no idea why its there, probably going to leave it if no one has any ideas because it could help with aiming I guess. Is it intentional?