Go to Post try to be a little less quick to hit the red rep and a little more informative and helpful. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-06-2009, 06:38 PM
Lord_Jeremy's Avatar
Lord_Jeremy Lord_Jeremy is offline
Lord_Jeremy the Procrastinator
AKA: Jeremy Agostino
FRC #1546 (Chaos Inc.)
Team Role: Electrical
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Baldwin, New York
Posts: 45
Lord_Jeremy is an unknown quantity at this point
Send a message via ICQ to Lord_Jeremy Send a message via AIM to Lord_Jeremy Send a message via MSN to Lord_Jeremy Send a message via Yahoo to Lord_Jeremy
Could Never Get Camera To Work

Hey. Last year we programmed the robot entirely in C++, but the guy who was assigned to write the camera code could never get it to work. Looking at it, it makes sense. I don't see why it wouldn't work. However, all that ever happened was the camera would seem to track a pair of colors but then swivel to look at random objects, or the ceiling. I'd post our code but it's really a huge mess, and I think it's kind of embarrassing. (Note: this past year I was delegated to electronics and the programming was left to other people )

We also had immense problems getting the WPI-provided camera example (TwoColorDemo, I think it was called?) working. For a while it simply wouldn't compile. Then they released a version that did compile but as I remember it exhibited the same behavior as our code. Actually, I'm willing to bet that the camera guy based his code off of TwoColorDemo.

Anyway, perhaps it would help us for next year if someone could post their (working) C++ camera functions. Even if we don't end up using the camera next year, we'd like to test if we've got something wonky with our camera or even the cRIO.

Thanks!
__________________
Compiling...
Compiling...
Reply With Quote
  #2   Spotlight this post!  
Unread 10-06-2009, 08:33 PM
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Could Never Get Camera To Work

It is very unlikely that something is wrong with your cRIO that allows everything else to work, but the camera only sorta works.

There are plenty of camera settings that could cause the code to be wonky. I'd highly recommend connecting the camera directly to a PC and running NI Vision Assistant. If you set the PC IP to 192.168.1.xx other than 90, it will let you use the camera to get a feel for the focus, color, contrast, etc. It will let you view the settings your camera is using or change them. Once you know that your camera is working as you expect, it may also be useful to isolate your code to make a camera and gimbal only project. Work on this in isolation from the rest of the robot and see if you can debug its behavior.

Once that works well enough, you can hopefully reintegrate it with the robot -- without making the code a mess.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 10-06-2009, 11:00 PM
Lord_Jeremy's Avatar
Lord_Jeremy Lord_Jeremy is offline
Lord_Jeremy the Procrastinator
AKA: Jeremy Agostino
FRC #1546 (Chaos Inc.)
Team Role: Electrical
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Baldwin, New York
Posts: 45
Lord_Jeremy is an unknown quantity at this point
Send a message via ICQ to Lord_Jeremy Send a message via AIM to Lord_Jeremy Send a message via MSN to Lord_Jeremy Send a message via Yahoo to Lord_Jeremy
Re: Could Never Get Camera To Work

Heh. I remember us doing all sorts of fancy (and not-so-fancy) diagnostic stuff with the camera. We did run NI Vision Assistant and recalibrated our color target profile thing a number of times.
__________________
Compiling...
Compiling...
Reply With Quote
  #4   Spotlight this post!  
Unread 10-13-2009, 06:56 PM
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Could Never Get Camera To Work

I've just recently been playing around with the camera and got it to work wonderfully. Took one look at the TwoColorTracking demo and found it too complicated, so I modeled my own based on it.

If your camera is looking at random things, make sure your tracking thresholds are right...I've tried unsuccessfully to get the robot to track different color combinations...
Reply With Quote
  #5   Spotlight this post!  
Unread 10-15-2009, 10:34 PM
Lord_Jeremy's Avatar
Lord_Jeremy Lord_Jeremy is offline
Lord_Jeremy the Procrastinator
AKA: Jeremy Agostino
FRC #1546 (Chaos Inc.)
Team Role: Electrical
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Baldwin, New York
Posts: 45
Lord_Jeremy is an unknown quantity at this point
Send a message via ICQ to Lord_Jeremy Send a message via AIM to Lord_Jeremy Send a message via MSN to Lord_Jeremy Send a message via Yahoo to Lord_Jeremy
Re: Could Never Get Camera To Work

You know I've finally taken a good look at our camera routines and it's a freaking mess... Not to bad-mouth the team alumnus that wrote it but I wouldn't be surprised if our code is just broken. If I can seem to un-screw it I'll probably post back. I think at the next opportunity we'll try calibrating the camera again.
__________________
Compiling...
Compiling...
Reply With Quote
  #6   Spotlight this post!  
Unread 12-23-2009, 10:27 AM
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Could Never Get Camera To Work

Heh... We also coded the robot in C++ last year. The camera was quite the adventure. For the majority of the season no matter what programming approach I tried the thing didn't work. Then during our second competition I found out that the metal mounting bracket for the camera had been holding the reset button down the entire season, forcing a power cycle on the camera every 15 seconds. I nearly cried.

Even once that was taken care of, the exposure rate and contrast constantly had to be tweaked. Only in the end by using the sample code provided by WPI did we get half-decent results.

The moral I took from this story is that while the camera can be used wonderfully during autonomous and to assist the drivers, your robot should not be built around a strategy that heavily depends on the camera (last year we had a robot with a movable turret that was supposed to use camera-assisted aiming). Use the camera instead to augment your strategy.

I will say, though, I'm extremely excited to be allowed enough network bandwidth this season to send entire camera frames to the dashboard. A live view from the eyes of the robot will do wonders for drivers. I'm currently working on a custom dahsboard project focusing on customization and extremely quick and easy configuration; expect a post later in the season once I have something cool to show you guys.
__________________
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

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
Cant get RC to work comphappy Control System 13 01-06-2008 06:40 PM
Designs that would never work... Cyberguy34000 Technical Discussion 60 01-09-2007 08:56 PM
Camera never finds target, stays at "Searching..." Mike Programming 12 01-22-2006 12:47 PM
pic: Never seen of! Never heard of! The secret revealed! CD47-Bot Robot Showcase 5 03-06-2003 03:49 PM
Ya i get to work the kickoff! Team238-aholic General Forum 1 12-29-2002 01:28 PM


All times are GMT -5. The time now is 09:11 AM.

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