Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Lift Tracker - 1.0 (http://www.chiefdelphi.com/forums/showthread.php?t=154489)

TheGuyWhoCodes 30-01-2017 18:55

Lift Tracker - 1.0
 
LIFT TRACKER - SWAT 1806


S.W.A.T 1806 is proud to announce the first Lift Tracking software of the 2017 game FIRST Steamworks. No longer will mentors and coaches have to yell at the programmers to get vision tracking working, it's here. The software will recognize the distance from the target, and the angle to the target. This will also run on different processing computers like the PI and Kangaroo with relative ease. You can also easily edit this software by using the included GRIP file and generate the code that you like, no more messing with pesky HSV!

How to install:
  1. Install opencv 3.X on whatever computer it's running on from here
  2. Download NetworkTables 3.0 (inside repo) and make sure it's in the build path
  3. Download the repo
  4. Run GRIP with the included project file, and tune your values to your liking, and export the code and overwrite everything in LiftTracker.java BE SURE TO NOT DELETE LINES 303-310, KEEP IT SOMEWHERE IN THAT CODE
  5. Export the project as a runnable jar
  6. Run it using command line or a batch file (or .sh file if you are on linux)
Before you run it though, you need to calculate the distance constant. This is a pretty easy task and should take under 10 min. Choose 5 distances for the robot to sit (12, 24, 48, 60, 72 in). Move your robot to each of these distances and record the variable lengthBetweenContours, then write that down. Multiply the distance and lengthBetweenContours and write what you get down. After you do that for all of the values, average everything and that's the distance constant. There is a variable in the code that you can change named DISTANCE_CONSTANT so you can easily change it

This is the GitHub link

If you have any questions, feel free to post a comment or make an issue on the GitHub page and I'll be happy to look at it. Currently this is in beta, so please contact me for corrections.

Thanks to:
  • Fauge7, you a G
  • TowerTracker 1.0 for giving us some inspiration on what to do
  • S/O to the people on the FRC Discord for overcoming the FRC Discord

FAQ:


Q:What camera did you guys use

A: Microsoft Lifecam HD3000 @ 640 x 480

Attempt #3 at trying to post my thread

Anon10W1z 30-01-2017 19:03

Re: Lift Tracker - 1.0
 
Looks awesome!

euhlmann 31-01-2017 07:58

Re: Lift Tracker - 1.0
 
Pretty cool!

But consider using .gitignore...

TheGuyWhoCodes 31-01-2017 17:05

Re: Lift Tracker - 1.0
 
Quote:

Originally Posted by euhlmann (Post 1638516)

Thanks for the suggestion, I fixed it!

AfterTen 01-02-2017 12:58

Re: Lift Tracker - 1.0
 
Any chance I could get a little more guidance/advice for a complete noob?
I'm a very good programmer but have not yet worked in the environments called for for robot programming.
Just learning the LabView stuff for robot control.

For instance...
1. The instructions say "install" opencv but when I go and download it from the site I just get a folder of libraries. There's nothing to install. So, are you really just saying "go download the libraries"?

2. Why do I have to download Network Tables 3.0 if it is already in the repo.
I did a git clone of the repo so am I good with Network Tables?
(Side note - I understand the concept of Network Tables but haven't used them yet - I'll be Googling that to try and figure it out.)
It says make sure it is in the "build path". Build Path for what toolchain?

3. I download and installed GRIP for windows. I tried to open the .grip file and it crashed GRIP and wouldn't open. Is that because maybe I don't have the opencv files in the "correct" place or the Network Tables file in the right spot?

4. Export the project as a runnable JAR. Using what tool?

I don't think if you respond it has to be in too much detail. Broad strokes are good. I can Google and follow-up with any unresolved issues after I work on it some more.

D_Price 01-02-2017 13:16

Re: Lift Tracker - 1.0
 
Great job!

TheGuyWhoCodes 01-02-2017 17:29

Re: Lift Tracker - 1.0
 
Quote:

Originally Posted by AfterTen (Post 1639070)
Any chance I could get a little more guidance/advice for a complete noob?
I'm a very good programmer but have not yet worked in the environments called for for robot programming.
Just learning the LabView stuff for robot control.

For instance...
1. The instructions say "install" opencv but when I go and download it from the site I just get a folder of libraries. There's nothing to install. So, are you really just saying "go download the libraries"?

2. Why do I have to download Network Tables 3.0 if it is already in the repo.
I did a git clone of the repo so am I good with Network Tables?
(Side note - I understand the concept of Network Tables but haven't used them yet - I'll be Googling that to try and figure it out.)
It says make sure it is in the "build path". Build Path for what toolchain?

3. I download and installed GRIP for windows. I tried to open the .grip file and it crashed GRIP and wouldn't open. Is that because maybe I don't have the opencv files in the "correct" place or the Network Tables file in the right spot?

4. Export the project as a runnable JAR. Using what tool?

I don't think if you respond it has to be in too much detail. Broad strokes are good. I can Google and follow-up with any unresolved issues after I work on it some more.


1. Installing opencv is just the library, it should come with a file opencv_3.XX.jar or something like that. You put that file inside of your built path.

2. I included NetworkTables 3.0 in the repo so you can easily include it in the ECLIPSE built path. This allows you to use the different classes and methods from inside that jar in your project. You are good with the git clone once you get it inside the build path

3. I'm not really sure what is going on with that, I just installed GRIP on a fresh machine and opened up the GRIP file and it worked fine. Send me over a log file and I can check it out for you.

4. To export a jar, you go to File -> Export -> Runnable JAR from eclipse and it'll be good to run

I hope this helps! PM me if you need any more help

TheGuyWhoCodes 05-02-2017 17:35

Re: Lift Tracker - 1.0
 
I just updated the code a bunch, follow the new instructions inside the github

GitHub

randy_pham 07-02-2017 21:41

Re: Lift Tracker - 1.0
 
Hello, we're new to vision this year, and we came across your github repository. We have used GRIP before to generate our code, and we have attempted to get the contours from the camera from the robot, but to no success.

We were wondering how we would incorporate your Process.java into our Robot.java class. How would we able to run it, without exporting it as a runnable jar file?

Thanks :)

TheGuyWhoCodes 09-02-2017 18:58

Re: Lift Tracker - 1.0
 
Quote:

Originally Posted by randy_pham (Post 1641856)
Hello, we're new to vision this year, and we came across your github repository. We have used GRIP before to generate our code, and we have attempted to get the contours from the camera from the robot, but to no success.

We were wondering how we would incorporate your Process.java into our Robot.java class. How would we able to run it, without exporting it as a runnable jar file?

Thanks :)

You should just be able to just copy paste the Process.java methods into your robot code and edit it to grab the GRIP values which ever way you want to (Probably networktables)


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

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