Go to Post F.I.R.S.T. Troubleshooting Rule #1 - If you work on software, the problem is always with hardware. If you work with hardware, the problem is always with software ;) - Redneck [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 12-01-2015, 18:26
craigboez's Avatar
craigboez craigboez is offline
Mechanical Engineer
AKA: Craig Boezwinkle
FRC #2811 (StormBots)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2009
Location: Chicago, IL
Posts: 217
craigboez is just really nicecraigboez is just really nicecraigboez is just really nicecraigboez is just really nicecraigboez is just really nice
Vision in Java

First, a disclaimer: I am not a programmer. I am a mechanical mentor dipping my toe into the programming side to help set some wheels in motion for a vision system.

My team is 100% Java. For a variety of reasons we have decided to program in it exclusively.

There are lots of choices for implementing a vision system. On the roboRIO vs on the driver station vs on a co-processor. If on the DS, it could be in roboRealm, NI's code, or something else. I'm not familiar with the individual requirements or pros/cons for each of these options.

My question: as a pure Java team, what is the path of least resistance for getting a vision system up and running? We've never done one and I want to make sure we get something implemented this season, even if it is very basic.

Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-01-2015, 21:55
SquishyIce's Avatar
SquishyIce SquishyIce is offline
Registered User
FRC #1405 (Finney Falcons)
Team Role: Electrical
 
Join Date: Dec 2013
Rookie Year: 2012
Location: New York
Posts: 39
SquishyIce can only hope to improve
Re: Vision in Java

If you're just looking for getting vision on your dashboard with a USB camera, I stripped down the SimpleVision template to 3 lines of code that you run when initializing everything:

Code:
CameraServer camera = new CameraServer();
camera.setQuality(50);
camera.startAutomaticCapture("cam0");
When you start up the driver station while connected to a RoboRIO running this code, go to the FRC PC Dashboard. In the bottom left of the "drive" pane, there should be a dropdown menu with the options of no camera, SW camera, HW camera, and IP camera. I believe you set this to SW camera (If that doesn't work, try HW camera. It's one of the two. I honestly cant remember, even though I was using it literally 2 hours ago). This should give you a live camera feed in what was formerly a big empty space of the dashboard. One thing I did notice tonight about that string "cam0"; this does not name the camera, it determines what camera to get the feed from. I believe the first camera you connect is automatically addressed as "cam0". I could be wrong on this, I haven't tested using multiple cameras. I learned this the hard way by replacing "cam0" with "PotatoCam", then not understanding why I couldn't get any feed whatsoever.

Good luck!
__________________
"MAKE IT WORK, DAVID"
Reply With Quote
  #3   Spotlight this post!  
Unread 12-01-2015, 21:57
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Vision in Java

Personally, I love team 341's solution to vision in 2012. They ran it on a dashboard that runs on the driver station. It's written in Java and worked very nicely. In my opinion, 341 was one of the most impressive robots to watch.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-01-2015, 22:11
Domenic Rodriguez's Avatar
Domenic Rodriguez Domenic Rodriguez is offline
Registered User
FRC #0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Sep 2010
Rookie Year: 2011
Location: Grove City, PA
Posts: 213
Domenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura aboutDomenic Rodriguez has a spectacular aura about
Re: Vision in Java

Quote:
Originally Posted by Jared View Post
Personally, I love team 341's solution to vision in 2012. They ran it on a dashboard that runs on the driver station. It's written in Java and worked very nicely. In my opinion, 341 was one of the most impressive robots to watch.
I'd second that statement. 341's system was the inspiration for our vision system last year, which was purely in Java. Instead of writing a SmartDashboard plugin, though, we used the Java bindings for OpenCV and NetworkTables to write a Swing app that ran on the driver station. Here's the code if you're interested: https://github.com/LuNaTeCs-316/LuNaCV
__________________

LuNaTeCs - Learning Under Nurturing Adults Teaching Engineering Concepts and Skills - Small and Mighty!

FRC 316 LuNaTeCs - Student (2011-2014), Lead Programmer (2011-2014), Team Captain (2013-2014), Operator (2013), Drive Coach (2014), Mentor (2015-????)
'11 Philly Regional Finalists, '13 Chestnut Hill Finalists, '13 Lenape Champions, '13 Archimedes Division, '14 Chestnut Hill Champions, '14 Lenape Champions
FTC 7071 EngiNerds - Founding Advisor (2013-2014) | FRC 5420 Velocity - Founding Advisor (2015)
Grove City College Class of '18, Electrical/Computer Engineering (B.S.E.E)

Reply With Quote
  #5   Spotlight this post!  
Unread 13-01-2015, 01:16
craigboez's Avatar
craigboez craigboez is offline
Mechanical Engineer
AKA: Craig Boezwinkle
FRC #2811 (StormBots)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2009
Location: Chicago, IL
Posts: 217
craigboez is just really nicecraigboez is just really nicecraigboez is just really nicecraigboez is just really nicecraigboez is just really nice
Re: Vision in Java

Thanks, I'll take a look at the Daisy implementation. I have heard that JavaCV is poorly documented, at least relative to OpenCV. Has that been your experience?
Reply With Quote
  #6   Spotlight this post!  
Unread 13-01-2015, 02:54
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: Vision in Java

It definitely is not as well documented as it is for c and cpp! I might have a vision solution so if it works I will document it and polish up for other teams to use!
Reply With Quote
  #7   Spotlight this post!  
Unread 13-01-2015, 10:01
Ben Wolsieffer Ben Wolsieffer is offline
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: 520
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: Vision in Java

Quote:
Originally Posted by craigboez View Post
Thanks, I'll take a look at the Daisy implementation. I have heard that JavaCV is poorly documented, at least relative to OpenCV. Has that been your experience?
I wouldn't use JavaCV (the old third-party Java wrappers) because they only support OpenCV 2 and there is now an official Java API. It does not have its own documentation but the C++ documentation applies to it as well in most cases.
__________________



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
  #8   Spotlight this post!  
Unread 14-01-2015, 10:00
Ozuru's Avatar
Ozuru Ozuru is offline
It's always the programmer's fault.
no team
 
Join Date: May 2013
Rookie Year: 2010
Location: Earth
Posts: 268
Ozuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to behold
Re: Vision in Java

Quote:
Originally Posted by lopsided98 View Post
I wouldn't use JavaCV (the old third-party Java wrappers) because they only support OpenCV 2 and there is now an official Java API. It does not have its own documentation but the C++ documentation applies to it as well in most cases.
This. I've noticed a few changes, specifically that there is no IplImage anymore (Mat is the new storage type of choice) and imread/imwrite is in Imgcodecs.
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 12:22.

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