Go to Post And I have to say, those days where you are just beating yourself, and smacking your head against the wall, and you just wish the robot would catch fire so you could go home, make the top of the mountain that much sweeter. - Gboehm [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 30-01-2017, 19:21
bacarpenter bacarpenter is offline
Lead programmer (2 years)
AKA: Baylee Carpenter
FRC #2197 (Las Pumas)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Indiana
Posts: 24
bacarpenter is an unknown quantity at this point
Question Peg targeting

I've been trying to use a camera to target the reflective tape around the peg. I've looked at tutorials and examples but I can't get it to recognize the peg tape.
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2017, 07:53
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 410
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Peg targeting

Try adjusting the exposure time and ISO level of the camera or adjusting threshold levels in your processing. Besides that, we can't help you very much without knowing what your code or GRIP pipeline and your sample images look like.
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2017, 08:18
Ari423's Avatar
Ari423 Ari423 is offline
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 661
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: Peg targeting

Quote:
Originally Posted by euhlmann View Post
Try adjusting the exposure time and ISO level of the camera or adjusting threshold levels in your processing. Besides that, we can't help you very much without knowing what your code or GRIP pipeline and your sample images look like.
This was posted in the LabVIEW subforum, so I would assume they are using NI Vision instead of GRIP. The point still stands that it's hard for us to help without decent pictures of your code, sample pictures, threshold values, and output post-processing images.
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2017, 01:34
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 410
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Peg targeting

Quote:
Originally Posted by Ari423 View Post
This was posted in the LabVIEW subforum, so I would assume they are using NI Vision instead of GRIP. The point still stands that it's hard for us to help without decent pictures of your code, sample pictures, threshold values, and output post-processing images.
Whoops, didn't notice that the forum section was LabVIEW
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2017, 09:12
flemdogmillion's Avatar
flemdogmillion flemdogmillion is offline
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 149
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Re: Peg targeting

Make sure Enable Vision in Robot Main is true by default.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2017, 18:26
bacarpenter bacarpenter is offline
Lead programmer (2 years)
AKA: Baylee Carpenter
FRC #2197 (Las Pumas)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Indiana
Posts: 24
bacarpenter is an unknown quantity at this point
Re: Peg targeting

Okay so I've been working on getting my program to detect the high goal target then move the robot to line up with it. I got it to recognize the goal with a lot of help from the FRC vision example. But now I've got two major problems, my vision processing takes forever to process, whenever I move the robot it takes 3 seconds or so for the values to change and this makes it hard to move the robot accurately. Another problem I have is that I have no idea how to get my program to recognize the peg target. I've attached my vision processing code to this post any help on something I could do to make it work faster and/or work with the peg would help a ton.
Attached Thumbnails
Click image for larger version

Name:	Vision Processing.jpg
Views:	24
Size:	288.0 KB
ID:	21751  
Reply With Quote
  #7   Spotlight this post!  
Unread 08-02-2017, 22:37
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,770
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Peg targeting

At a high level (as my team uses Java rather than LabView):

Vision processing is usually low-rate, high-latency. Use the results of vision processing to drive action based on encoders or an inertial system (gyros and encoder), which return data on much shorter time scales.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2017, 02:20
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,569
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Peg targeting

Where is this code located? On the dashboard? On the Robot? Or is this just the vision example? What resolution are you running? What compression are you using?
Reply With Quote
  #9   Spotlight this post!  
Unread 09-02-2017, 09:11
flemdogmillion's Avatar
flemdogmillion flemdogmillion is offline
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 149
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Re: Peg targeting

Quote:
Originally Posted by GeeTwo View Post
At a high level (as my team uses Java rather than LabView):

Vision processing is usually low-rate, high-latency. Use the results of vision processing to drive action based on encoders or an inertial system (gyros and encoder), which return data on much shorter time scales.
This. it's impossible to stress this enough.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #10   Spotlight this post!  
Unread 09-02-2017, 14:20
bacarpenter bacarpenter is offline
Lead programmer (2 years)
AKA: Baylee Carpenter
FRC #2197 (Las Pumas)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Indiana
Posts: 24
bacarpenter is an unknown quantity at this point
Re: Peg targeting

Currently my code is located on the roborio and the resolution is set to 360x240 the compression is whatever the default value is I've never changed it. I'm currently working on processing the image on the dashboard instead but I haven't tested it yet. I kinda get what you guys are saying about using another sensor to actually line it up but I don't know exactly how to implement that.
Reply With Quote
  #11   Spotlight this post!  
Unread 09-02-2017, 14:31
flemdogmillion's Avatar
flemdogmillion flemdogmillion is offline
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 149
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Re: Peg targeting

Quote:
Originally Posted by bacarpenter View Post
Currently my code is located on the roborio and the resolution is set to 360x240 the compression is whatever the default value is I've never changed it. I'm currently working on processing the image on the dashboard instead but I haven't tested it yet. I kinda get what you guys are saying about using another sensor to actually line it up but I don't know exactly how to implement that.
Get a cheap gyro, perhaps the ADXRS450, and set it up so that the angle resets every time the vision info changes (in Periodic Tasks.vi in a 10ms loop). That way, you have an angle that, when subtracted from the angle you calculate from your vision data, gives you how far off you are, even when vision doesn't update. At least that's how I did it.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #12   Spotlight this post!  
Unread 09-02-2017, 14:45
bacarpenter bacarpenter is offline
Lead programmer (2 years)
AKA: Baylee Carpenter
FRC #2197 (Las Pumas)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Indiana
Posts: 24
bacarpenter is an unknown quantity at this point
Re: Peg targeting

Quote:
Originally Posted by flemdogmillion View Post
Get a cheap gyro, perhaps the ADXRS450, and set it up so that the angle resets every time the vision info changes (in Periodic Tasks.vi in a 10ms loop). That way, you have an angle that, when subtracted from the angle you calculate from your vision data, gives you how far off you are, even when vision doesn't update. At least that's how I did it.
Okay thank you for all your help. I have a gyro currently working on the robot, but the problem I see with using the gyro angle to line it up is distance. Right now my vision code won't figure the distance from the target it just says infinite. If I'm closer or further away that'd change the angle calculations, but right now I don't know how to get that distance.
Reply With Quote
  #13   Spotlight this post!  
Unread 09-02-2017, 19:38
flemdogmillion's Avatar
flemdogmillion flemdogmillion is offline
Programmer, Builder, Driver...
FRC #3007
 
Join Date: Nov 2016
Rookie Year: 2015
Location: Minnesota
Posts: 149
flemdogmillion will become famous soon enoughflemdogmillion will become famous soon enough
Quote:
Originally Posted by bacarpenter View Post
Okay thank you for all your help. I have a gyro currently working on the robot, but the problem I see with using the gyro angle to line it up is distance. Right now my vision code won't figure the distance from the target it just says infinite. If I'm closer or further away that'd change the angle calculations, but right now I don't know how to get that distance.

https://www.chiefdelphi.com/forums/s...d.php?t=154930 try the code posted in this thread. It's my LabView code that my team won't be using.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #14   Spotlight this post!  
Unread 09-02-2017, 20:23
bacarpenter bacarpenter is offline
Lead programmer (2 years)
AKA: Baylee Carpenter
FRC #2197 (Las Pumas)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Indiana
Posts: 24
bacarpenter is an unknown quantity at this point
Re: Peg targeting

Quote:
Originally Posted by flemdogmillion View Post
https://www.chiefdelphi.com/forums/s...d.php?t=154930 try the code posted in this thread. It's my LabView code that my team won't be using.
okay thank you for that link it helped me a ton. My code know detects the peg target and has a distance that's pretty accurate. Thanks for all your help!
Reply With Quote
  #15   Spotlight this post!  
Unread Yesterday, 17:08
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,569
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Peg targeting

This just occurred to me. If you are a LabVIEW team that wants to target the peg, but is struggling to modify the example code to do it:

Try turning your camera on it's side.

You may get a pleasant surprise.

(YMMV, I haven't tried this myself).
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 19:51.

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