Go to Post It's kind of magical how I went from legos to replacing most of the iron in my blood with aluminum, and all thanks to my elementary school science teacher. - Astrokid248 [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 23-12-2013, 11:35
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Importing SDK .jar

Hi all!

In preparation for the 2014 season, I was looking to put together a Java program for the team's 2013 robot to see if a LeapMotion would be an acceptable way to control the robot on the field, although maybe for the peripheral driver, not the drive train driver, but I digress. Using netbeans, the code I've written checks out just fine, as I've added the Leap Motion SDK .jar to the project imports, but when I try to build the code, I run into an error with all Leap-related classes and methods. I poked around and easily enough found out that adding the SDK .jar to the IDE wasn't enough, so I moved it into the SunSpot lib folder. This got me passed the class undefined errors, but now it's running into some "preverification" error, which is way out of the scope of what I know.

I'm using NetBeans extending SimpleRobot

Error message is here http://pastebin.com/DrS7qCX2 , LeapTasks is a class called in the tele-op code, and LeapTasks also extends Listener, which is a class from the Leap Motion SDK that listens for new frama data. PM me if you'd like to see the full code.

Have any other teams tried to use any control devices which required SDKs in the form of .jar's, or does anyone with experience with Java know how to get past the preverification error?

Many thanks in advance!
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)
Reply With Quote
  #2   Spotlight this post!  
Unread 23-12-2013, 11:45
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Importing SDK .jar

Until next year, we are still running on a version of Java ME (which I believe is similar to Java 1.4). Unfortunately many modern libraries will not be supported by our VM. I don't know if that is exactly the problem, but I would wager a guess that a library provided for something as "new" as the leap motion is not going to work in your robot code.

However (and I have no real idea of how to do this), if you could somehow get your driver station computer to turn the leap motion inputs into a form that the computer recognizes as a joystick device, you could potentially use it that way
Reply With Quote
  #3   Spotlight this post!  
Unread 23-12-2013, 12:01
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Re: Importing SDK .jar

Yes, there is software for the device to turn it into a Logitech gamepad, but, if at all possible, I'd like to do it natively, all within the code, just because the piece of software that does that is... limiting for what I had in mind. And not free! Thanks nonetheless, I wouldn't have thought of that myself!
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)
Reply With Quote
  #4   Spotlight this post!  
Unread 23-12-2013, 12:53
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,572
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: Importing SDK .jar

Quote:
Originally Posted by dc74089 View Post
In preparation for the 2014 season, I was looking to put together a Java program for the team's 2013 robot to see if a LeapMotion would be an acceptable way to control the robot on the field, although maybe for the peripheral driver, not the drive train driver, but I digress.
Where would the LeapMotion Controller be located? On the robot or at the driver station?

Quote:
Originally Posted by BigJ View Post
However (and I have no real idea of how to do this), if you could somehow get your driver station computer to turn the leap motion inputs into a form that the computer recognizes as a joystick device, you could potentially use it that way
It doesn't even need to make it look like a joystick. It just needs to send the data over the network using either Network Tables or one of the approved ports (TCP, since the squawk JVM doesn't support UDP).

Quote:
Originally Posted by BigJ View Post
Until next year, we are still running on a version of Java ME (which I believe is similar to Java 1.4). Unfortunately many modern libraries will not be supported by our VM.
It's worse then that, it's somewhere between 1.2 and 1.3.

Another option (if you really need it on the robot) would be to compile the C++ SDK for the cRIO and then call that using JNA.
Reply With Quote
  #5   Spotlight this post!  
Unread 23-12-2013, 12:59
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Re: Importing SDK .jar

Quote:
Originally Posted by Joe Ross View Post
Where would the LeapMotion Controller be located? On the robot or at the driver station?
Apologies for clarity, I'd be using my hands to control the robot at the driver station. And the SDK does a lot of processing, it can give me hand locations, vectors that show where fingers are pointed, characteristics of how the palm is curved, all functionalities that I really dont want to give up. Or maybe I'm misunderstanding your reply, I'd consider myself moderately versed in FRC java, but not much past that. :0)
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)
Reply With Quote
  #6   Spotlight this post!  
Unread 23-12-2013, 13:59
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Re: Importing SDK .jar

Quick fix, not sure if it'll work when I have a robot to deploy to, but I changed the failonerror in the preverify.xml referenced by the build xml from true to false. This fixes the problem, the code builds okay, but I'm not exactly sure what I turned off, despite searching the documentation for Ant. Does this throw up any red flags for anyone, I'd hate to brick our cRIO...

Code:
<exec executable="@{preverify.executable}" failonerror="true">
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)
Reply With Quote
  #7   Spotlight this post!  
Unread 23-12-2013, 14:11
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Importing SDK .jar

You're just telling it not to stop when it hits an error The error will still exist and the code likely not work.
Reply With Quote
  #8   Spotlight this post!  
Unread 23-12-2013, 14:30
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Re: Importing SDK .jar

Quote:
Originally Posted by BigJ View Post
You're just telling it not to stop when it hits an error
Oh... From what I've seen on preverification, it looks to me like I need to preverify the SDK .jar? I'm poking around with that now.
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)

Last edited by dc74089 : 23-12-2013 at 14:34. Reason: The other half of the post
Reply With Quote
  #9   Spotlight this post!  
Unread 23-12-2013, 15:39
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Importing SDK .jar

It's unclear what you are trying to accomplish by loading the library into the cRIO code. The device will be connected to the computer and the code will be on the cRIO so how will the two communicate?

It sounds like you want to create a Java dashboard or other program to run on the DS and pass messages over something like UDP or Network Tables to the cRIO to use as control signals.
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:44.

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