Go to Post We don't have to reinvent the wheel every year. (We have AndyMark to do that for us.) - GaryVoshol [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 11-03-2009, 23:08
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
Camera Colors

I have not been very successful with color tracking, I am trying to get the TwoColorDemo code to work and I am pretty sure it's the values for pink and green, but I have kept most of the default code their. So here are some questions:

1) What values for the min, and max for luma, saturation, and hue have teams used that have been successful? [For pink and green, plz specify which color it is for]

2) Is there any of the default code that would cause the robot not to see the target?

3) I put in my own for loops to move the two servos instead of using their default ones, since whenever I turned the robot on the camera would vertically turn up or down all the way, and then turn left or right all the way right when autonomous started., is this smart to do?

4) Are there any suggestions on how to get the camera working? [I have tried NI Vision Assistant, but was unsuccessful with either getting an image from the camera, or taking a screen pic of the florescent green with the camera, and attempting to get values from the pic]

TYVM to any who respond, and help!
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
Reply With Quote
  #2   Spotlight this post!  
Unread 11-03-2009, 23:14
rogerlsmith's Avatar
rogerlsmith rogerlsmith is offline
Software Engineer
AKA: Roger Smith
FRC #3357 (COMETS)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Grand Rapids, MI
Posts: 214
rogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to behold
Re: Camera Colors

We were able to use the TwoColorTrackDemo right out of the box. We changed very little to the code and it has worked well for us. We scored autonomously twice in week 1 (on moving trailers) with that code.

I'd suggest reverting back to as few changes as possible.

You can see a video of our autonomous scoring on my blog - posted yesterday:
http://rogeronfirst.blogspot.com/200...-no-hands.html.
__________________
Roger Smith
Mentor - FRC Team 3357
COMETS - Creating Outstanding Minds, Embracing Technology & Science
---------------------------------------------------------------------------------------

Share FIRST videos, photos and experiences at FIRSTObjective.org

Last edited by rogerlsmith : 11-03-2009 at 23:19. Reason: added link to video
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2009, 00:17
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
Re: Camera Colors

how about on your camera settings did you change anything?
because the thing is I put the target (green being on top) at a distance where the camera was looking at it, and when it started the servos just spazzed and went all up/down & all the way left or right, and it was with the default, out of the box code, what up?? what needs to be tried?? Is there something that might interfere, like if our robot uses servos elsewhere would that effect it??
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2009, 16:38
rogerlsmith's Avatar
rogerlsmith rogerlsmith is offline
Software Engineer
AKA: Roger Smith
FRC #3357 (COMETS)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Grand Rapids, MI
Posts: 214
rogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to behold
Re: Camera Colors

There are certain motors that will interfere with the signal to the servos. However, if all other motors are off, you shouldn't experience any interference.

The TwoColorTrackDemo code pans left and right; I don't think it tilts up and down by default. Double check and make sure you've plugged the servos in the right port and they have the servo jumper attached on the side car.
__________________
Roger Smith
Mentor - FRC Team 3357
COMETS - Creating Outstanding Minds, Embracing Technology & Science
---------------------------------------------------------------------------------------

Share FIRST videos, photos and experiences at FIRSTObjective.org
Reply With Quote
  #5   Spotlight this post!  
Unread 12-03-2009, 23:12
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Camera Colors

Quote:
Originally Posted by ExarKun666 View Post
...the servos just spazzed and went all up/down & all the way left or right, and it was with the default, out of the box code, what up??
If your camera is mounted upside down from the way the software expects, the servos will end up moving the camera away from the target instead of toward it.

If you have the tilt servo and pan servo connections swapped, the software will be trying to move the camera horizontally but it will actually move vertically, and vice versa.

If you built the pan/tilt assembly mirror-imaged from the drawings, the tilt servo will be reversed from how the software wants to control it.

All these can be corrected easily, if you know to check for them.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-03-2009, 10:33
Sentient's Avatar
Sentient Sentient is offline
Registered User
FRC #0639 (Code Red)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ithaca
Posts: 21
Sentient is on a distinguished road
Re: Camera Colors

The detection color values from the demo may or may not work depending on your lighting. The code worked for us right out of the box, but when we got to regionals, the lighting was so different that the code we had used during the build season was useless. You will have to experiment with different values.

Check this out: http://joule.ni.com/nidu/cds/view/p/id/1270/lang/en

I haven't taken a close look at it yet, but it looks like a tool that will make color calibration easier.

You may be having problems because of hardware, as others have said, but if you are still having problems after you're sure everything is connected properly, you should just play around with color values. It really does make an incredible difference.

Last edited by Sentient : 21-03-2009 at 10:40.
Reply With Quote
  #7   Spotlight this post!  
Unread 21-03-2009, 13:16
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,752
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: Camera Colors

Just to clarify,
Quote:
the lighting was so different that the code we had used during the build season was useless.
The code is the same. In fact the tool you reference is also built from the same example code. The code does refer to constants that were determined based on lighting in shops, classrooms, etc. They were determined before anyone had access to a field. In most cases there are three numbers that need to change for pretty good response. Brightness, and the three lower saturation values.

As you point out, the tool at that URL will hopefully make it quick and painless to learn about the event lighting and adjust the constants for almost any lighting.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 21-03-2009, 16:24
Sentient's Avatar
Sentient Sentient is offline
Registered User
FRC #0639 (Code Red)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ithaca
Posts: 21
Sentient is on a distinguished road
Re: Camera Colors

Quote:
Originally Posted by Greg McKaskle View Post
Just to clarify,

The code is the same.

Greg McKaskle
Yes, you're right. The code was the same. What I meant was, the HSL ranges that we had working perfectly back at school became completely moot when we arrived at competition.
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
WPILib & Camera colors & data Thanatos Programming 2 19-02-2007 01:15
Camera Won't FInd Colors (Was: Please help!) graphite Programming 1 18-05-2006 09:30
RGB colors in camera.h X-Istence Programming 5 11-01-2006 21:59
Camera colors Anton Programming 3 09-02-2005 14:13
Colors doyler Programming 2 30-01-2005 15:22


All times are GMT -5. The time now is 03:28.

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