Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Simple Crosshair (http://www.chiefdelphi.com/forums/showthread.php?t=102777)

Luiz12 14-02-2012 02:26

Simple Crosshair
 
Hi I am a rookie programmer who barely started using labview. I basically finished all my controls including the kinect so I was wondering if it was possible to add a simple + crosshair to the video camera feed. I have the camera directly to the router not cRio. So is there a way I can do this without to much complication.

its da PAT!!! 14-02-2012 02:59

Re: Simple Crosshair
 
The simple way is to place tape on on the screen. When you open the driver user, the drive station will default to the same place every time.

Luiz12 14-02-2012 03:07

Re: Simple Crosshair
 
Is there a way I can program something..

Greg McKaskle 14-02-2012 07:54

Re: Simple Crosshair
 
The first step is to open the Getting Started Window of LabVIEW. It is up when you first launch and it is available from the View menu. Create a project based on the Dashboard template.

When built, that code will create the same thing as the initial installation.

There are a couple ways to add crosshairs. One, go to the panel, right click in open space and choose lines from the decoration palette.Place and size the lines, color them if you need to. You could use rectangles if you wanted thicker lines.

The second approach is to add the lines into the image programmatically. Go to the diagram and find the loop near the top that Reads the MJPG and the next step it does is clear the overlays. Instead, you want to right click on the Clear and choose Replace Overlay and choose the Line function. Copy it and hook up another. Hook up the parameter values to describe the line endpoints and color.

To test it, stop the other dashboard EXE and run your VI using the run arrow. To build it into an EXE, you go to the bottom of the project window, open the Build Specifications, and right click and Build. The resulting dialog will tell you where the EXE was saved. Copy it to the Program Files/FRC Driver Station folder and you are good to go. The DS will launch yours next time it starts up.

Greg McKaskle

ratdude747 14-02-2012 08:49

Re: Simple Crosshair
 
Quote:

Originally Posted by Greg McKaskle (Post 1126309)
The second approach is to add the lines into the image programmatically. Go to the diagram and find the loop near the top that Reads the MJPG and the next step it does is clear the overlays. Instead, you want to right click on the Clear and choose Replace Overlay and choose the Line function. Copy it and hook up another. Hook up the parameter values to describe the line endpoints and color.

To test it, stop the other dashboard EXE and run your VI using the run arrow. To build it into an EXE, you go to the bottom of the project window, open the Build Specifications, and right click and Build. The resulting dialog will tell you where the EXE was saved. Copy it to the Program Files/FRC Driver Station folder and you are good to go. The DS will launch yours next time it starts up.

Greg McKaskle


I did A similar technique last year.

what I did was I used the "draw rectangle" overlay block twice, one for each crosshair. I did it this way so I could adjust the thickness...

It also was linked to the tilt servo position so it would automatically rotate the image when the camera passed 90 degrees... it also changed the crosshairs to a set of parallel lines that could be used to line up with the minibot pole.

wireties 14-02-2012 08:56

Re: Simple Crosshair
 
You know the Kinect is only used during the first 15 seconds of the match, correct? I apologize if that seems a silly question.

HTH

Alan Anderson 14-02-2012 13:06

Re: Simple Crosshair
 
Quote:

Originally Posted by wireties (Post 1126323)
You know the Kinect is only used during the first 15 seconds of the match, correct? I apologize if that seems a silly question.

It does seem very silly. I think you posted in the wrong thread.

hsekhon27 14-02-2012 19:08

Re: Simple Crosshair
 
Quote:

Originally Posted by Greg McKaskle (Post 1126309)
The first step is to open the Getting Started Window of LabVIEW. It is up when you first launch and it is available from the View menu. Create a project based on the Dashboard template.

When built, that code will create the same thing as the initial installation.

There are a couple ways to add crosshairs. One, go to the panel, right click in open space and choose lines from the decoration palette.Place and size the lines, color them if you need to. You could use rectangles if you wanted thicker lines.

Greg McKaskle

After I create a dashboard project, how do I deploy it?

Rogue Leader 14-02-2012 19:34

Re: Simple Crosshair
 
Quote:

Originally Posted by hsekhon27 (Post 1126686)
After I create a dashboard project, how do I deploy it?

If I'm correct, you would open a program called the "FRC Driver's Station" once your computer is connected to the robot, Once that's open you would also launch a separate program called "FRC Dashboard," although I think the Driver's Station would open up both.Then launch the cRIO Robot Project, then deploy it (from RobotMain). You need to launch these in order to run the robot, so I hope I helped you in some way.

Mark McLeod 14-02-2012 21:01

Re: Simple Crosshair
 
Quote:

Originally Posted by hsekhon27 (Post 1126686)
After I create a dashboard project, how do I deploy it?

From the Project Explorer window
Build Specifications -> FRC PC Dashboard right-click and choose Build
It's going to put the new Dashboard in the project folder under builds. Something like:
My Documents\LabVIEW Data\builds\FRC Dashboard Project\FRC PC Dashboard
You can test it by running it from there, but for competition it'll need to get copied to the folder C:\Program File\FRC Dashboard

There are several common variations:
  1. You can change the Destination Directory under Properties for the build specification. That will automatically put your Dashboard in the FRC Dashboard folder.
  2. You can change where the Driver Station looks for the Dashboard program. That's defined in an ASCII file located at: C:\Users\Public\Documents\FRC\FRC DS Data Storage.ini (shouldn't be edited while the Driver Station app is running).

MAldridge 14-02-2012 21:28

Re: Simple Crosshair
 
assuming you do dev on a separate computer, you just need to copy the three files that the build will spit out into the dashboard folder on your driver station.

If memory servers, its just in the x86 programs folder.

hsekhon27 14-02-2012 22:58

Re: Simple Crosshair
 
Thank you!!

Gary Bonner 22-02-2012 23:07

Re: Simple Crosshair
 
Is there a way to disable the snap-to-grid when drawing lines on the panel?

Greg McKaskle 23-02-2012 08:34

Re: Simple Crosshair
 
Hit the <g> key to toggle it

Greg McKaskle

CodeMonkey 23-02-2012 11:04

Re: Simple Crosshair
 
Quote:

Originally Posted by ratdude747 (Post 1126320)
I did A similar technique last year.

what I did was I used the "draw rectangle" overlay block twice, one for each crosshair. I did it this way so I could adjust the thickness...

It also was linked to the tilt servo position so it would automatically rotate the image when the camera passed 90 degrees... it also changed the crosshairs to a set of parallel lines that could be used to line up with the minibot pole.

I was wondering, how did you get the lines to change from crosshairs to parallel.


All times are GMT -5. The time now is 00:46.

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