Go to Post I check CD while I'm waiting for ProE to reload everytime it crashes. So that's about 20 times a day :ahh: - Gary Dillard [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-01-2015, 14:36
dellagd's Avatar
dellagd dellagd is offline
Look for me on the field!
AKA: Griffin D
FRC #2590 (Nemesis) #2607 (The Fighting Robovikings)
Team Role: Mentor
 
Join Date: Sep 2011
Rookie Year: 2011
Location: PA
Posts: 890
dellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond repute
Missing DIO JNI Implementation

Today I was attempting to do some simple testing of a cheap ultrasonic sensor on the roboRio and I encountered an error I've never seen before on the RIOs.

The code involved sending a pulse out on a digital output, waiting, and receiving a pulse back from the sensor on a different pin. Bringing in our controls people to look at it, we found that this error message is generated on call to the pulse method of a DigitalOutput:
Quote:
java: /Users/brad/allwpilib/wpilibj/wpilibJavaJNI/lib/DIOJNI.cpp:130: void Java_edu_wpi_first_wpilibj_hal_DIOJNI_pulse(JNIEnv *, jclass, jobject, jdouble, jobject): Assertion `false' failed.
The next obvious step was to check out the source file of DIOJNI.cpp, and well, we found something interesting:

Code:
/*
 * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
 * Method:    pulse
 * Signature: (Ljava/nio/ByteBuffer;DLjava/nio/IntBuffer;)V
 */
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_pulse
  (JNIEnv *, jclass, jobject, jdouble, jobject)
{
	assert(false);

}
Now I'm not a doctor, but comparing that to the other methods in DIOJNI.cpp, it seems like the implementation is missing. Is there a WPILIB update for this?
__________________
Check out some cool personal projects in computers, electronics, and RC vehicles on my blog!

2016 MAR DCMP Engineering Excellence Award
2016 MAR Westtown Innovation in Control Award
2016 MAR Hatboro-Horsham Industrial Design Award
2015 Upper Darby District Winners - Thanks 225 and 4460!
2015 Upper Darby District Industrial Design Award
2015 Hatboro-Horsham District Winners - Thanks 2590 and 5407!
2014 Virginia Regional Winners - Thanks so much 384 and 1610, I will never forget that experience!
2014 Virginia Quality Award
2014 MAR Bridgewater-Raritan Innovation in Control Award
2014 MAR Hatboro-Horsham Gracious Professionalism Award
2013 MAR Bridgewater-Raritan Innovation in Control Award
2012 MAR Lenape Quality Award
Reply With Quote
  #2   Spotlight this post!  
Unread 10-01-2015, 15: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,590
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: Missing DIO JNI Implementation

Bugs can be reported at the location linked here: http://wpilib.screenstepslive.com/s/...port-resources
Reply With Quote
  #3   Spotlight this post!  
Unread 10-01-2015, 19:36
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 148
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Thanks for bringing this to our attention, apparently we missed a few functions for the JNI bindings. We'll have a fix in for the next release.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2015, 00:36
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: Missing DIO JNI Implementation

Quote:
Originally Posted by Joe Ross View Post
Bugs can be reported at the location linked here: http://wpilib.screenstepslive.com/s/...port-resources
Quote:
Originally Posted by fsilberberg View Post
Thanks for bringing this to our attention, apparently we missed a few functions for the JNI bindings. We'll have a fix in for the next release.
Thanks both! I've reported as a bug on Teamforge; in the meantime I went ahead and implemented the missing JNI DIO bindings, but won't be able to test until tomorrow. If it works I'll attach my patch to the bug report on Teamforge.

Thanks,
Ron
- Team #2607 controls mentor
__________________

FIRST Mid-Atlantic Volunteer
FRC Team #2607 Mentor
Reply With Quote
  #5   Spotlight this post!  
Unread 11-01-2015, 14:04
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: Missing DIO JNI Implementation

We performed a very quick test of our patched library this morning, and at least the DO pulse method works.....so now the Ultrasonic class also works.

I've attached the patched DIOJNI.cpp source file to the Teamforge bug report for review.

In case any other teams out there need this library working before the official wpilibj update is issued, attached is our unofficial updated library. To use it in a robot program, just unzip and use the JDK jar utility to update your robot jar file (FRCUserProgram.jar) to replace the original JNI library with the attached updated library. Easier than fiddling with the any build scripts.

- Ron
Team #2607 controls mentor
Attached Files
File Type: zip libwpilibJavaJNI.zip (543.1 KB, 20 views)
__________________

FIRST Mid-Atlantic Volunteer
FRC Team #2607 Mentor
Reply With Quote
  #6   Spotlight this post!  
Unread 22-01-2015, 20:41
kneumei kneumei is offline
Registered User
FRC #4849
 
Join Date: Jan 2014
Location: United States
Posts: 5
kneumei is an unknown quantity at this point
Re: Missing DIO JNI Implementation

We ran into this problem as well. Where can I go to download the official release? How do I install once I get it?
Reply With Quote
  #7   Spotlight this post!  
Unread 22-01-2015, 22:24
kneumei kneumei is offline
Registered User
FRC #4849
 
Join Date: Jan 2014
Location: United States
Posts: 5
kneumei is an unknown quantity at this point
Re: Missing DIO JNI Implementation

Ok, so I figured out that I can replace the libwpilibJavaJNI.so file inside of <home>wpilib\java\current\lib\WPILib.jar with the .so file attached to this thread. This way every time I build the distribution jar (FRCUserProgram.jar), the new .so is there.

However, I still haven't figured out where I can find new 'official' releases of WPILib.jar
Reply With Quote
  #8   Spotlight this post!  
Unread 22-01-2015, 22:31
kneumei kneumei is offline
Registered User
FRC #4849
 
Join Date: Jan 2014
Location: United States
Posts: 5
kneumei is an unknown quantity at this point
Re: Missing DIO JNI Implementation

Alright, sorry for all the chatter here, but I think I just figured it out. Updating the eclipse plugin seemed to update my wpilib jar. (Inside eclipse go to Help -> Check for updates.)
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:39.

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