Go to Post Can you restate your observation in a manner that reconciles with physics? - Madison [more]
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, 4.20 average. Display Modes
  #1   Spotlight this post!  
Unread 03-02-2016, 18:29
KaiFukuyama KaiFukuyama is offline
Registered User
FRC #4327 (Q Branch)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2015
Location: Battle Creek, MI
Posts: 2
KaiFukuyama is an unknown quantity at this point
Re: Tower Tracker 1.0

My robotics team is also getting the same error that everyone else is. When we try and run it in the command prompt is gives us the error that it is having a hard time with having Open CV in the library. It can't find it but it is in there. Any ideas on how to fix it? We followed the directions as it said and nothing works. We also added the DLL file in Open CV folder to system 32. I included a screenshot of the error we were getting. Please help.
Attached Thumbnails
Click image for larger version

Name:	unnamed.png
Views:	64
Size:	105.6 KB
ID:	19961  
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2016, 18:36
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Tower Tracker 1.0

Quote:
Originally Posted by MekhiThomas View Post
My team is trying to use your code to test our vision but every time we run the executable JAR file we get two errors-
"Error opening file </build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:578>" and when we try to use the network table, we get the error "NT: Error: could not resolve roborio-3929.local address <TCPConnecotr.cpp:93>". We've installed opencv 3.1 and we are able to stream camera output to the dashboard. We are using the microsoft livecam 3000. Any help would be appreciated. Thanks!
If its having problems with the ffmpeg you need to download opencv and follow my instructions at the top of this thread. I decribe what you have to do after installing it. As for the microsoft usb camera you have to use whats called mjpeg streamer. It takes a usb webcam and outputs the feed to a web page in which you can call later.

Quote:
Originally Posted by KaiFukuyama View Post
[font="Times New Roman"]When we try and run it in the command prompt is gives us the error that it is having a hard time with having Open CV in the library. It can't find it but it is in there. Any ideas on how to fix it? We also added the DLL file in Open CV folder to system 32.
Did you extract the program into a runnable jar and then put it in a folder with the files similar to the screenshot i included?
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2016, 07:41
KaiFukuyama KaiFukuyama is offline
Registered User
FRC #4327 (Q Branch)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2015
Location: Battle Creek, MI
Posts: 2
KaiFukuyama is an unknown quantity at this point
Re: Tower Tracker 1.0

Quote:
Originally Posted by Fauge7 View Post
If its having problems with the ffmpeg you need to download opencv and follow my instructions at the top of this thread. I decribe what you have to do after installing it. As for the microsoft usb camera you have to use whats called mjpeg streamer. It takes a usb webcam and outputs the feed to a web page in which you can call later.



Did you extract the program into a runnable jar and then put it in a folder with the files similar to the screenshot i included?
We figured out what the problem was with why it won't run. We needed to put the Open CV jar file in with system 32.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2016, 01:01
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Tower Tracker 1.0

Quote:
Originally Posted by KaiFukuyama View Post
We figured out what the problem was with why it won't run. We needed to put the Open CV jar file in with system 32.
that or you put it in the same folder like i have...Cheers on getting it to work!
Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2016, 16:18
SlittyEyes SlittyEyes is offline
Registered User
FRC #3929
 
Join Date: Jan 2015
Location: Philadelphia
Posts: 3
SlittyEyes is an unknown quantity at this point
Re: Tower Tracker 1.0

I modified the code to output distance values to the network table. When I add code to put the distance value on the dashboard, no values show up. Also, when I use the OutlineViewer to check any networktable values (with the localhost as "roboRIO-3929-FRC.local"), nothing shows up except the Root folder. Did you get the network table to work?
Reply With Quote
  #6   Spotlight this post!  
Unread 20-01-2016, 17:26
mklinker's Avatar
mklinker mklinker is offline
Coach FRC4485
AKA: Mike Klinker
FRC #4485 (Tribe Tech Robotics)
Team Role: Mentor
 
