Go to Post The low bar will make your electronics team cry. - Joe G. [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-10-2016, 15:22
Tottanka's Avatar
Tottanka Tottanka is offline
It isnt about bots,its about humans
AKA: Liron Gurvitz
FRC #3211 (The Y Team)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2006
Location: Hadera, Israel
Posts: 1,415
Tottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond repute
Moved to JAVA - help with vision tracking

Hey CD!
I tried to find good documentation or tutorials but failed, so im asking here...

We recently decided to move from LabView to Java due to numerours reasons. We have arleady programmed our 2016 robot in Java to perform as we want it in all but one things - the image proccessing.

We wish to learn how to use 2 things:
1. processing on the RIO itself using Java libraries and a regular webcam (say, the kit one).

2. Using the Jetson tk1 Nidia board as a co processor. I saw the zebracorn whitepaper, but i really dont know where to start there. I know we need to use Linuk and OpenCV for that (Pyhton?), but are missing some basic guides on how to set it all up to communicate etc.

If anyone could direct us to some kind of material for both those 2 things, we will know how to keep going.

Thanks
__________________
My FRC record: 10 Years,FTA (2008-9), 3 Teams(1947,2669,3211).3 RCA, 1 Championship EI(2016), 1 Divisional finalist (2016), 1 Regional winner.
Israeli 2016 Volunteer of the year.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-10-2016, 15:32
EmileH's Avatar
EmileH EmileH is offline
it's not a water game, ok?
AKA: Emile Hamwey
FRC #1058 (PVC Pirates) & FF (NE Way You Want It)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2011
Location: New England
Posts: 531
EmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant future
Re: Moved to JAVA - help with vision tracking

I would advise against using vision tracking with a USB webcam on the RoboRIO, mainly because the software/hardware isn't very optimized on the RIO's USB ports, so having a camera even plugged in significantly increases CPU usage. I'd suggest an IP camera if you wanted to run on-robot vision and also it would likely be best to use it with GRIP - 1058 uses GRIP on the Driver Station to process our images for vision tracking.

There are some guides for using GRIP on the GitHub wiki as well as on ScreenSteps.
__________________
2016-present: High School Student, FRC 1058 PVC Pirates
2016: RiverRage 20 Champions, Battle of the Bay 3 Champions

2013-2015: Middle School Student, FRC 3467 Windham Windup
Reply With Quote
  #3   Spotlight this post!  
Unread 05-10-2016, 19:57
Ben Wolsieffer Ben Wolsieffer is online now
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 519
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: Moved to JAVA - help with vision tracking

I wrote the code for my team's (2084) vision system last year, and we used Java running on an Jetson TK1. We used Java and the official OpenCV Java wrappers for most of our vision code. You can use any language supported by OpenCV without much performance difference because the computationally expensive algorithms are running as native code.

I did implement some parts of the algorithm in C, called from Java using the JNI. This allowed us to use the OpenCV CUDA (GPU) libraries, which are not available in the Java wrapper.

We used NetworkTables to communicate the distance and heading (we directly interfaced our NavX with the Jetson) of the goal to the robot.

If you want to use the Jetson, it isn't that hard. It comes with Ubuntu preinstalled, and you can connect it to a monitor, mouse and keyboard and use it like a normal computer if you want. You will want to get familiar with how to use the command line and SSH, because this will make things much easier once you mount the board on the robot. We mounted ours in a 3D printed case and powered it using a DC-DC converter from Polulu (I don't have a link at the moment).
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists

Last edited by Ben Wolsieffer : 05-10-2016 at 20:03.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-10-2016, 09:22
Tottanka's Avatar
Tottanka Tottanka is offline
It isnt about bots,its about humans
AKA: Liron Gurvitz
FRC #3211 (The Y Team)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2006
Location: Hadera, Israel
Posts: 1,415
Tottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond reputeTottanka has a reputation beyond repute
Re: Moved to JAVA - help with vision tracking

Thanks!
We'll start looking into it and post questions if we have any.
__________________
My FRC record: 10 Years,FTA (2008-9), 3 Teams(1947,2669,3211).3 RCA, 1 Championship EI(2016), 1 Divisional finalist (2016), 1 Regional winner.
Israeli 2016 Volunteer of the year.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-10-2016, 13:56
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 189
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Moved to JAVA - help with vision tracking

Quote:
Originally Posted by Ben Wolsieffer View Post
I wrote the code for my team's (2084) vision system last year, and we used Java running on an Jetson TK1. We used Java and the official OpenCV Java wrappers for most of our vision code. You can use any language supported by OpenCV without much performance difference because the computationally expensive algorithms are running as native code.

I did implement some parts of the algorithm in C, called from Java using the JNI. This allowed us to use the OpenCV CUDA (GPU) libraries, which are not available in the Java wrapper.

We used NetworkTables to communicate the distance and heading (we directly interfaced our NavX with the Jetson) of the goal to the robot.

If you want to use the Jetson, it isn't that hard. It comes with Ubuntu preinstalled, and you can connect it to a monitor, mouse and keyboard and use it like a normal computer if you want. You will want to get familiar with how to use the command line and SSH, because this will make things much easier once you mount the board on the robot. We mounted ours in a 3D printed case and powered it using a DC-DC converter from Polulu (I don't have a link at the moment).
What kind of FPS were you getting? Do the GPU calls make a big difference? We ran our vision code on a raspberry pi and wrote it in C++.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-10-2016, 15:42
Ben Wolsieffer Ben Wolsieffer is online now
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 519
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: Moved to JAVA - help with vision tracking

Quote:
Originally Posted by jreneew2 View Post
What kind of FPS were you getting? Do the GPU calls make a big difference? We ran our vision code on a raspberry pi and wrote it in C++.
Without the GPU we were normally getting around 15 fps, and with the GPU it went up to 30 fps (limited by the camera). I never tested how fast it could go it the camera were not limiting it, but one time the frame rate limiting code broke and it measured ~75 fps, but this might have been a mistake. I was very surprised by this performance improvement, given that I was only able to run a small portion of the algorithm on the GPU (color conversion and blurring).
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #7   Spotlight this post!  
Unread 08-10-2016, 07:57
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 189
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Moved to JAVA - help with vision tracking

Quote:
Originally Posted by Ben Wolsieffer View Post
Without the GPU we were normally getting around 15 fps, and with the GPU it went up to 30 fps (limited by the camera). I never tested how fast it could go it the camera were not limiting it, but one time the frame rate limiting code broke and it measured ~75 fps, but this might have been a mistake. I was very surprised by this performance improvement, given that I was only able to run a small portion of the algorithm on the GPU (color conversion and blurring).
Hmm. I'll try to mess around with the GPU calls. Seems like it could lead to an improvement. However with our setup, I don't know if a raspberry GPU will make much of a difference.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-10-2016, 10:27
Ben Wolsieffer Ben Wolsieffer is online now
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 519
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: Moved to JAVA - help with vision tracking

Quote:
Originally Posted by jreneew2 View Post
Hmm. I'll try to mess around with the GPU calls. Seems like it could lead to an improvement. However with our setup, I don't know if a raspberry GPU will make much of a difference.
You won't be able to use the Raspberry Pi's GPU with OpenCV. OpenCV only supports CUDA and OpenCL for GPU acceleration. CUDA only works on NVIDIA GPUs and OpenCL is not supported by the GPU on the Raspberry Pi.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
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 14:34.

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