Go to Post A world where lawyers and police don't get much work -- there's a goal to work toward. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 26-02-2014, 16:32
Jarren Harkema's Avatar
Jarren Harkema Jarren Harkema is offline
Dancing Drive Coach
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Sep 2013
Rookie Year: 2013
Location: Michigan
Posts: 160
Jarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to all
Process one Image

Hi everyone. For the life of me I cannot wrap my head around how to go about vision processing.

All I want to do:
1. Take 1 picture at the beginning of autonomous.
2. Identify the presence of the dynamic vision target.
3a. If present, drive forward and launch ball. (This code already in place)
3b. If not present, wait 5 seconds, then drive forward and launch ball.

I have ran the 2014 Image Processing VI, and it can identify the targets. I have also gone through Tutorial 8 - "Integrating Vision into the robot code" on the Getting Started screen. I understand the basics of how the VI identifies and scores the targets.

At this point I'm stuck. I can't seem to find any resources for how to actually capture the image, process it, and decide to shoot or wait. I understand that processing on the cRIO is slow, but would it work if it is just processing one image?

It's difficult being the only programmer! I just want to thank the CD community for the help they have given on other topics, I hope to be able to learn enough this year to get more team members on board with programming next year.
Reply With Quote
  #2   Spotlight this post!  
Unread 26-02-2014, 16:49
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Process one Image

Instead of taking a picture, our bot does the same thing except with real-time video capture.
For the entirety of autonomous, our bot checks for the light to flash, then moves forward when it is detected. This is done by having the code set a global variable named "State" to true whenever there is a target detected (i.e. the light) and activating the autonomous code when said "State" is true and remaining still while false via case structure. Unfortunately, I do not have the exact code on me right now, but when I get back to the team's computer I can get more detailed on it.
Reply With Quote
  #3   Spotlight this post!  
Unread 27-02-2014, 12:15
killer_rabbit3's Avatar
killer_rabbit3 killer_rabbit3 is offline
programming rabbit
AKA: Alexander Martinez
FRC #1038 (Lakota Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: liberty township OH
Posts: 13
killer_rabbit3 is an unknown quantity at this point
Re: Process one Image

Our team uses real time video for auton. We also have our vision processing and target identification done on the dashboard as to not overload the crio.
Reply With Quote
  #4   Spotlight this post!  
Unread 27-02-2014, 12:18
Jarren Harkema's Avatar
Jarren Harkema Jarren Harkema is offline
Dancing Drive Coach
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Sep 2013
Rookie Year: 2013
Location: Michigan
Posts: 160
Jarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to all
Re: Process one Image

However we end up doing it, the main point I still can't figure out is how to send a signal to the auto VI indicating that the target was found.
Reply With Quote
  #5   Spotlight this post!  
Unread 27-02-2014, 12:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Process one Image

You can set a global flag in your vision processing code that the Autonomous vi can read.
Be sure to use an image you capture after the start of autonomous and not one that was captured before (when everything is lit up).
I.e., don't set the flag constantly, wait until you are sure.

Adding Global Variables
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #6   Spotlight this post!  
Unread 05-03-2014, 16:55
Jarren Harkema's Avatar
Jarren Harkema Jarren Harkema is offline
Dancing Drive Coach
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Sep 2013
Rookie Year: 2013
Location: Michigan
Posts: 160
Jarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to allJarren Harkema is a name known to all
Re: Process one Image

I was able to figure it out last week Thursday. Thanks for the help guys. I went back through and looked through the tutorials again. Apparently I was following the steps to have the cRIO process the image, and was missing something. I just re-did it, instead offloading the processing onto the dashboard. From that point I simply sent back a boolean value, like Mark suggested. I also added a fail safe in auto that will cause the robot to fire if it does not detect the target after 6 seconds. This way, we will ensure an attempt at a shot, even if our camera is having problems.

I have yet to test it on our actual robot, but will be able to during the rest of our un-bag time tonight.
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 04:32.

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