ROSJava messages missing "callerid" field
I've been running rosjava nodes on my PC and connecting them to rospy and roscpp nodes on the same PC. I can get publish and subscribe of basic messages to work fine. However, if I try to publish tf's or use actionlib_java, I get errors revolving around missing callerids.
The following is an example of this issue using the actionlib_java sample Fibonacci server and the actionlib_tutorial sample (python) Fibonacci client:
I got the ROSJava example Actionlib server (/org.ros.actionlib_java/src/tutorials/java/org/ros/actionlib/example/RunFibonacciSimpleActionServer.java) to connect to the python actionlib client (ros/common_tutorials/actionlib_tutorials/simple_action_clients/fibonacci_client.py) provided in ROS electric, but I get callerid errors.
To get this to run, I first noticed that running RunFibonacciSimpleActionServer.java failed with
java.lang.NullPointerException: Node name not specified.
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
at org.ros.node.DefaultNodeRunner.run(DefaultNodeRunner.java:85)
at org.ros.node.DefaultNodeRunner.run(DefaultNodeRunner.java:110)
at org.ros.actionlib.example.RunFibonacciSimpleActionServer.main(RunFibonacciSimpleActionServer.java:31)
at org.ros.actionlib.example.RunFibonacciSimpleActionServer.main(RunFibonacciSimpleActionServer.java:15)
So, on line 28 of RunFibonacciSimpleActionServer.java, I added a name to the node
configuration.setNodeName("fibonacci_server_node");
Then it runs, but does not connect. If I look at rxgraph (with all topics turned on), I see that where the rospy client is looking for the action messages (status, result, feedback, etc) in the /fibonacci namespace, the ROSJava server is broadcasting in the global namespace (i.e., without a namespace). To get these to connect, I remapped the rospy client's topics into the global namespace using the following launch file:
<launch>
<node name="fibonacci_client" pkg="actionlib_tutorials" type="fibonacci_client.py">
<remap from="/fibonacci/goal" to="/goal" />
<remap from="/fibonacci/cancel" to="/cancel" />
<remap from="/fibonacci/feedback" to="/feedback" />
<remap from="/fibonacci/status" to="/status" />
<remap from="/fibonacci/result" to="/result" />
</node>
</launch>
Now the nodes connect, but the rospy node crashes with the following error:
process[fibonacci_client-2]: started with pid [11301]
Traceback (most recent call last):
File "/other/ros/common_tutorials/actionlib_tutorials/simple_action_clients/fibonacci_client.py", line 66, in <module>
result = fibonacci_client()
File "/other/ros/common_tutorials/actionlib_tutorials/simple_action_clients/fibonacci_client.py", line 47, in fibonacci_client
client.wait_for_server()
File "/other/ros/common/actionlib/src/actionlib/simple_action_client.py", line 68, in wait_for_server
return self.action_client.wait_for_server(timeout)
File "/other/ros/common/actionlib/src/actionlib/action_client.py", line 577, in wait_for_server
server_id = self.last_status_msg._connection_header['callerid']
KeyError: 'callerid'
[fibonacci_client-2] process has died [pid 11301, exit code 1].
It seems to be missing the "callerid" attribute.
As an aside, I've seen the same problem when I publish tf's from a rosjava node and receive them with a roscpp node. In particular, libtf within the roscpp node gets angry that the callerid is missing from the tf's it receives. If I "roswtf" the setup, I'll see that the rosjava nodes appear as two different nodes: one with the correct node name (e.g., tf_publisher) but not connected to any other nodes and one ...