|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Like many other teams, we had problems with the camera this year. However, after working on it for a bit, I have got it working. The following steps is how I did it... I hope it helps:
1. Make sure all updates are installed! Note for the driver station update, you need to run it 3 times, install, then uninstall, then reinstall. Note that for this update to work, you may have to turn off your firewall. You can tell when the driver station update has worked when there is a compass in the driver station. The updates that are needed are: a. Labview Update b.Driver Station Update c.Missing File Needed d.Workbench Update 2. Hook up the camera to a computer. Change your IP address to 192.168.0.x where x can be any number except 90. Now run the Setup Axis Camera Program. Once this is successful, go to 192.168.0.90 in your web browser. Follow the instructions exactly as found on page 58 of this manual. Do not change any settings other than the password! 3. Hook the camera back up to the cRio and change the IP of the computer back to what it should be (10.xx.yy.6). 4. Open your developer program (We are using WindRiver). In WindRiver, the sample code that works with the camera is titled 2010ImageDemo. No changes are required. If the project will not build, you may be getting the same error we did. In AxisCamera2010.h, a line was commented out at the beginning. Simply uncomment this line and then rebuild your project. Download this code to your robot. 5. Once the code is downloaded, the image will not appear right away. The code that initializes the camera is in teleop mode so enable teleop. You may have to wait a bit for the image to appear as there is a 10 second wait statement for the camera to turn on. The image should then appear. 6. The following is an example of a simple program using camera code. The bolded lines are code that differs from a normal program and are neccesary for the program to work: Code:
#include "WPILib.h"
#include "Vision/AxisCamera2010.h"
#include "Vision/HSLImage.h"
class MyRobot : public SimpleRobot
{
RobotDrive drive;
Joystick joystick;
public:
MyRobot():
drive(1,2),
joystick(1)
{
GetWatchdog().SetExpiration(0.5);
}
void Autonomous()
{
GetWatchdog().SetEnabled(false);
}
void OperatorControl()
{
This worked for me and I hope it helps other teams who're having trouble with the camera. Please reply if this doesn't work and I will try to be of further assistance. Also, thanks to Andrew (basicxman), another programmer from team 2200, who helped in getting our camera working. -Mike and Team 2200 Last edited by ProgrammerMike7 : 24-01-2010 at 19:29. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solution to camera problem | techkid7 | Programming | 1 | 12-01-2009 08:42 |
| Adams Coprocessor Solution | ScottWalls | Programming | 17 | 30-01-2007 17:17 |
| Dean's Homework Solution | Jessica! | General Forum | 1 | 08-05-2006 10:27 |
| the solution | focus fanatic | Chit-Chat | 8 | 18-01-2006 15:36 |