ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

problem with geometry_msgs.Twist on Android

asked 2012-05-15 07:19:29 -0500

Artjom gravatar image

After looking at the VirtualJoystickView.java in the Honeycomb example I tried to do similar thing on Gingerbread, however I was getting NullPointerException when trying to access currentVelocityCommand variable which is of type geometry_msgs.Twist.

Looking at the code of Twist.java it turns it's an interface. To implement Twist I also need to implement Vector3, and I'm now stuck with toRawMessage() method.

This is probably the wrong path and surely I'm missing something obvious.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-05-16 03:34:57 -0500

Artjom gravatar image

Turned out I was on the wrong path. Everything is in the documentation. All I had to do was just use the MessageFactory and create the message of the Twist type. Everything works as expected now.

edit flag offensive delete link more

Comments

You should use the convenience methods like Publisher.newMessage() where possible.

damonkohler gravatar image damonkohler  ( 2012-05-21 06:05:10 -0500 )edit
1

Hi Artjom, I am also having the same null pointer exception problem you had when using Twist. In fact, the null pointer exception occurs even with the sample code "android_tutorial_teleop" provided with android_core. Do you mind letting me know what you did to solve the problem successfully? Thanks.

Tuan gravatar image Tuan  ( 2012-06-02 04:05:53 -0500 )edit
0

answered 2012-09-23 04:11:48 -0500

JMata gravatar image

Hi, i have the same problem as Tuan. I am running the "android_tutorial_teleop" provided with android_core and having a null pointer exception problem with "currentVelocityCommand" variable. Could anyone help me? Thanks!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-05-15 07:19:29 -0500

Seen: 590 times

Last updated: Sep 23 '12