Go to Post The robot competition is the most obvious, visible, and distilled-media-friendly part of the picture... We shouldn't be surprised that it's all that gets into the news coverage, when that coverage is managed by someone who isn't already well versed in what FIRST is trying to do. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2010, 19:10
ProgrammerMike7 ProgrammerMike7 is offline
Registered User
AKA: Mike
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Canada
Posts: 13
ProgrammerMike7 will become famous soon enoughProgrammerMike7 will become famous soon enough
Talking Camera Solution

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()
	{
Wait(10.0);// Give the camera time to turn on
HSLImage image; // Creates an image AxisCamera &camera = AxisCamera::getInstance(); // Creates an instance of the camera camera.writeResolution(k160x120); camera.writeBrightness(0); while (IsOperatorControl() && !IsDisabled()) { camera.GetImage(image.image); // Gets the image from the camera } } }; START_ROBOT_CLASS(MyRobot);
This code will display an image on the driver station. Give it time, as there is a 10 second wait for the camera to turn on. And teleop must be enabled for the image to display.

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
__________________
Wait (-1)

Last edited by ProgrammerMike7 : 24-01-2010 at 19:29.
  #2   Spotlight this post!  
Unread 24-01-2010, 19:23
ideasrule's Avatar
ideasrule ideasrule is offline
Registered User
FRC #0610 (Coyotes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Toronto
Posts: 108
ideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the rough
Re: Camera Solution

In addition to those steps, it's also necessary to image the cRIO with v19.

Also, seeing a compass on your driver station doesn't mean that the update works. We uninstalled and reinstalled the update and our dashboard looked exactly as it should, but the camera feed still didn't work. We had to go to Program Files and manually delete ALL of the driver station software and reinstall it before the camera feed worked.
  #3   Spotlight this post!  
Unread 24-01-2010, 19:33
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Camera Solution

Quote:
Originally Posted by ideasrule View Post
Also, seeing a compass on your driver station doesn't mean that the update works. We uninstalled and reinstalled the update and our dashboard looked exactly as it should, but the camera feed still didn't work. We had to go to Program Files and manually delete ALL of the driver station software and reinstall it before the camera feed worked.
Correct, things should be installed as per this post: http://www.chiefdelphi.com/forums/sh...9&postcount=44 For us, the compass did not display until we had done that.
  #4   Spotlight this post!  
Unread 24-01-2010, 19:41
ideasrule's Avatar
ideasrule ideasrule is offline
Registered User
FRC #0610 (Coyotes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Toronto
Posts: 108
ideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the roughideasrule is a jewel in the rough
Re: Camera Solution

Quote:
Originally Posted by basicxman View Post
Correct, things should be installed as per this post: http://www.chiefdelphi.com/forums/sh...9&postcount=44 For us, the compass did not display until we had done that.
I meant to say that following those instructions did not work. We did exactly what the instructions said, but still had no feed. We had to browse to C:\Program Files, find the Driver Station folder, manually delete it (as in, delete it using the "Delete" button on the keyboard), and reinstall it again before the feed worked.
  #5   Spotlight this post!  
Unread 29-01-2010, 20:13
Teh1337Bix's Avatar
Teh1337Bix Teh1337Bix is offline
Registered User
None #3132
 
Join Date: Jan 2010
Location: Australia
Posts: 13
Teh1337Bix is an unknown quantity at this point
Re: Camera Solution

That's great but it doesn't solve my problem. I need to declare a camera variable with a class scope and then assign to it in the classes constructor, yet every time I put it in the class it gives me error.
__________________
Yes I'm Aussie, and yes I ride a kangaroo to school.
Yeah bruduz!!!
  #6   Spotlight this post!  
Unread 29-01-2010, 21:40
TPNigl TPNigl is offline
Registered User
FRC #0069 (Team HYPER)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Quincy, MA
Posts: 94
TPNigl is an unknown quantity at this point
Re: Camera Solution

We just got our camera working today, which was very exciting. The simple solution after all the updates was just putting in those few lines of code from the OP. Should've seen that coming, but ah well. Here's to hopefully solving many other confused teams' problems.
__________________


2011 Pit Crew:
2011 CT Xerox Creativity Award

HYPER Alumni
  #7   Spotlight this post!  
Unread 30-01-2010, 13:11
Sauce Sauce is offline
Registered User
FRC #1245 (Shazbots)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Louisville
Posts: 35
Sauce is an unknown quantity at this point
Re: Camera Solution

Thanks a lot man, this worked!
  #8   Spotlight this post!  
Unread 31-01-2010, 23:53
K3V1N.Team70's Avatar
K3V1N.Team70 K3V1N.Team70 is offline
Team 70 Programmer
AKA: Kevin Stephens
FRC #0070 (70 More Martians)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Goodrich
Posts: 2
K3V1N.Team70 is an unknown quantity at this point
Send a message via AIM to K3V1N.Team70
Re: Camera Solution

OK, We here in Goodrich, MI have completed all of these steps and this does not work for us. we are using c++, we have been using the 2010ImageDemo and it seems to have all the code posted above, we have all the updates and the camera works through the Ethernet port on the DS, we have had no luck here and would appreciate some help.
Thanks in advance, Team 494 & 70

Last edited by K3V1N.Team70 : 31-01-2010 at 23:57. Reason: oops
  #9   Spotlight this post!  
Unread 01-02-2010, 10:09
bcieslak
 
Posts: n/a
Re: Camera Solution

Quote:
Originally Posted by K3V1N.Team70 View Post
OK, We here in Goodrich, MI have completed all of these steps and this does not work for us. we are using c++, we have been using the 2010ImageDemo and it seems to have all the code posted above, we have all the updates and the camera works through the Ethernet port on the DS, we have had no luck here and would appreciate some help.
Thanks in advance, Team 494 & 70
Are you using the orange crossover cable between the camera and the cRIO??
We're having the same problems you are and we did not have any success yet either.

BC
  #10   Spotlight this post!  
Unread 01-02-2010, 19:07
Al3+'s Avatar
Al3+ Al3+ is offline
ARTist
AKA: Anthony
FRC #0840 (Aragon Robotics Team)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2008
Location: San Mateo, CA
Posts: 58
Al3+ is a jewel in the roughAl3+ is a jewel in the roughAl3+ is a jewel in the rough
Re: Camera Solution

Thanks for this! We just got our camera up and running.

To the above, we had that problem too earlier. When we tried to use a regular ethernet cable, the lights on the port on the cRIO weren't blinking. With the proper crossover cable (it was pink in this year's kit), the lights were blinking and we were able to get images on the screen. Are they blinking for you guys?