Join Date: Oct 2012
Rookie Year: 2013
Location: Danville, IN
Posts: 96
mklinker is a splendid one to beholdmklinker is a splendid one to beholdmklinker is a splendid one to beholdmklinker is a splendid one to beholdmklinker is a splendid one to beholdmklinker is a splendid one to beholdmklinker is a splendid one to behold
Re: Tower Tracker 1.0

Where do I install the Network Table 3.0 jar
__________________
Mike Klinker Mentor, Tribe Tech Robotics FRC 4485

2016 Walker Warren District Semi-Finalist
2015 Indiana District Championship Semi-Finalist, Purdue District Quarter Finalist, Kokomo District Quarter Finalist, R2OC Finalist
2014 Boilermaker Regional Quarter Finalist


Reply With Quote
  #7   Spotlight this post!  
Unread 23-01-2016, 14:03
TheGuyWhoCodes TheGuyWhoCodes is offline
Registered User
None #1806
 
Join Date: Jan 2016
Location: Smithville MO
Posts: 3
TheGuyWhoCodes is an unknown quantity at this point
Re: Tower Tracker 1.0

When trying to run the program on the Jetson TK1, I get the error

Code:
java.lang.UnsatisfiedLinkError: no libopencv_java2410 in java.library.path
I did the install tutorial off of OpenCV's documentation. We have also verified that it has been working on a Windows machine. I think the reason might be that we don't have the correct *.so file inside of the working directory for OpenCV. Is there anybody that can upload the .so file to verify if that's the problem? The so file we are trying to find in the program is called libopencv_java248.so, and it's inside the directory /usr/lib/
Thank you!
-Chris

Last edited by TheGuyWhoCodes : 23-01-2016 at 17:16.
Reply With Quote
  #8   Spotlight this post!  
Unread 11-02-2016, 00:09
riftware riftware is offline
Parent Mentor
AKA: Andrew Chandler
FRC #0031
Team Role: Mentor
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Tulsa
Posts: 27
riftware is an unknown quantity at this point
Re: Tower Tracker 1.0

Quote:
Originally Posted by Fauge7 View Post
Team 3019 graciously presents their vision tracking program for everybody to use and borrow! Now instead of dreaming about the perils of computer vision YOU can bring your team the joy of having a robot that is capable of tracking the target with ease! No more Grip crashes or weird deploys, can calculate fun things such as: distance to target, and angle to target! to be used to auto align and auto aim!

if you are going to modify the code, all i ask is give me and my team credit in a comment at the top of the code and comment your suggestions and or your praise!
My students are using Grip to get the countours out of the streamer but were still working on distance to target last I checked. We identify valid targets by taking the ration of length to width which I think is working pretty well. I think they were looking at taking a couple of known distances and identifying size at those distances and then extrapolating for distances between. Your methodology looks very interesting but I did have a couple of questions on the "angle"

