Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Missing DIO JNI Implementation (http://www.chiefdelphi.com/forums/showthread.php?t=132567)

dellagd 10-01-2015 14:36

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?

Joe Ross 10-01-2015 15:53

Re: Missing DIO JNI Implementation
 
Bugs can be reported at the location linked here: http://wpilib.screenstepslive.com/s/...port-resources

fsilberberg 10-01-2015 19:36

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.

rrossbach 11-01-2015 00:36

Re: Missing DIO JNI Implementation
 
Quote:

Originally Posted by Joe Ross (Post 1425718)
Bugs can be reported at the location linked here: http://wpilib.screenstepslive.com/s/...port-resources

Quote:

Originally Posted by fsilberberg (Post 1425854)
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

rrossbach 11-01-2015 14:04

Re: Missing DIO JNI Implementation
 
1 Attachment(s)
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

kneumei 22-01-2015 20:41

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?

kneumei 22-01-2015 22:24

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

kneumei 22-01-2015 22:31

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.)


All times are GMT -5. The time now is 09:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi