You've downloaded my heart.
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-01-2017, 18:55
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
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
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2017, 19:03
Anon10W1z Anon10W1z is offline
Registered User
FRC #3256 (WarriorBorgs)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2017
Location: San Jose, CA
Posts: 3
Anon10W1z is an unknown quantity at this point
Re: Lift Tracker - 1.0

Looks awesome!
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2017, 07:58
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 420
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Lift Tracker - 1.0

Pretty cool!

But consider using .gitignore...
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2017, 17:05
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
Re: Lift Tracker - 1.0

Quote:
Originally Posted by euhlmann View Post
Thanks for the suggestion, I fixed it!
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2017, 12:58
AfterTen AfterTen is offline
Registered User
FRC #3572
 
Join Date: Feb 2016
Location: Muskegon, MI
Posts: 1
AfterTen is an unknown quantity at this point
Question 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.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2017, 13:16
D_Price's Avatar
D_Price D_Price is offline
Engineer/Mentor
AKA: Derek
FRC #1708 (Amp'd Robotics (formally Natural Selection))
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: McKeesport, Pa
Posts: 483
D_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant futureD_Price has a brilliant future
Re: Lift Tracker - 1.0

Great job!
__________________
Team member 2004-2008
Team mentor 2008-20XX
http://www.team1708.com/
"Education is a powerful tool. Always use it to better someone else's life"
Reply With Quote
  #7   Spotlight this post!  
Unread 01-02-2017, 17:29
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
Re: Lift Tracker - 1.0

Quote:
Originally Posted by AfterTen View Post
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
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2017, 17:35
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
Re: Lift Tracker - 1.0

I just updated the code a bunch, follow the new instructions inside the github

GitHub
Reply With Quote
  #9   Spotlight this post!  
Unread 07-02-2017, 21:41
randy_pham randy_pham is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Arizona
Posts: 8
randy_pham is an unknown quantity at this point
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
Reply With Quote
  #10   Spotlight this post!  
Unread 09-02-2017, 18:58
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
Re: Lift Tracker - 1.0

Quote:
Originally Posted by randy_pham View Post
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)
Reply With Quote
  #11   Spotlight this post!  
Unread 10-02-2017, 10:35
Praj Praj is offline
Registered User
FRC #6325
 
Join Date: Feb 2017
Location: Alpharetta
Posts: 3
Praj is an unknown quantity at this point
Re: Lift Tracker - 1.0

Awesome code. I looking to run this on a coprocessor (Jetson TX1). Would both liftTracker and processing.java run on the coprocessor or liftTracker on jetson and processing.java on robo rio. In processing.java you set the IP for networktables. Is this where your getting the network tables from and would that IP need to change for the jetson. Also your pulling a table called LiftTracker but in GRIP the network table published is still called myContours. Also setting up the camera steam ( I am using USB camera) I am assuming I would have to change IP to jetson as well (probably would have to create a mjpeg server?) and then also try to send it to the Driver Station.

Sorry for so many questions
Thanks!
Reply With Quote
  #12   Spotlight this post!  
Unread 10-02-2017, 14:28
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
Re: Lift Tracker - 1.0

Quote:
Awesome code. I looking to run this on a coprocessor (Jetson TX1). Would both liftTracker and processing.java run on the coprocessor or liftTracker on jetson and processing.java on robo rio.
Yeah, so the LiftTracker.java file is literally just the outputted code from grip. If you want it by itself, you can have a method somewhere in a *.java file and run this method:
Code:
tracker.process(Mat)
Quote:
In processing.java you set the IP for networktables. Is this where your getting the network tables from and would that IP need to change for the jetson.
When I run:

Code:
NetworkTable.setIPAddress("roborio-1806-frc.local");
That is the IP where I'm putting all of the output values (angle, distance, etc). So, you would want to change 1806 over to your team number.

Quote:
Also your pulling a table called LiftTracker but in GRIP the network table published is still called myContours.
LiftTracker is the table where I am putting all of my values, not getting. You aren't going to get any values from myContours from GRIP. You aren't actually relying on the GRIP gui, it's the code generated from it, placed in the LiftTracker.java

Quote:
Also setting up the camera steam ( I am using USB camera) I am assuming I would have to change IP to jetson as well (probably would have to create a mjpeg server?) and then also try to send it to the Driver Station.
What I would do is replace the .open with the URL to:

Code:
videoCapture.open(0);
This makes it so it'll open up the webcam plugged into the USB. Then you might want to start an MJPG server. I'm not sure how well these work hand and hand together so you may have to experiment around
Reply With Quote
  #13   Spotlight this post!  
Unread 12-02-2017, 00:25
Turing'sEgo Turing'sEgo is offline
Registered User
no team
 
Join Date: Jan 2016
Rookie Year: 2010
Location: Boulder
Posts: 52
Turing'sEgo is infamous around these parts
Re: Lift Tracker - 1.0

And so the GP train continues. Awesome that you guys did this!

Have you benchmarked it to see resource usage on the roborio? I know that running two JVMs can eat up most, if not all, of the resources.
Reply With Quote
  #14   Spotlight this post!  
Unread 12-02-2017, 18:13
TheGuyWhoCodes's Avatar
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
AKA: Christopher Ariagno
FRC #1806 (S.W.A.T)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Smithville MO
Posts: 11
TheGuyWhoCodes is on a distinguished road
Re: Lift Tracker - 1.0

Quote:
Originally Posted by Turing'sEgo View Post
And so the GP train continues. Awesome that you guys did this!

Have you benchmarked it to see resource usage on the roborio? I know that running two JVMs can eat up most, if not all, of the resources.
Nah we haven't tested it on the rio, we have only tested it on our drivers station computer and soon the pi / jetson
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


All times are GMT -5. The time now is 15:59.

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