@imrehg Thank you for the pointers,
ROS masters are always started on localhost, to start on :80, for example
$ roscore -p 80
... logging to /root/.ros/log/e1cbd866-7f90-11e8-8b82-f8633ff9a90c/roslaunch-12f197a-147.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://localhost:39577/
ros_comm version 1.12.13
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.13
NODES
auto-starting new master
process[master]: started with pid [157]
ROS_MASTER_URI=http://localhost:80/
setting /run_id to e1cbd866-7f90-11e8-8b82-f8633ff9a90c
process[rosout-1]: started with pid [170]
started core service [/rosout]
I have tried having a roscore on a remote server, but having a roscore on a single remote server is not considered a good practice.
When I try connecting to the ROS master, on the public URL, the following error occurs
$ export ROS_MASTER_URI=https://12f197adbe18ad4c43c23a317271b7eb.resindevice.io/:80
$ rostopic list
Traceback (most recent call last):
File "/opt/ros/kinetic/bin/rostopic", line 35, in <module>
rostopic.rostopicmain()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 2099, in rostopicmain
_rostopic_cmd_list(argv)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 2039, in _rostopic_cmd_list
exitval = _rostopic_list(topic, verbose=options.verbose, subscribers_only=options.subscribers, publishers_only=options.publishers, group_by_host=options.hostname) or 0
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rostopic/__init__.py", line 1205, in _rostopic_list
state = master.getSystemState()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosgraph/masterapi.py", line 481, in getSystemState
return self._succeed(self.handle.getSystemState(self.caller_id))
File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1331, in single_request
response.msg,
xmlrpclib.ProtocolError: <ProtocolError for 12f197adbe18ad4c43c23a317271b7eb.resindevice.io/:80: 500 Internal Server Error>
In the internal network,
$ export ROS_MASTER_URI=http://192.168.1.116:80
$ rostopic list
ERROR: Unable to communicate with master!
As @imrehg has suggested, have tried doing curl -v ip:port
within the container, but the connection is refused.
curl -v localhost:80
* Rebuilt URL to: localhost:80/
* Trying ::1...
* connect to ::1 port 80 failed: Connection refused
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.47.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 501 Unsupported method ('GET')
< Server: BaseHTTP/0.3 Python/2.7.12
< Date: Wed, 04 Jul 2018 13:55:28 GMT
< Connection: close
< Content-Type: text/html
<
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 501.
<p>Message: Unsupported method ('GET').
<p>Error code explanation: 501 = Server does not support this operation.
</body>
* Closing connection 0