Go to Post If you are content with where you are, you have celebrated the right things. If not, perhaps it is time to reconsider... what’s most important to you. - StephLee [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 08-02-2017, 16:52
RoboBucs RoboBucs is online now
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 82
RoboBucs is an unknown quantity at this point
Vision Distance Question

This is the first year we've really tried vision, so if I seem lost, it's because all of vision is pretty much new to me, but I successfully integrated the 2017 vision example code into our vision code for this year. The camera display in vision shows the camera, and is filtering to show only our reflective tape correctly, however, the distance reading comes back as infinite(inf). Any ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2017, 08:33
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 135
aeastet is an unknown quantity at this point
Re: Vision Distance Question

Quote:
Originally Posted by RoboBucs View Post
This is the first year we've really tried vision, so if I seem lost, it's because all of vision is pretty much new to me, but I successfully integrated the 2017 vision example code into our vision code for this year. The camera display in vision shows the camera, and is filtering to show only our reflective tape correctly, however, the distance reading comes back as infinite(inf). Any ideas?
We your vision finds the target is the box red or green? You can change the threshold value to lower the level and it should turn green. You may also have to look a the code to see what you are not getting. When I went through the code the first time I noticed that it needed four points to calculate the distance. I made my own that only requires the line to get the distance. It seems to work really well. If you can not figure it out let me know and I will send you our distance code.
__________________
Team 6043 Allegan Tigers
LabVIEW Developer for Kauai Labs (navX and SF2 Libraries)
http://www.kauailabs.com/
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2017, 09:10
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: Vision Distance Question

Try this: https://www.chiefdelphi.com/forums/s...d.php?t=154930
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2017, 12:55
RoboBucs RoboBucs is online now
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 82
RoboBucs is an unknown quantity at this point
Re: Vision Distance Question

It finds it as red currently. I appreciate the replies and links, I'll try changing the threshold later today and update on the results, if that doesn't work I'll give those pdf links a go. Thanks for the replies!
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2017, 13:35
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: Vision Distance Question

Red means it doesn't have a valid targst. Try changing the score cutoff.
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2017, 13:51
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: Vision Distance Question

Quote:
Originally Posted by Tom Line View Post
Red means it doesn't have a valid targst. Try changing the score cutoff.
His problem is probably that the line along which it searches for edges is vertical, thus not crossing any stripes. This causes the distance calculation to fail, regardless of score cutoff. The line also needs to extend a few pixels past the overall bounding rectangle on either end.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #7   Spotlight this post!  
Unread 09-02-2017, 15:56
RoboBucs RoboBucs is online now
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 82
RoboBucs is an unknown quantity at this point
Re: Vision Distance Question

Now I'm getting errors. I changed nothing coming into today but as soon as I connect my driver station started pumping out errors like there was no tomorrow. This was the error: ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW.


Any ideas?
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2017, 19:33
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 RoboBucs View Post
Now I'm getting errors. I changed nothing coming into today but as soon as I connect my driver station started pumping out errors like there was no tomorrow. This was the error: ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW.





Any ideas?


Font file not found is okay, it means the font for the scoring numbers that are overlayed on the displayed images in the front panel of vision processing.vi isn't on the RoboRIO.
For the other error, you will need to remove the calibration code (or disable it). When targeting the peg, calibration does pretty much nothing.
Make sure that when you want to save changes to values entered in the front panel, right click -> data operations -> make current value default, then save the VI. Otherwise, it will reset the value on you when you close the VI or try to build the project.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #9   Spotlight this post!  
Unread Yesterday, 08:55
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,766
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: Vision Distance Question

The errors about the event not being supported are caused by putting desktop code on the roboRIO. There is a call to the calibration helper that passes the reference to the picture control. This lets you click and draw a line on the colored region and it calculates the HSL range settings based on your statistic settings.

But this can't work in a headless RT environment. In that situation, you remove the cal from the roboRIO, and if you still want it, you put it into your dashboard and share the results to the robot.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread Yesterday, 16:33
RoboBucs RoboBucs is online now
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 82
RoboBucs is an unknown quantity at this point
Re: Vision Distance Question

I resolved the errors, thank you for the help on that, but now I'm back to the first problem. I tried lowering the score cutoff and using a horizontal line, but both still come back red with an infinite reading. Any ideas?
Reply With Quote
  #11   Spotlight this post!  
Unread Yesterday, 20:35
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: Vision Distance Question

Quote:
Originally Posted by RoboBucs View Post
I resolved the errors, thank you for the help on that, but now I'm back to the first problem. I tried lowering the score cutoff and using a horizontal line, but both still come back red with an infinite reading. Any ideas?
Increase your line border values, they need to be greater than, say, 2 or 3, and by default they are 6 and 1.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #12   Spotlight this post!  
Unread Yesterday, 21:10
RoboBucs RoboBucs is online now
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 82
RoboBucs is an unknown quantity at this point
Re: Vision Distance Question

Alright, I'm getting readings perfectly now if I put the reflective tape horizontal, rather than vertical, because with the code that I have now, I can't do the mouse drag to calibrate it, and I can't figure out how to make the calibration line horizontal instead of vertical. I tried switching the control for that in the distance calculation subVI, but it had no effect. Where do is the option for it to track horizontally rather than vertically as it does by default?
Reply With Quote
  #13   Spotlight this post!  
Unread Today, 09:41
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: Vision Distance Question

Quote:
Originally Posted by RoboBucs View Post
Alright, I'm getting readings perfectly now if I put the reflective tape horizontal, rather than vertical, because with the code that I have now, I can't do the mouse drag to calibrate it, and I can't figure out how to make the calibration line horizontal instead of vertical. I tried switching the control for that in the distance calculation subVI, but it had no effect. Where do is the option for it to track horizontally rather than vertically as it does by default?
The line isn't a calibration line, it's the distance calculation line. That line is drawn in Rectangle Comparison.vi, near the top of the block diagram. You can't draw that line, the program has to draw the line based on the position of the particles.
__________________
Team 4506: 2015-2016
Team 3007: 2017

Jack of all trades except C++ & Java
Reply With Quote
  #14   Spotlight this post!  
Unread Today, 19:09
RoboBucs RoboBucs is online now
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 82
RoboBucs is an unknown quantity at this point
Re: Vision Distance Question

Even after all of this it still is reading infinite. It appears to still be using a vertical line instead of a horizontal. I'm clueless as to what I'm doing wrong at this point.
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