[ros-users] rosjava Exception if create two Nodes with same name

Abhishek Verma toabhishekverma at gmail.com
Tue Jun 21 17:33:56 UTC 2011


Hi Friends,

I am seeing following exception

21-Jun-2011 18:29:01 org.apache.xmlrpc.server.XmlRpcErrorLogger log
SEVERE: Failed to invoke method registerSubscriber in class
org.ros.internal.node.xmlrpc.MasterImpl: null
org.apache.xmlrpc.common.XmlRpcInvocationException: Failed to invoke method
registerSubscriber in class org.ros.internal.node.xmlrpc.MasterImpl: null
at
org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:129)
 at
org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106)
at
org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
 at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
at
org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
 at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)
at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)
Caused by: java.lang.IllegalStateException
at com.google.common.base.Preconditions.checkState(Preconditions.java:129)
at org.ros.internal.node.server.MasterServer.addSlave(MasterServer.java:80)
 at
org.ros.internal.node.server.MasterServer.registerSubscriber(MasterServer.java:110)
at
org.ros.internal.node.xmlrpc.MasterImpl.registerSubscriber(MasterImpl.java:123)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
 at
org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)


My code is

//Publisher
node = new Node("Camera1", configuration);
publisher = node.createPublisher("Camera1",
 org.ros.message.sensor_msgs.Image.class);
....................

//Subscriber
 node = new Node("Camera1", configuration);
      System.out.println("ScreenView.main() Starting");
//      final Log log = node.getLog();
      node.createSubscriber("Camera1", new
MessageListener<org.ros.message.sensor_msgs.Image>() {
        public void onNewMessage(org.ros.message.sensor_msgs.Image message)
{
          System.out
.println("Subscriber \"" + message + "\"");
        }
      }, org.ros.message.sensor_msgs.Image.class);


Reason behind this exception is Nodes with same name.
If I change this name and create different nodes in publisher and
subscribers code then its fine.

Anyone has any idea why is that or we are not supposed to create node with
same name?

Thanks and Regards
Abhishek Verma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20110621/6aca5794/attachment-0001.html>


More information about the ros-users mailing list