Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   getting distance from camera (http://www.chiefdelphi.com/forums/showthread.php?t=103411)

tilky 20-02-2012 17:04

getting distance from camera
 
the title explains it all. how would you use the reflective tape to find the distance from the camera to it

propionate 20-02-2012 18:17

Re: getting distance from camera
 
If you unbundle the target info global variable, you will see that one of the variables calculated is distance

Kazel 20-02-2012 18:38

Re: getting distance from camera
 
Hi,

Our team is having trouble integrating the target info into our main teleop.vi. We tried copying the Rectangular Processing example vi into our main project (the vi that only runs on the computer) and then placing it in our main code. However, whenever I try to run the code with this vi placed anywhere in it, the code doesn't work. I tried removing the vi and the code worked normally. Has anybody figured out the best way to actually use the target info?

Greg McKaskle 20-02-2012 20:00

Re: getting distance from camera
 
There is a tutorial, available on the launch screen that walks you through the basics of the Rectangle example.

There are actually two different implementations, one targets the laptop, and one targets the cRIO. The cRIO one already has some amount of Robot Main and a Vision Processing.vi that incorporates the rectangle processing. As the tutorial explains, you open the vision processing and do a Save As and include dependencies to save it to your robot project. This will overwrite the Vision Processing VI and the Robot Globals, which should be what you want, but if you have added your own globals, you need to merge them.

Greg McKaskle

Kazel 20-02-2012 20:54

Re: getting distance from camera
 
Wow, can't believe I didn't see that tutorial a long time ago. Thank you very much! I had copied our current project from another computer, and it turns out I was having some path issues, but once I got those sorted out it worked fine!

Also, I apologize for hi-jacking this thread...

tilky 21-02-2012 08:05

Re: getting distance from camera
 
where is target info global?

Greg McKaskle 21-02-2012 08:18

Re: getting distance from camera
 
the target info global is written to in the Vision Processing VI and defined in the Robot Global VI. By default, no code in your project is reading it. You should copy/paste the global node or drag it from the project and select the right variable.

Greg McKaskle

Alan Anderson 21-02-2012 08:36

Re: getting distance from camera
 
If you have followed the instructions for integrating the rectangular vision target code into your project, the Target info global variable should be with all the other global variables, in the Robot Global Data vi.

tilky 21-02-2012 09:19

Re: getting distance from camera
 
ummmmm....is the global variable supposed to be there?

Alan Anderson 21-02-2012 11:03

Re: getting distance from camera
 
Quote:

Originally Posted by tilky (Post 1131552)
ummmmm....is the global variable supposed to be there?

If by "the global variable" you mean "Target info" and if by "there" you mean "in Robot Global Data.vi", then yes. If you mean something else, please ask again with more specific words.

tilky 21-02-2012 11:39

Re: getting distance from camera
 
its not there. There is only enable vision, image size, and LED Toggle Rate.

Alan Anderson 21-02-2012 11:55

Re: getting distance from camera
 
Did you follow the instructions for adding the rectangular target processing code to your robot project? Doing that properly will replace the robot globals vi file with one that has the target info included.

tilky 21-02-2012 22:54

Re: getting distance from camera
 
can you post a link of where to find that tutorial?

Alan Anderson 21-02-2012 23:47

Re: getting distance from camera
 
It's Tutorial 8—Integrating Vision into Robot Code. Find it, and all the other LabVIEW Getting Started Tutorials, on the Tutorials tab in LabVIEW.

tilky 22-02-2012 09:28

Re: getting distance from camera
 
is there anywhere else i can find it, my computer is stupid and won't update the labview home screen with the frc update

Alan Anderson 22-02-2012 10:27

Re: getting distance from camera
 
You really do have to install the LabVIEW update. If you haven't done that, you're missing much more than the tutorials. You're also not in compliance with the rules.

What does "won't update the LabVIEW home screen" mean? What happens when you try to run the update?

tilky 22-02-2012 21:08

Re: getting distance from camera
 
i install that, and everything gets installed, but the start screen for labview doesn't change.

Alan Anderson 22-02-2012 22:57

Re: getting distance from camera
 
What all does the unchanged start screen say? Does it have the "LabVIEW FRC 2012" text at the top and the FIRST logo at the bottom?

You might need to reinstall LabVIEW. I'm wondering if it got loaded properly in the first place. How did you install it?

tilky 23-02-2012 09:08

Re: getting distance from camera
 
i installed it from the flash drive. all of the wpi robotics vis are in there, but the home screen doesn't change.

tilky 23-02-2012 10:44

Re: getting distance from camera
 
when you click on one of the tutorials, is it a webpage, a pdf, what is it?

Mark McLeod 23-02-2012 11:09

Re: getting distance from camera
 
The Tutorials are a single webpage located on your installation at:

C:\Program Files\National Instruments\LabVIEW 2011\manuals\FRC_Programming_Guide\index.html

tilky 23-02-2012 12:08

Re: getting distance from camera
 
thanks i found it.

tilky 23-02-2012 19:55

Re: getting distance from camera
 
one more question. can you just copy and paste the code from rectangle processing and just replace the controls with constats?

Alan Anderson 23-02-2012 23:02

Re: getting distance from camera
 
Why are you working so hard to avoid doing the simple steps listed in order to incorporate the example into your robot project? There are a half dozen or more virtual instruments that go along with the rectangular target processing code, and that would be a lot of copying and pasting.

If you don't use controls, how are you going to tweak the color response of the code?


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi