You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2023. It is now read-only.
Use node.newServiceServer to register a ServiceServer
Call node.shutdown()
What is the expected output? What do you see instead?
The node should close down cleanly, or at least catch all exceptions. Instead, a NullPointerException is thrown:
org.ros.exception.RosRuntimeException: java.lang.NullPointerException
at org.ros.address.AdvertiseAddress.toUri(AdvertiseAddress.java:109)
at org.ros.internal.node.service.DefaultServiceServer.getUri(DefaultServiceServer.java:86)
at org.ros.internal.node.client.MasterClient.unregisterService(MasterClient.java:84)
at org.ros.internal.node.DefaultNode.shutdown(DefaultNode.java:364)
at edu.cmu.ri.crw.ros.RosVehicleServer.shutdown(RosVehicleServer.java:406)
at edu.cmu.ri.crw.test.TestRosServer.main(TestRosServer.java:90)
What version of the product are you using? On what operating system?
Latest version from repo.
Please provide any additional information below.
This bug is caused by the ordering of commands in DefaultNode.shutdown().
Specifically, slaveServer.shutdown() is called before masterClient.unregisterService(slaveServer.toSlaveIdentifier(), serviceServer).
slaveServer contains the Callable<Integer> holding the port number of the URI that the ServiceServer is using. After slaveServer is shutdown, this Callable is no longer valid, so the ServiceServer fails when it calls getURI() to get the URI to unregister from the ROS master.
Proposed solution:
Move slaveServer.shutdown() and registrar.shutdown() to the end of DefaultNode.shutdown() -- it seems likely that other unregistration processes will depend on them. Patch is attached.
Original author: [email protected] (August 18, 2011 11:44:00)
What steps will reproduce the problem?
What is the expected output? What do you see instead?
The node should close down cleanly, or at least catch all exceptions. Instead, a NullPointerException is thrown:
org.ros.exception.RosRuntimeException: java.lang.NullPointerException
at org.ros.address.AdvertiseAddress.toUri(AdvertiseAddress.java:109)
at org.ros.internal.node.service.DefaultServiceServer.getUri(DefaultServiceServer.java:86)
at org.ros.internal.node.client.MasterClient.unregisterService(MasterClient.java:84)
at org.ros.internal.node.DefaultNode.shutdown(DefaultNode.java:364)
at edu.cmu.ri.crw.ros.RosVehicleServer.shutdown(RosVehicleServer.java:406)
at edu.cmu.ri.crw.test.TestRosServer.main(TestRosServer.java:90)
What version of the product are you using? On what operating system?
Latest version from repo.
Please provide any additional information below.
This bug is caused by the ordering of commands in DefaultNode.shutdown().
Specifically, slaveServer.shutdown() is called before masterClient.unregisterService(slaveServer.toSlaveIdentifier(), serviceServer).
slaveServer contains the Callable<Integer> holding the port number of the URI that the ServiceServer is using. After slaveServer is shutdown, this Callable is no longer valid, so the ServiceServer fails when it calls getURI() to get the URI to unregister from the ROS master.
Proposed solution:
Move slaveServer.shutdown() and registrar.shutdown() to the end of DefaultNode.shutdown() -- it seems likely that other unregistration processes will depend on them. Patch is attached.
Original issue: http://code.google.com/p/rosjava/issues/detail?id=27
The text was updated successfully, but these errors were encountered: