Go to Post [the last period is] a free for all, both goals are turned on, and any robot can go anywhere on the field and score in any goal (although I would recommend scoring in the correct goal, not your opponents :D ) - Ryan Foley [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
  #16   Spotlight this post!  
Unread 17-01-2009, 13:56
RKElectricalman's Avatar
RKElectricalman RKElectricalman is offline
Meezy the Mentor
AKA: Rameez
FRC #0384 (Sparky 384)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Richmond, Va
Posts: 88
RKElectricalman is just really niceRKElectricalman is just really niceRKElectricalman is just really niceRKElectricalman is just really nice
Send a message via AIM to RKElectricalman
Re: Two Color Tracking Demo

Can anyone explain to me how to open up the project in Wind River?

Also, when I was working with Labview, I couldn't get it to track. I figured out how to power the servos with the jumpers included, but I couldn't get the camera to actually autonomously move and track the colors, even though it did see it in the VI. Has any one had any issues similar to this?
__________________
ahhh Division Finalists!!
  #17   Spotlight this post!  
Unread 17-01-2009, 15:59
pollyproof12 pollyproof12 is offline
Registered User
AKA: Jarrett
FRC #1865
Team Role: Programmer
 
Join Date: Sep 2008
Rookie Year: 2005
Location: Texas
Posts: 19
pollyproof12 is an unknown quantity at this point
Re: Two Color Tracking Demo

anyone have pictures of how they set up thier camera?
__________________
Programmer
  #18   Spotlight this post!  
Unread 17-01-2009, 20:14
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: Two Color Tracking Demo

nvm

Last edited by nickmagus : 17-01-2009 at 20:26.
  #19   Spotlight this post!  
Unread 17-01-2009, 20:26
laultima laultima is offline
Registered User
FRC #1458 (Danvillans)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Danville, CA
Posts: 87
laultima is on a distinguished road
Send a message via AIM to laultima
Re: Two Color Tracking Demo

The color values from this work beautifully. Weve got our camera tracking, both pan and tilt, from code we wrote using these colors in WindRiver. Ill be happy to post the code here if anyone wants to look it over.
__________________
2007 Davis/Sacramento Regional Winner (100, 997, 1458)

2008 Davis/Sacramento Regional Gracious Professionalism Award Winner

  #20   Spotlight this post!  
Unread 18-01-2009, 05:00
btgdaniel's Avatar
btgdaniel btgdaniel is offline
Registered User
FRC #1731 (Fresta Valley Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Warrenton, VA
Posts: 20
btgdaniel is an unknown quantity at this point
Thumbs up Re: Two Color Tracking Demo

Yes, please post your code -- it would be nice to see another example.
__________________
Team 1731
Fresta Valley Robotics

Catch the FeVeR ~ If You Can!
  #21   Spotlight this post!  
Unread 18-01-2009, 09:48
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: Two Color Tracking Demo

A few clarifications. The example for two color tracking does need to have the DS connected and enabled, but it doesn't care if it is autonomous or tele. You can incorporate it into either or both later.

If you are having problems with the LV example, I'd be glad to help. The first thing I'd advise is setting the radio button near the image display to turn off the gimbal, so the camera will hold still and you will see what the camera sees. Make sure it is focused, make sure your target is in the scene. And hopefully the mask display below will show you the results of the red/green thresholds.

Lighting has a huge impact on vision, and even though this is app was written to be really tolerant of lighting, it can still mess with you. So I usually tilt the target forward and back a bit to see how that will affect things. Move it around to see how overhead lights affect things. Splotchy lighting is some of the worst.

If you are having difficulties at this point, it will be necessary to adjust the camera settings, no use trying to track.

Greg McKaskle
  #22   Spotlight this post!  
Unread 18-01-2009, 19:44
Dr Nick Dr Nick is offline
Registered User
FRC #0501 (The Powerknights!)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Manchvegas NH!
Posts: 24
Dr Nick has a spectacular aura aboutDr Nick has a spectacular aura about
Send a message via AIM to Dr Nick
Re: Two Color Tracking Demo

I've got the camera mounted and scanning for the target but it won't lock on to it (using C++). I got an image from the camera and set the threshold values for my lighting conditions so i have no idea why its not working. To make matters worse, there is a problem with DPRINTF (I think). When it got to the DPRINTF command, the console said there was an error with it, saying a malformed calling sequence. Is anyone else having this problem?
  #23   Spotlight this post!  
Unread 19-01-2009, 13:44
Mikesername's Avatar
Mikesername Mikesername is offline
meh.
AKA: Mike Dame
FRC #3044 (Team 0xBE4)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ballston Spa, NY
Posts: 32
Mikesername is an unknown quantity at this point
Send a message via AIM to Mikesername
Re: Two Color Tracking Demo

So how do you go about hooking it up so the motors attatched to the wheels move to follow the target?
__________________




[ ballston spa robotics | www.team3044.com | team BE4]
  #24   Spotlight this post!  
Unread 19-01-2009, 14:16
Ted Weisse's Avatar
Ted Weisse Ted Weisse is offline
Registered User
AKA: xMentor/Inspector/Referee
no team
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Green Bay, WI
Posts: 106
Ted Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of light
Re: Two Color Tracking Demo

If you are having problems with the LV example, I'd be glad to help. The first thing I'd advise is setting the radio button near the image display to turn off the gimbal, so the camera will hold still and you will see what the camera sees. Make sure it is focused, make sure your target is in the scene. And hopefully the mask display below will show you the results of the red/green thresholds.

Greg McKaskle[/quote]


We can track a single color and the example when in camera mode sees both red and green thresholds. When we enable the gimbal and the DS the pan/tilt searches. On the screen we see the green lagging the red target as it goes across the screen.

What are we doing wrong?

Thanks....
__________________
If I am not for myself, who will be for me?
If I am not for others, what am I?
And if not now, when?

-Rabbi Hillel
Jewish scholar & theologian (30 BC - 9 AD)
  #25   Spotlight this post!  
Unread 19-01-2009, 17:47
laultima laultima is offline
Registered User
FRC #1458 (Danvillans)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Danville, CA
Posts: 87
laultima is on a distinguished road
Send a message via AIM to laultima
Re: Two Color Tracking Demo

Heres the code we're using for target tracking, using the color values from the TwoColorTrackDemo. All variables are doubles declared before the While loop, and pan and tilt are servos.

Code:
if (FindColor(IMAQ_HSL, &redData.hue, &redData.saturation,
					&redData.luminance, &aRed) && FindColor(IMAQ_HSL,
					&greenData.hue, &greenData.saturation,
					&greenData.luminance, &aGreen)) {
				redX = aRed.center_mass_x_normalized;
				redY = aRed.center_mass_y_normalized;
				greenX = aGreen.center_mass_x_normalized;
				greenY = aGreen.center_mass_y_normalized;
				centerX = (redX + greenX)/2;
				centerY = (redY + greenY)/2;
				panMove = (tan((PI/4)*centerX))/8;
				tiltMove= (tan((PI/4)*centerY))/8;
				pan->Set(pan->Get()+panMove);
				tilt->Set(tilt->Get()-tiltMove);
			}
__________________
2007 Davis/Sacramento Regional Winner (100, 997, 1458)

2008 Davis/Sacramento Regional Gracious Professionalism Award Winner

  #26   Spotlight this post!  
Unread 19-01-2009, 21:38
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: Two Color Tracking Demo

Quote:
Originally Posted by Ted Weisse View Post
On the screen we see the green lagging the red target as it goes across the screen.

What are we doing wrong?
Are you holding the target so that it looks like a foe? The panel lets you describe which alliance you are on, and by default it looks for and tracks the biggest foe.

Greg McKaskle
  #27   Spotlight this post!  
Unread 19-01-2009, 21:57
Ted Weisse's Avatar
Ted Weisse Ted Weisse is offline
Registered User
AKA: xMentor/Inspector/Referee
no team
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Green Bay, WI
Posts: 106
Ted Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of lightTed Weisse is a glorious beacon of light
Re: Two Color Tracking Demo

Yes as foe. The servos just hunt never locking on to the target.
__________________
If I am not for myself, who will be for me?
If I am not for others, what am I?
And if not now, when?

-Rabbi Hillel
Jewish scholar & theologian (30 BC - 9 AD)
  #28   Spotlight this post!  
Unread 19-01-2009, 22:28
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: Two Color Tracking Demo

If the red and green masks look good, and your holding the target in the correct orientation, the next things I'd do is to watch the Tracking State indicator. When the camera doesn't see the target, it should search. When it acquires some pink and green that make up a foe, it uses the proportional constants to move the camera so that the target is closer to center. You may want to check the sign of the constants to see if the servos are moving in the wrong direction.

If you don't stumble on the issue soon, one thing that will help with debugging will be to put the target in frame, but off center. Position the servos with the FP knob and slider if you need to. Then put a break point after the FindTwoColor and follow it into the Servo Track VI to determine which of these is the issue.

Greg McKaskle
  #29   Spotlight this post!  
Unread 20-01-2009, 19:13
rcoren22's Avatar
rcoren22 rcoren22 is offline
Registered User
FRC #0223 (Xtreme Heat)
Team Role: Teacher
 
Join Date: Jan 2008
Rookie Year: 2006
Location: New Jersey
Posts: 51
rcoren22 is a splendid one to beholdrcoren22 is a splendid one to beholdrcoren22 is a splendid one to beholdrcoren22 is a splendid one to beholdrcoren22 is a splendid one to beholdrcoren22 is a splendid one to beholdrcoren22 is a splendid one to behold
Re: Two Color Tracking Demo

we are able to see get colors in mask, with tracking indicators showing position and target numbers, but we cannot get any ouput to servo motors.
We have connected servos to pwm 9 and 10

Is the target numbers what should be outputed to servo pw9 & pw10
__________________
The illiterate of the future will not be the person who cannot read. It will be the person who does not know how to learn.
Alvin Toffler
  #30   Spotlight this post!  
Unread 20-01-2009, 19:38
Booksy Booksy is offline
Registered User
FRC #1244 (Viking Robotics)
Team Role: Programmer
 
Join Date: Apr 2008
Rookie Year: 2007
Location: Great White North
Posts: 97
Booksy will become famous soon enoughBooksy will become famous soon enough
Re: Two Color Tracking Demo

Quote:
Originally Posted by rcoren22 View Post
we are able to see get colors in mask, with tracking indicators showing position and target numbers, but we cannot get any ouput to servo motors.
We have connected servos to pwm 9 and 10

Is the target numbers what should be outputed to servo pw9 & pw10
Forgive me if this has been mentioned before: Does the servo updating loop have a watchdog feeder. This has been the problem for me numerous times. It might already have it, I forget, but I know the first one (single color) didn't and I had to add it.
__________________
My favorite CD quote ever(taken out of context of course):
Quote:
Originally Posted by ttldomination
water would be hard to build
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
Camera tracking between two lights Ankush Dhar Programming 2 12-02-2007 23:44
Tracking two lights Render Programming 5 29-01-2007 18:14
Camera tracking demo in easyC or WPILib BradAMiller Programming 0 25-01-2007 14:01
Tracking Color? haywirerobotics Programming 0 14-01-2006 13:55
tracking two tetras? Anton Programming 5 09-02-2005 15:02


All times are GMT -5. The time now is 22:14.

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