(Note: Its been 28 or so years since I had to do more complicated math so go easy on me). It looked like in the code you had a known angle of the camera (I'm assuming vertical angle.) and you are plugging that in. I get how this works more or less for figuring out distance/vertical angle. Where we are struggling a bit is in figuring out when we are "off center" - given what you can get out of a contour I'm not sure we would know that we need to move a bit to the right or left in order for a shot to work. Did you wind up solving that? If the contour had given us the boundaries of the rectangle's length or coordinates then I think we could evaluate relative sizes to know to move left or right but I'm not sure even about that. Any feedback is appreciated!
Reply With Quote
  #9   Spotlight this post!  
Unread 15-02-2016, 10:34
legts legts is offline
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 73
legts is an unknown quantity at this point
Re: Tower Tracker 1.0

Would this code work with a Microsoft Lifecam?
__________________
Programming Captain on team 2399 for the 2016 season.
Programmer on team 2399 The Fighting Unicorns since 2014!
Engineering Inspiration Award GPR 2015
Semi-finalist Buckeye 2015 (thanks 4269 and 1987!)
Reply With Quote
  #10   Spotlight this post!  
Unread 15-02-2016, 12:07
lethc's Avatar
lethc lethc is offline
#gkccurse
AKA: Becker Lethcoe
FRC #1806 (S.W.A.T.)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2013
Location: Smithville, MO
Posts: 119
lethc will become famous soon enough
Re: Tower Tracker 1.0

Quote:
Originally Posted by legts View Post
Would this code work with a Microsoft Lifecam?
You will have to modify a few lines of code but other than that... Yes.
__________________
2016: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Semifinalists, IRI Quarterfinalists
2015: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Quarterfinalists, IRI Winners
2014: Central Illinois Regional Quarterfinalists, Greater Kansas City Regional Finalists, Newton Semifinalists
2013: Greater Kansas City Regional Winners, Oklahoma Regional Winners, Galileo Quarterfinalists
Reply With Quote
  #11   Spotlight this post!  
Unread 15-02-2016, 16:34
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Tower Tracker 1.0

Quote:
Originally Posted by lethc View Post
You will have to modify a few lines of code but other than that... Yes.
Wait, is there a way to offload the usbcamera data onto a program on the computer?! I thought that wasn't possible yet...
__________________
Reply With Quote
  #12   Spotlight this post!  
Unread 16-02-2016, 00:56
lethc's Avatar
lethc lethc is offline
#gkccurse
AKA: Becker Lethcoe
FRC #1806 (S.W.A.T.)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2013
Location: Smithville, MO
Posts: 119
lethc will become famous soon enough
Re: Tower Tracker 1.0

Quote:
Originally Posted by kinganu123 View Post
Wait, is there a way to offload the usbcamera data onto a program on the computer?! I thought that wasn't possible yet...
We are only using it to view the USB camera feed in the SmartDashboard
__________________
2016: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Semifinalists, IRI Quarterfinalists
2015: Greater Kansas City Regional Finalists, Oklahoma Regional Winners, Tesla Quarterfinalists, IRI Winners
2014: Central Illinois Regional Quarterfinalists, Greater Kansas City Regional Finalists, Newton Semifinalists
2013: Greater Kansas City Regional Winners, Oklahoma Regional Winners, Galileo Quarterfinalists
Reply With Quote
  #13   Spotlight this post!  
Unread 17-02-2016, 17:21
axton900's Avatar
axton900 axton900 is offline
Programming Co-Captain
FRC #1403 (Cougar Robotics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: New Jersey USA
Posts: 45
axton900 has a spectacular aura aboutaxton900 has a spectacular aura aboutaxton900 has a spectacular aura about
Re: Tower Tracker 1.0

Has anyone gotten a python version of this code to work?
In python many of the methods that this code requires do not exist and this is a problem for many teams that plan on using Python for their vision processing.
We have trying to port this code for use as sample code for days but as you can see many of the functions do not exist which causes problems.
Here is our code.. so far
http://pastebin.com/ecdDFDQp

the rectangle class is the main problem we are being faced with. There seems to be no equivalent for those using Python. If anyone has found a solution to this issue. Then please let us know!
Thanks!
Reply With Quote
  #14   Spotlight this post!  
Unread 18-02-2016, 14:06
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,047
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Tower Tracker 1.0

Quote:
Originally Posted by axton900 View Post
the rectangle class is the main problem we are being faced with. There seems to be no equivalent for those using Python. If anyone has found a solution to this issue. Then please let us know!
Thanks!
I believe that in the OpenCV python bindings rectangles are represented as tuples.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #15   Spotlight this post!  
Unread 19-02-2016, 00:04
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Tower Tracker 1.0

Quote:
Originally Posted by axton900 View Post
Has anyone gotten a python version of this code to work?
In python many of the methods that this code requires do not exist and this is a problem for many teams that plan on using Python for their vision processing.
We have trying to port this code for use as sample code for days but as you can see many of the functions do not exist which causes problems.
Here is our code.. so far
http://pastebin.com/ecdDFDQp

the rectangle class is the main problem we are being faced with. There seems to be no equivalent for those using Python. If anyone has found a solution to this issue. Then please let us know!
Thanks!
This code runs on the driver station laptop, there is 0 need to switch programming languages unless you want it to run on the rio. I would avoid running it on the rio as that can cause issues during the match. All you need to do is setup the program like i instructed then simply run it, maybe even export it to have a runnable .jar file and a simple batch file to make executing easier.
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 04:29.

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