Go to Post Fear the power of the custodians! - Fixen [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 10-04-2016, 08:32
GoldenGollem's Avatar
GoldenGollem GoldenGollem is offline
Java Programmer
FRC #2509 (Hutchinson Tigerbots)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2015
Location: Minnesota
Posts: 24
GoldenGollem is an unknown quantity at this point
Target Tracking

I am new to FRC Java and see that you must put in code to use a USB webcam. When I looked through all of the Java and Camera FRC tutorials and could not find any mention of what the actual coding is. When I tried to look on here I found some help but not much in the matter of basic camera use. Thanks if you are able to help me.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-04-2016, 10:04
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: 195
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Target Tracking

I have a couple of questions?

1. Where do you plan to run the code? On the roborio, on the driverstation (I would advise against this), on a co-processor?

If on the roborio just use TowerTracker and make it run as a seperate task on the rio.

If on a co-processor, we have some code that runs on a raspberry pi that transfers necessary data through the network tables.

On the driverstation, use Towertracker and run it with network tables.

2. Also, are you talking about tracking targets or just getting a feed to the driverstation.
Reply With Quote
  #3   Spotlight this post!  
Unread 10-04-2016, 12:43
GoldenGollem's Avatar
GoldenGollem GoldenGollem is offline
Java Programmer
FRC #2509 (Hutchinson Tigerbots)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2015
Location: Minnesota
Posts: 24
GoldenGollem is an unknown quantity at this point
Re: Target Tracking

I plan on running this code on the roborio, and I would like to use this to be able to line up our shooter with the upper tower goal in this year's game.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-04-2016, 13:38
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: 195
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Target Tracking

Alright, so my recommendation would be TowerTracker.

CD Link: http://www.chiefdelphi.com/forums/sh....php?p=1527019

Github Link: https://github.com/fauge7/TowerTrack...erTracker.java

This code is meant to be run on the driverstation, but can easily be ported to run on the roborio. To do this, you need to set up opencv on the roborio. Instructions can be found here. The instructions to set up eclipse to compile opencv code is written for c++ (by me). But I'm not sure how you would do it for java.
Reply With Quote
  #5   Spotlight this post!  
Unread 11-04-2016, 03:11
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: Target Tracking

Quote:
Originally Posted by jreneew2 View Post
Alright, so my recommendation would be TowerTracker.

CD Link: http://www.chiefdelphi.com/forums/sh....php?p=1527019

Github Link: https://github.com/fauge7/TowerTrack...erTracker.java

This code is meant to be run on the driverstation, but can easily be ported to run on the roborio. To do this, you need to set up opencv on the roborio. Instructions can be found here. The instructions to set up eclipse to compile opencv code is written for c++ (by me). But I'm not sure how you would do it for java.

Thanks for recommending my program

my advice is to see if you have an axis camera. If not with the usb camera you will have to run mjpeg-streamer on the rio to stream the usb camera to a web interface where Tower tracker can take the video stream and process it.
Reply With Quote
  #6   Spotlight this post!  
Unread 11-04-2016, 07:13
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: 195
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Target Tracking

Quote:
Originally Posted by Fauge7 View Post
Thanks for recommending my program

my advice is to see if you have an axis camera. If not with the usb camera you will have to run mjpeg-streamer on the rio to stream the usb camera to a web interface where Tower tracker can take the video stream and process it.
You dont have to. If he is running it on the roborio you can just plug in a usb camera and change

videoCapture = new VideoCapture();

to videoCapture = new VideoCapture();
videoCapture.open(0).

This opens up the usb camera plugged into the roborio. This works with virtuald's version on opencv on the roborio. However, the version he build doesn't work with mjpg streams. If you really want to use that, I would use opencv2 that another team compiled.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-04-2016, 20:13
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: Target Tracking

Quote:
Originally Posted by jreneew2 View Post
You dont have to. If he is running it on the roborio you can just plug in a usb camera and change

videoCapture = new VideoCapture();

to videoCapture = new VideoCapture();
videoCapture.open(0).

This opens up the usb camera plugged into the roborio. This works with virtuald's version on opencv on the roborio. However, the version he build doesn't work with mjpg streams. If you really want to use that, I would use opencv2 that another team compiled.
Yes, however the reason it runs on the driverstation is that MOST laptops teams use as driverstations are much faster then any of the raspi or rio. You want to be able to process them as fast as possible. If vision is done properly the gap between realtime vision processing and a driverstation program will be slightly different but relatively the same. It comes down to the robots using it more effectively. Also for simplicity setting up a driverstation program on windows is easier then navigating through the linux for the rio especially because not everybody wants to mess with the rio or linux.
__________________
Engineering Inspiration - 3019


Tower Tracker author (2016)
  • 1 regional finalist
  • 1 regional winner
  • 3 innovation in control awards
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 01:24.

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