Ask Your Question
1

android_tutorial_teleop null pointer exception on contact

asked 2012-04-24 11:04:21 -0500

Jyo gravatar image

updated 2012-04-24 11:20:04 -0500

Eric Perko gravatar image

Installing and building rosjava and rosjava.android successful. After installing android_tutorial_teleop to my tablet, I run it and connect to another machine running a roscore. It connects successfully, shows up in the topic list and rxgraph. It handles normal touch events just fine, moving the little triangle around, however when you touch the joystick it throws a null pointer exception. This problem has persisted for me using 3 different machines, over several versions of rosjava.android. Full error is posted below. Has anyone else encountered this issue, or know of any suggestions for debugging? I have tried playing with virtualJoystickView to try to track down what the issue is, but have been unsuccessful.

Full Step: Follow instructions for installing and Building rosjava_core and android_core adb install MainActivity-debug.apk run on tablet, enter ip address for machine with roscore touch joystick

E/AndroidRuntime( 9030): FATAL EXCEPTION: main
E/AndroidRuntime( 9030): java.lang.NullPointerException
E/AndroidRuntime( 9030):    at org.ros.android.view.VirtualJoystickView.publishVelocity(VirtualJoystickView.java:799)
E/AndroidRuntime( 9030):    at org.ros.android.view.VirtualJoystickView.onContactMove(VirtualJoystickView.java:698)
E/AndroidRuntime( 9030):    at org.ros.android.view.VirtualJoystickView.onTouchEvent(VirtualJoystickView.java:356)
E/AndroidRuntime( 9030):    at android.view.View.dispatchTouchEvent(View.java:5546)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1951)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1712)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1684)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1684)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1684)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
E/AndroidRuntime( 9030):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1684)
E/AndroidRuntime( 9030):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912)
E/AndroidRuntime( 9030):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
E/AndroidRuntime( 9030):    at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
E/AndroidRuntime( 9030):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860)
E/AndroidRuntime( 9030):    at android.view.View.dispatchPointerEvent(View.java:5726)
E/AndroidRuntime( 9030):    at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2890)
E/AndroidRuntime( 9030):    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2466)
E/AndroidRuntime( 9030):    at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:845)
E/AndroidRuntime( 9030):    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2475)
E/AndroidRuntime( 9030):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 9030):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 9030):    at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime( 9030):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 9030):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 9030):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime( 9030):    at com.android.internal.os ...
(more)
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2012-05-04 19:24:15 -0500

roro gravatar image

updated 2012-05-06 17:06:39 -0500

I had same problem in the tutorial. I guess... A Message "currentVelocityCommand" for the virtual joystick isn't initialized and remains as Null. I fix it. Add this line. " currentVelocityCommand =publisher.newMessage();"

edit flag offensive delete link more
0

answered 2012-04-25 07:55:09 -0500

damonkohler gravatar image

I'm in the process of documenting and verifying the Android examples. Please file an issue and I can follow up there: http://code.google.com/p/rosjava/issues/list

edit flag offensive delete link more
0

answered 2016-11-16 00:46:58 -0500

The NullReferenceException is designed as a valid runtime condition that can be thrown and caught in normal program flow. It indicates that you are trying to access member fields, or function types, on an object reference that points to null. That means the reference to an Object which is not initialized.

Manee

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-04-24 11:04:21 -0500

Seen: 474 times

Last updated: May 06 '12