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

rosjava - how get a state/notificaiton of connection to ros-master

asked 2011-12-29 04:45:18 -0500

eugen gravatar image

I started with pubsub-tutorial, it works fine. Now, I am trying to write my own app with rosjava und need to know current state of connection to ros-master.

Are there a possibility to get this state (connected or not) or to be notificated about change it.

I can see errors in output-window, but I can not handle it:


12-29 19:02:02.398: W/Registrar(4016): Master registration failed and will be retried.
12-29 19:02:02.398: W/Registrar(4016): java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.net.ConnectException: Arbeitslaptop-Ubuntu.fritz.box/192.168.178.30:11311 - Connection refused
12-29 19:02:02.398: W/Registrar(4016):  at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:224)
12-29 19:02:02.398: W/Registrar(4016):  at java.util.concurrent.FutureTask.get(FutureTask.java:83)
12-29 19:02:02.398: W/Registrar(4016):  at org.ros.internal.node.client.Registrar$RetryLoop.loop(Registrar.java:81)
12-29 19:02:02.398: W/Registrar(4016):  at org.ros.concurrent.CancellableLoop.run(CancellableLoop.java:47)
12-29 19:02:02.398: W/Registrar(4016):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
12-29 19:02:02.398: W/Registrar(4016):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
12-29 19:02:02.398: W/Registrar(4016):  at java.lang.Thread.run(Thread.java:1019)
12-29 19:02:02.398: W/Registrar(4016): Caused by: java.lang.RuntimeException: java.net.ConnectException: Arbeitslaptop-Ubuntu.fritz.box/192.168.178.30:11311 - Connection refused
12-29 19:02:02.398: W/Registrar(4016):  at org.ros.internal.node.xmlrpc.XmlRpcClientFactory$1.invoke(XmlRpcClientFactory.java:152)
12-29 19:02:02.398: W/Registrar(4016):  at $Proxy0.registerPublisher(Native Method)
12-29 19:02:02.398: W/Registrar(4016):  at org.ros.internal.node.client.MasterClient.registerPublisher(MasterClient.java:136)
....

Thank you in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-01-05 01:09:45 -0500

damonkohler gravatar image

This is possible in the latest rosjava. However, it has not been released so you will have to build it from source. See: RegistrantListener for the interface and PublisherListener.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-12-29 04:45:18 -0500

Seen: 499 times

Last updated: Jan 05 '12