Go to Post Even if this is the Rumor Mill, there are behaviors that need to be adhered to. - meaubry [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-02-2012, 23:42
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
Camera Tracking/Image Processing

Hey everyone,

We are almost ready with our image processing code, but we need help with aligning ourselves based on the right 2-point hoop. What we want to know is when we get the red squares, how do we recognize the right 2-pointer, set the Gyro, and align ourselves to that hoop?

Thanks!
__________________
Eagle Engineering 1138

Last edited by cjlane1138 : 12-02-2012 at 12:34.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2012, 00:54
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
Re: Robot Position Tracking, Gyro, Alignment help needed

Anyone? We need some help...
__________________
Eagle Engineering 1138
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2012, 14:30
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,112
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: Robot Position Tracking, Gyro, Alignment help needed

The right hoop on the middle row will have the right-most X coordinate. That should be enough for you to recognize the target you want to focus on.

If you have the ability to command the robot to a specific heading, you should be able to figure out what change in heading is required to make the target get from where you see it to where you want it to be. If you have a rotating turret, you can similarly figure out how far it needs to rotate in order to make the detected target location and desired location match.
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2012, 07:12
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Robot Position Tracking, Gyro, Alignment help needed

After you acquired an image from the camera and processed the image to find some targets, the target will give you center_mass_x and center_mass_y. By comparing center_mass_x to the screen_center_x (160 if your resolution is 320x240), then you can calculate the angle you need to turn the robot to bring center_mass_x to be aligned with screen_center_x. Once you did that, your target is dead ahead.
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2012, 12:30
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
Re: Robot Position Tracking, Gyro, Alignment help needed

Okay we have done all of this, but we have an issue. You know how the tracking gives us a number per square detected right? So its 0-3 for the squares? How do I tell the robot that I want to move to x square that was recognized? Basically, how does the processing software assign its values?
__________________
Eagle Engineering 1138
Reply With Quote
  #6   Spotlight this post!  
Unread 17-02-2012, 14:23
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Robot Position Tracking, Gyro, Alignment help needed

Quote:
Originally Posted by cjlane1138 View Post
You know how the tracking gives us a number per square detected right? So its 0-3 for the squares? How do I tell the robot that I want to move to x square that was recognized? Basically, how does the processing software assign its values?
What number are you referring to? The tracking function will give you a sorted array of potential targets. If you have "good filtering", the size of the array would be between 1 to 4 targets, depending on how many of them are in view. If you have more than 4 targets, it means you have some false positives. I am not 100% sure, but I have an impression that the array is sorted by quality, so up to the first four are likely valid targets, the rest can be discarded. Regardless, when enumerating the targets in the array, you should validate them yourself. One good validation is to check the aspect ratio of the rectangle. Taking perspective into account, we choose targets with an aspect ratio between 1.0 to 2.0.

When enumerating the targets in the array, not only that you validate and discard false positive targets, you also go through an algorithm to "select target". In teleop mode, the target selection is driven by the drivers. After we got the array of possible targets filtered down, we (would like to) display the rectangle overlays on the video stream of the driver station. A pair of buttons on the joystick are used by the driver to "cycle" through the possible targets. Then we use the data of the selected target to compute the shooter motor speed according to the target distance and height.
__________________
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


All times are GMT -5. The time now is 17:35.

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