0
$\begingroup$

Rosanswers logo

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 with the IP (eg, 127.0.0.1) for the node name and connected to the correct nodes. I think callerid may be the node name tracked by the master. Maybe my rosjava nodes are not registering their node name with the ROS master correctly?

Thanks for any help


Originally posted by shawn3 on ROS Answers with karma: 1 on 2011-12-05

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I had the "missing callerid" warning issued in c++ when I instantiated tfMessages from a bagfile and published it (not via the tf broadcaster but a regular publisher). Since the warnings were quite annoying I tried to fix it, but couldn't find much information except this.

For roscpp I fixed this not really quick but hopefully not too dirty by manually setting msg->__connection_header["caller_id"] = "name_of_my_node", but I am not sure whether this is a good way to go.


Originally posted by Felix Endres with karma: 6468 on 2011-12-06

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by tfoote on 2011-12-12:
There's a related ticket here http://code.google.com/p/rosjava/issues/detail?id=15

Comment by Felix Endres on 2011-12-06:
Optimally, you could trace down the place in the publisher code of rosjava, fix it there and submit a patch :-)

Comment by shawn3 on 2011-12-06:
Thanks for the info. It doesn't seem that ROSJava gives me access to this field in the outgoing messages (on the publication side). I could try catching messages on the subscriber side and fixing them up, but that's only a bandaid.

$\endgroup$
0
$\begingroup$

Rosanswers logo

This should be fixed at head.


Originally posted by damonkohler with karma: 3838 on 2012-01-05

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.