Implementing the Camera Example

Hi,
I’m having trouble implementing the 2013 camera example into our Labview program. If I copy and paste everything in I get a conflicting vi error once I put the rectangular target main.vi or the vision processing vi in. All we need from the camera is the distance to the target. So am I just putting the code in wrong, or should I try something else?

All help appreciated!

I would suggest undoing anything you have done so far, as following the steps below may conflict with earlier attempts.

  1. Create a copy of the “Rectangular Target - 2013” folder that can be found in your LabVIEW program files (let me know if you need help finding it).
  2. Move this copied version of the folder into your project folder
  3. Open up your project
  4. Right click on Vision Processing.vi and click “replace,” then select the Vision Processing VI in the “Rectangular Target - 2013” folder that you just copied.
  5. Follow the prompts. You’ll be told that there are conflicts. For all of them, select the file that was in your original project - not the one that is in the “Rectangular Target” folder.
  6. The final prompt will ask again if you want to use the new Vision Processing VI instead of your original one. Confirm that you want to use the one in the “Rectangular Target - 2013” folder.

Once you save the project, go into the new Vision Processing VI and search for the broken wires. You will have to create a new global variable to replace the one that you told it not to reference anymore.

How do I output the computed distance from the camera on to the dash board?

If the distance was computed on the robot, use SmartDashboard to publish it. I believe it already has been published as a “Target 1 Info” array of numbers.

Then you need to follow the comments on the dashboard diagram to either bind or read and display the value.

Greg McKaskle

How do I display distance on the message area (without using smartdashboard)?

I have been trying to follow the directions on how to incorporate the vision example and have hit a road block. The directions say to recreate the global variable. I find the global variable with the broken wires, but have no idea of how to recreate it. Having to change directions at the last minute and this is stumping me. Thanks for any help.

Right click on the target info cluster (pink wire), right before it enters the shift register at the far right side of the vision tracking code. This should be the same wire that is going into the broken global variable. Once you have right clicked, click “create constant.” Now, open up your Global Variables VI and drag this constant from the Vision Processing VI to the Global Variables VI. It will create a new global variable - simply rename it “Target Info” and you’re good to go. You can now delete that constant you created.