[OSX] Unable to connect with ROS on Docker with a ROSJava node

asked 2017-06-21 15:07:04 -0500

updated 2017-06-22 04:27:35 -0500

gvdhoorn gravatar image

Hi,

I am trying to use Docker on a OSX system to run latest ROS distro to communicate with some ROS Nodes implemented with Java

I followed the tutorial from ROS website: http://wiki.ros.org/docker/Tutorials/...

And I am exposing the ROSCore port 11311 in the computer with:

docker run -it -p 11311:11311  ros

And later, I execute this commands to run rosmaster and check that it is running inside of the container.

source ./ros_entrypoint.sh  
roscore & 
rostopic list 
/rosout 
/rosout_agg

root@b245fd69b0e3:/# roscore &
[1] 83
root@b245fd69b0e3:/# ... logging to /root/.ros/log/e1c313f4-56bd-11e7-8f14-0242ac110002/roslaunch-b245fd69b0e3-83.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://b245fd69b0e3:44547/
ros_comm version 1.12.7


SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.7

NODES

auto-starting new master
process[master]: started with pid [94]
ROS_MASTER_URI=http://b245fd69b0e3:11311/

setting /run_id to e1c313f4-56bd-11e7-8f14-0242ac110002
process[rosout-1]: started with pid [107]
started core service [/rosout]

root@b245fd69b0e3:/# rosnode info rosout
--------------------------------------------------------------------------------
Node [/rosout]
Publications: 
 * /rosout_agg [rosgraph_msgs/Log]

Subscriptions: 
 * /rosout [unknown type]

Services: 
 * /rosout/set_logger_level
 * /rosout/get_loggers


contacting node http://b245fd69b0e3:35991/ ...
Pid: 107

root@b245fd69b0e3:/#

Outside with network utility, I check that port are visible and from a remote host I verified with wget (a bit rudimentary):

robot@ev3dev:~$ wget
192.168.1.198:11311 converted 'http://192.168.1.198:11311' (ANSI_X3.4-1968) -> 'http://192.168.1.198:11311' (UTF-8)
--2017-06-21 19:54:23--  http://192.168.1.198:11311/ Connecting to 192.168.1.198:11311... connected. HTTP request sent, awaiting response... 501 Unsupported method ('GET') 2017-06-21 19:54:23 ERROR 501: Unsupported method ('GET').

But when I try to execute from the remote host, the ROSNode can connect:

robot@ev3dev:~$ java -jar rosjava-helloworld-0.1.0-SNAPSHOT-all.jar 192.168.1.198
192.168.1.198
Ros core started
Starting listener node...
Starting talker node...
Jun 21, 2017 7:55:35 PM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://192.168.1.198:11311/
Jun 21, 2017 7:55:35 PM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://192.168.1.198:11311/
Jun 21, 2017 7:55:53 PM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</Talker, http://127.0.0.1:33063/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Jun 21, 2017 7:55:53 PM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</Listener, http://127.0.0.1:44603/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Jun 21, 2017 7:56:04 PM org.ros.internal.node.client.Registrar callMaster
SEVERE: Exception caught while communicating with master.
org.ros.internal.node.xmlrpc.XmlRpcTimeoutException: org.apache.xmlrpc.client.TimingOutCallback$TimeoutException: No response after waiting for 10000 milliseconds.
    at org.ros.internal.node.xmlrpc.XmlRpcClientFactory$1.invoke(XmlRpcClientFactory.java:140)
    at com.sun.proxy.$Proxy0.registerPublisher(Unknown Source)
    at ...
(more)
edit retag flag offensive close merge delete