Go to Post FIRST is not a destination, its not the reward, its the slingshot that will launch you from where you are, to where you can be. - KenWittlief [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 14-01-2015, 16:54
AlexBrinister AlexBrinister is offline
Registered User
AKA: Alex Brinister
FRC #1768 (RoboChiefs)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Bolton, MA
Posts: 93
AlexBrinister will become famous soon enough
Access USB from Java

Hi all,

I would like to inquire about accessing the USB port from Java. How would one go about doing that?

My idea is to write a Linux kernel module to transport data from a coprocessor handling video camera data to the roboRIO via USB. Provided that I do this, how would I go about accessing said USB data from Java on the roboRIO?

PS: I want to use a coprocessor to handle video data because I want to run heavy openCV code to handle the camera feed. Despite the fact that the roboRIO is a dual-core processor, I am afraid of the 667 MHz clock rating being too slow to run the robot and the vision processing code without causing some hiccups.

Alex Brinister
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2015, 13:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Access USB from Java

Why not use a more supported communication method, like I2C, SPI, or ethernet? What coprocessor are you using?

I would assume that someone who's smart enough to write a kernel module would also be able to figure out how to access that data in java. I don't know how to do either.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-01-2015, 20:04
Pault's Avatar
Pault Pault is offline
Registered User
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston
Posts: 618
Pault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond repute
Re: Access USB from Java

Create a SerialPort object and select kUSB in the constructor.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2015, 09:15
AlexBrinister AlexBrinister is offline
Registered User
AKA: Alex Brinister
FRC #1768 (RoboChiefs)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Bolton, MA
Posts: 93
AlexBrinister will become famous soon enough
Re: Access USB from Java

I was thinking about an Intel NUC we have sitting around. It has an i3 processor and we have used it in the past for vision processing with success.

I don't yet actually know how to write a kernel module but I was going to learn. We have had issues using Ethernet for that type of thing in competition. There are a lot of hiccups processing the data.

Thanks, Pault.

Alex Brinister
Reply With Quote
  #5   Spotlight this post!  
Unread 21-01-2015, 14:03
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Access USB from Java

Quote:
Originally Posted by AlexBrinister View Post
PS: I want to use a coprocessor to handle video data because I want to run heavy openCV code to handle the camera feed. Despite the fact that the roboRIO is a dual-core processor, I am afraid of the 667 MHz clock rating being too slow to run the robot and the vision processing code without causing some hiccups.
It sounds like you are adding a lot of complexity based on a gut feeling that you can't accomplish your goals with the hardware you already have on the robot. You are likely to have far more hiccups writing drivers and software on multiple boards than you will simply writing it all in one process if you have the processing power. I would recommend trying to implement your solution on a single device first and only expand if actually needed. If you do expand, use a standard way to communicate. Network Tables over Ethernet is the recommended way from WPI. You can emulate Ethernet over USB (i.e. no driver to write) if you plug the roboRIO USB device port into your Intel board's USB host port and still use Network Tables.
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 22:38.

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