As for the code, where is the proper place to set up the camera instance? The way it is right now (in OperatorControl) it seems like the bot would stand still for 10 seconds at the beginning of the round.
__________________
cout << "Hello, robotics. Goodbye, world." << endl;

"The two-axis accelerometer provided in the kit of parts (shown in the picture below) is a two-axis accelerometer." - WPILib User's Guide
  #11   Spotlight this post!  
Unread 01-02-2010, 19:54
TPNigl TPNigl is offline
Registered User
FRC #0069 (Team HYPER)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Quincy, MA
Posts: 94
TPNigl is an unknown quantity at this point
Re: Camera Solution

You put the declaration of the camera object in the first set of brackets after the imports, and the rest in robotInit
__________________


2011 Pit Crew:
2011 CT Xerox Creativity Award

HYPER Alumni
  #12   Spotlight this post!  
Unread 02-02-2010, 10:08
bcieslak
 
Posts: n/a
Re: Camera Solution

Quote:
Originally Posted by ideasrule View Post
In addition to those steps, it's also necessary to image the cRIO with v19.

Also, seeing a compass on your driver station doesn't mean that the update works. We uninstalled and reinstalled the update and our dashboard looked exactly as it should, but the camera feed still didn't work. We had to go to Program Files and manually delete ALL of the driver station software and reinstall it before the camera feed worked.
Where is that compass displayed?? The DS tells me I am using a version dated 1-6-2010 which I think is the latest but I don't recongnize anything that looks like a compass.
  #13   Spotlight this post!  
Unread 02-02-2010, 10:32
proman007's Avatar
proman007 proman007 is offline
Registered User
AKA: Proffitt
FRC #2369 (Maximus Roboticus)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Oklahoma
Posts: 2
proman007 is an unknown quantity at this point
Re: Camera Solution

For anyone using using labview my team did this:

1) Make sure that you have installed the Dashboard update.

2) Uninstall the Dashboard update by running the setup again.

3) Navigate to c:\Programs and Settings. You will need to delete the FRC Dashboard and FRC Driver Station folders

4) Reboot the Classmate PC

5) Reinstall the Dashboard Update

6) Reboot the Classmate PC



team2369.com
Closed Thread


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 02:20.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi