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

RosJava on Android - Publisher not always working

asked 2011-11-21 11:14:56 -0600

mouser58907 gravatar image

I have a simple app right now with a RosImageView that shows a video feed from a robot, and a Joystick I developed that publishes a Twist to /cmd_vel. The image view works 100% of the time. However the /cmd_vel will only send properly every once in a while. It typically will work a first time, but then restarting the app it will not work. I believe this is the error that is causing the issue:

11-21 17:22:02.307: W/DefaultChannelPipeline(4360): An exception was thrown by a user handler while handling an exception event ([id: 0x40950368, /192.168.1.140:45958 :> /192.168.1.116:45381] EXCEPTION: java.lang.IllegalStateException: Unexpected message type roslib/Log != rosgraph_msgs/Log)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360): org.ros.exception.RosRuntimeException: java.lang.IllegalStateException: Unexpected message type roslib/Log != rosgraph_msgs/Log
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.ros.internal.transport.ConnectionTrackingHandler.exceptionCaught(ConnectionTrackingHandler.java:63)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractChannelSink.java:52)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at java.lang.Thread.run(Thread.java:1020)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360): Caused by: java.lang.IllegalStateException: Unexpected message type roslib/Log != rosgraph_msgs/Log
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at com.google.common.base.Preconditions.checkState(Preconditions.java:145)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.ros.internal.node.topic.DefaultPublisher.finishHandshake(DefaultPublisher.java:101)
11-21 17:22:02.307: W/DefaultChannelPipeline(4360):     at org.ros.internal.transport.tcp.TcpServerHandshakeHandler.messageReceived(TcpServerHandshakeHandler.java:86)
11-21 17:22 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-11-22 12:15:46 -0600

mouser58907 gravatar image

I was able to get both the Publisher and ImageView working by moving the publisher to its own class that implemented NodeMain. Then I had to assign two seperate NodeName's when running them with NodeRunner.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-11-21 11:14:56 -0600

Seen: 433 times

Last updated: Nov 22 '11