Go to Post This is an Internet forum- if you want to relax, sit next to a pool and sun bathe. However, the rest of us will have a mature discussions and debates on the CD forums. - MikeDubreuil [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 07-01-2013, 12:05
Anyun Anyun is offline
Co-Captain Team 1308
FRC #1308 (Wildcats)
Team Role: Programmer
 
Join Date: Aug 2012
Rookie Year: 2009
Location: Cleveland
Posts: 13
Anyun is an unknown quantity at this point
Aiming using reflective tape

We have an axis camera and the encoders set up on our [tentative] shooter. The camera is detecting reflective tape shape, but how are we supposed to have the control system use the information (based on the angle at which it views the rectangle, right?) to tell the encoders what to do?

We have yet to have a working accurate autonomous, so this would help a lot.
Reply With Quote
  #2   Spotlight this post!  
Unread 07-01-2013, 12:09
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Aiming using reflective tape

So the general answer is you need to write an algorithm that figures out where on the image the center of the rectangle is, and use that to determine the amount to turn.

The hard part is writing that algorithm. There are a bunch of solutions, none of which are simple. You could use the NI Vision libraries, or you could include OpenCV with your robot project. You could write your own image recognition algorithm (SAD, threshold, SSD, etc.).
__________________
Nathan Hui
B.S. Electrical Engineering, UCSD '16
FRC 2473 (CHS Robotics), Team Captain '12
FTC 4950, 6038
Reply With Quote
  #3   Spotlight this post!  
Unread 07-01-2013, 12:21
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: Aiming using reflective tape

What do you mean when you say "encoder"? One typically doesn't tell an encoder to do anything; it's a sensor that provides a measured value.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-01-2013, 15:25
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Aiming using reflective tape

As a disclaimer, our drive team was better at dead-reckoning our catapult last year than our code was at aiming during autonomous. If you don't have to move (don't intend to pick up frisbees) during autonomous, you could simply determine what image parameters would indicate a hit, and output text to the dashboard ("On Target", "Too far left/right/back/forward").
(They were also better at aiming during the match with a tape-cross-hair on the screen, so we removed the whole function.)

Given the above, you weren't very clear how far into the image processing you've gotten. Here is my code from last year, it's not broken into modules very well so I'll give you some line numbers:
https://github.com/TeamExcel/Project.../Robot2012.cpp
1313: A function to init the camera
795: A function that takes a camera image and does image processing, and sets up variables for the pid.
753: Has teleop glue logic.
451: Has logic in disabled to report on/off targeting

My strategy last year was to capture an image every second, and use each image to feed parameters to the PID loops. The actual PID loop was driven by a gyroscope (for rotation) and accelerometer (a not so great way of tracking distance). I never got far enough to check whether or not taking a picture in motion (every image after the first) was an accurate way to feed the PIDs, I'm guessing that time delay which likely exists was causing a long settling time (since each updated target after the first would not capture the motion that had taken place between taking the image and setting the new target).

I thought it would work well, and hope to be able to develop it further this year. It certainly reduced the processing power needed for image processing, and it did work sorta (I hadn't done PIDs before, so that was the primary issue, ran out of time on build season for tuning/guessing).
Reply With Quote
  #5   Spotlight this post!  
Unread 09-01-2013, 17:52
Sinani201 Sinani201 is offline
Registered User
AKA: Daniel
FRC #1836 (Milken Knights)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Los Angeles, CA
Posts: 12
Sinani201 is an unknown quantity at this point
Re: Aiming using reflective tape

This might be very useful for you.
__________________
Enjoy your day.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-01-2013, 14:47
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,988
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Aiming using reflective tape

Quote:
Originally Posted by Anyun View Post
We have yet to have a working accurate autonomous, so this would help a lot.
Not at all surprising 53 hours into build season.

I truly hate to say this, but have you searched Chief Delphi at all? I know of several threads that deal with this.
__________________

I am N2IRZ - What's your callsign?
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 12:57.

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