Go to Post All the gangstas in FRC have solid gold CRios. It's called "blingage". If you don't have a solid gold CRio, you're not a straight-up G. :D - Jamie Kalb [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 19-02-2010, 23:45
pSYeNCe's Avatar
pSYeNCe pSYeNCe is offline
Programaster
AKA: James
FRC #2010 (Lightning Bots)
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2007
Location: Ohio
Posts: 58
pSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to behold
Question Built in distance calculations?

I was under the impression that there was no built in way to get distance from the Axis camera. After many hours of searching, I finally ran across this whitepaper on how to do it- however, another team member told me that the distance value is already in the program. If it is there, where is it? I've unbundled the Tracking Data and Target Info clusters to no avail. It would save a lot of time if this value is floating around somewhere...
(We're programming in LabVIEW; I guess it's irrelevant to put that here since this is the LabVIEW subforum, but you never know )
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2010, 08:19
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: Built in distance calculations?

I don't believe there is. The way I did it last year was to use the angle of the camera (either fixed or based of the servo or some sensor to measure that angle), the use trig to calculate the distance to the target.

Like this:

Target
|
----------- Robot camera
Find the hypotenuse
__________________
Twitter Profile

Last edited by Luke Pike : 20-02-2010 at 08:22. Reason: ASCII art failed
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2010, 09:28
ebmonon36's Avatar
ebmonon36 ebmonon36 is offline
Registered User
AKA: Eric Bredehoeft
FRC #1018 (Robodevils)
Team Role: Mentor
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Indianapolis, IN
Posts: 428
ebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud ofebmonon36 has much to be proud of
Send a message via AIM to ebmonon36
Re: Built in distance calculations?

If you look in the Rotate to Target vi in Teleop, there is a distance calculation at the top of that vi. It is not set up as an output but it could be.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2010, 10:04
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,752
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: Built in distance calculations?

Be sure to compare against a tape measure. You may need to adjust the divisor a bit.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2010, 13:29
pSYeNCe's Avatar
pSYeNCe pSYeNCe is offline
Programaster
AKA: James
FRC #2010 (Lightning Bots)
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2007
Location: Ohio
Posts: 58
pSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to behold
Re: Built in distance calculations?

Thanks everyone, we'll test it out once we get the camera installed.
Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2010, 15:34
Carter12s's Avatar
Carter12s Carter12s is offline
Mentor
FRC #2036 (Black Knights)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Boulder CO
Posts: 93
Carter12s is just really niceCarter12s is just really niceCarter12s is just really niceCarter12s is just really nice
Re: Built in distance calculations?

Regardless of whether or not the code exists getting distance values from the camera will be a fairly imprecise method. I would instead suggest using the KOP digital encoders in conjunction with a position tracking program. I don't know of a Labveiw edition of one but i know that there must be. I have used in Java a program that by getting encoder values with give real time the position and speed of a robot on a Cartesian plane; The encoders in this years KOP are extremely accurate and if implemented in this manner would yield not only the distance to the goal, but if used in conjunction with a field map would give every distance on the field.
Reply With Quote
  #7   Spotlight this post!  
Unread 20-02-2010, 21:49
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,752
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: Built in distance calculations?

In reality, all of these methods are pretty imprecise. Encoders on drive wheels cannot account for slip or sideways motion due to a collision with field or another robot.

The camera method works by knowing the real-world size of the target. At a given distance, the target should measure the same pixel size. Moving closer to the target increases the pixel size, and moving farther decreases. You can think through the symmetric triangles or use trig if you like, but estimating distance based on the perceived size of a known object is a pretty accurate approach. The thing that can cause moderate error is if the vision selects the inner circle rather than the outer error to base the distance computation.

The best way to determine the error is to measure it. Determine if it is accurate enough for what you need and determine if other approaches are more accurate.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2010, 22:32
pSYeNCe's Avatar
pSYeNCe pSYeNCe is offline
Programaster
AKA: James
FRC #2010 (Lightning Bots)
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2007
Location: Ohio
Posts: 58
pSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to beholdpSYeNCe is a splendid one to behold
Re: Built in distance calculations?

Quote:
Originally Posted by Greg McKaskle View Post
In reality, all of these methods are pretty imprecise.
Yeah, I had a feeling they would be. Depending on the results we get when we test it, we may not use distancing. Our code, fortunately, doesn't depend on it.

The camera method works by knowing the real-world size of the target... distance computation.[/quote]

I've noticed that the tracking software slips up a lot in our lighting conditions, perhaps because the setting in the Begin.vi is the default (fluorescent lighting, I think? I don't have it in front of me) and the default is probably designed for competition circumstances. Again, I'll have to test to get results.
Reply With Quote
  #9   Spotlight this post!  
Unread 21-02-2010, 08:25
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,752
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: Built in distance calculations?

If you are using the ellipse detection like the default code is, the white balance setting shouldn't matter much. The first thing the code does is extract a grayscale luminance image. You might as well use a fixed setting IMO.

There is a white paper on the NI site that talks about the camera code and some of the things to consider. One thing that seems far more likely in a shop than in a competition is streaked lighting. If you've built a shiny target and you have rows of fluorescent lights, they tend to make long white streaks across the black of the target. You can see them if you kneel down and look at it from the camera's vantage point. Other than that, you would like to get a good contrast level, and fast camera response.

If you have images that do not work well with the ellipse code, post the image and perhaps people can help diagnose and suggest solutions. BTW, the default dashboard saves an image every second and keeps the last sixty in the documents directory I think. That will hopefully help document the camera performance and give you some data to crunch on to test out different approaches.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread 21-02-2010, 14:49
rath358's Avatar
rath358 rath358 is offline
Registered User
AKA: max
FRC #0093 (NEW Apple Corps)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Wisconsin
Posts: 27
rath358 is on a distinguished road
Re: Built in distance calculations?

We have found that image size works great for determining distance. I have developed a special VI that extracts the height of the target from the supplied information, then plugs that into a formula I derived by graphing a bunch of data in excel. It is accurate to 30 feet on medium resolution, within +/- 6inches, and 45ish feet on high. Accuracy only drops off only because of problems finding the target itself.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Torque Calculations AndyB General Forum 7 19-05-2007 00:06
Autonomous calculations Tz0m Programming 5 24-02-2007 06:15
Motor Calculations John Gutmann Motors 3 25-06-2006 08:39
Distance calculations Max Brin Programming 3 22-02-2006 21:38
Seeding Calculations archiver 2000 50 23-06-2002 21:57


All times are GMT -5. The time now is 22:04.

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