Go to Post Some clever fellow a few years back made a little scooter based on this principal and made so much on the idea he can afford the finest denim in the land. - phrontist [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-08-2016, 23:49
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Problem with 254's library

So we are looking into using 254's library, which was released in 2015. This is the code in question: https://github.com/Team254/FRC-2015. However, we are running into issues. Deploying is successful, but there is no robot code. From the Riolog, we get the error below. Any idea what could be causing it and how to fix it? Thanks.

Exception in thread "main" java.lang.UnsatisfiedLinkError: /var/volatile/tmp/libwpilibJavaJNI1540268506574750731.so: libFRC_NetworkCommunication.so.1: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1814)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1083)
at edu.wpi.first.wpilibj.hal.JNIWrapper.<clinit>(JNIW rapper.java:53)
at edu.wpi.first.wpilibj.RobotBase.initializeHardware Configuration(RobotBase.java:167)
at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:179)
Reply With Quote
  #2   Spotlight this post!  
Unread 11-08-2016, 08:48
codedr codedr is offline
Registered User
FRC #0537
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Wisconsin
Posts: 70
codedr will become famous soon enoughcodedr will become famous soon enough
Re: Problem with 254's library

libwpilibJava is depending on libFRC_NetworkCommunication.so.1 and cannot find it.
Perhaps you need to check if the FRC java is installed correctly?
Can you deploy a simple java robot program and have it load correctly?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-08-2016, 17:30
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Re: Problem with 254's library

A potential fix we tried was to switch away from their snapshotted WPI and replace it with the newest version. When we did that, the gyrothread broke, so we commented out the parts of the code that used it to see if it worked. That resulted in a successful deploy.

Any ideas on what could be wrong with the gyrothread? I'll post the exact error we get without gyrothread commented out once I get to the lab today.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-08-2016, 17:45
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,753
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Problem with 254's library

Well, the code was written against the 2015 API, and you probably have the 2016 API loaded. There are compatibility issues when using different versions of the API!

A little googling turned up a copy of the 2015 API Javadoc and the 2016 API Javadoc. Since you mentioned Gyro code, I checked out that area... It seems that 2015 had a Gyro class, while 2016 instead had a Gyro Interface, which lists several known implementations. So, that's one possible difference in the API that would cause old code to have serious issues with the newer API!

That said, I'm not going to go through and do any code analysis to figure out what the exact problem is and where to fix it... that I leave up to you!
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote
  #5   Spotlight this post!  
Unread 11-08-2016, 22:00
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Re: Problem with 254's library

Quote:
Originally Posted by Jon Stratis View Post
Well, the code was written against the 2015 API, and you probably have the 2016 API loaded. There are compatibility issues when using different versions of the API!

A little googling turned up a copy of the 2015 API Javadoc and the 2016 API Javadoc. Since you mentioned Gyro code, I checked out that area... It seems that 2015 had a Gyro class, while 2016 instead had a Gyro Interface, which lists several known implementations. So, that's one possible difference in the API that would cause old code to have serious issues with the newer API!

That said, I'm not going to go through and do any code analysis to figure out what the exact problem is and where to fix it... that I leave up to you!
We also tried using their snapshotted version of WPI though, and it gave us a similar(but not identical) error with unsatisfiedlinkerrors as shown in the original question.

Last edited by toodles9 : 11-08-2016 at 22:12. Reason: added description of error
Reply With Quote
  #6   Spotlight this post!  
Unread 11-08-2016, 22:00
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Re: Problem with 254's library

The error that we get when switching to the updated library is below:
Any ideas how to fix the notifier or JNI? We will also be looking into these meanwhile.
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:206): ERROR Unhandled exception instantiating robot com.team254.frc2015.Robot java.lang.UnsatisfiedLinkError: com.team254.lib.util.NotifierJNI.initializeNotifie rJVM(Ljava/nio/IntBufferV at [com.team254.lib.util.NotifierJNI.initializeNotifie rJVM(Native Method), com.team254.lib.util.Notifier.<clinit>(Notifier.ja va:27), com.team254.lib.util.gyro.GyroThread.<init>(GyroTh read.java:27), com.team254.frc2015.HardwareAdaptor.<clinit>(Hardw areAdaptor.java:46), com.team254.frc2015.OperatorInterface.<init>(Opera torInterface.java:12), com.team254.frc2015.Robot.<init>(Robot.java:40), sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:62), sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45) , java.lang.reflect.Constructor.newInstance(Construc tor.java:408), java.lang.Class.newInstance(Class.java:433), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:204)]
Reply With Quote
  #7   Spotlight this post!  
Unread 11-08-2016, 22:08
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Re: Problem with 254's library

Quote:
Originally Posted by codedr View Post
libwpilibJava is depending on libFRC_NetworkCommunication.so.1 and cannot find it.
Perhaps you need to check if the FRC java is installed correctly?
Can you deploy a simple java robot program and have it load correctly?
Our robot code this year was written in Java and ran fine.
Reply With Quote
  #8   Spotlight this post!  
Unread 11-08-2016, 23:43
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: Problem with 254's library

Quote:
Originally Posted by toodles9 View Post
We also tried using their snapshotted version of WPI though, and it gave us a similar(but not identical) error with unsatisfiedlinkerrors as shown in the original question.
Are you also running the 2015 image?
Reply With Quote
  #9   Spotlight this post!  
Unread 12-08-2016, 13:39
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Re: Problem with 254's library

Quote:
Originally Posted by Joe Ross View Post
Are you also running the 2015 image?
We have v19 on the roborio right now. Do you know which version the 2015 image corresponds to?
Reply With Quote
  #10   Spotlight this post!  
Unread 13-08-2016, 16:28
toodles9 toodles9 is offline
Registered User
FRC #0008
 
Join Date: Aug 2016
Location: Palo Alto
Posts: 7
toodles9 is an unknown quantity at this point
Re: Problem with 254's library

We managed to get drivetrain code running using the updated version of wpi. We added try-catch statements inside the Notifier, which allowed us to enable successfully. However, we obtained the Notifier class by decompiling the old wpi version and copy pasting it, so we were wondering if this is acceptable or if there is a better way of doing it? Additionally, we were wondering about the general changes from the 2015 to 2016 libraries, and would we likely have to make further changes to use the 2017 wpi library? Thanks.
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:43.

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