ROS Docker node can't publish to ROS master

asked 2023-05-28 15:32:01 -0500

tunjii1000 gravatar image

Hello Guys, I am currently trying to control a robot using a ROS node in a Wsl Docker container. The workflow set-up is a local network consisting of a ROS master pc, the robot and my container. I had to manually set my host's ip address to conform to that of the network. The ROS master pc and the Wsl container are both running Ros melodic on Ubuntu 18.04. I am able to subscribe to the ROS master pc when it publishes over a topic but it doesn't work the other way from the container to the master PC (the ROS master PC doesn't echo the message of the topic, but after stopping the publisher and subscriber, I see the rostopic from the "rostopic list" command). I have followed all information online and have configured the ROS_MASTER_URI to that of the ROS master pc and changed my ROS_IP to the manually set one in the docker container. I also run the container with a --net=host argument.

On running roswtf i get this error

ros@docker-desktop:~$ roswtf

the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'

No package or stack in the current directory

Static checks summary:

Found 1 warning(s). Warnings are things that may be just fine, but are sometimes at fault

WARNING ROS_IP may be incorrect: ROS_IP [172.16.0.3] does not appear to be an IP address of a local network interface (one of ['<ip_address>', '<ip_address>', '<ip_address>']).

Found 1 error(s).

ERROR ROS Dep database not updated: Please update rosdep database with 'rosdep update'.

Beginning tests of your ROS graph. These may take a while... analyzing graph... ... done analyzing graph running graph rules... ERROR: connection refused to [http://172.16.0.1:45623/] ERROR: connection refused to [http://172.16.0.3:42657/] ... done running graph rules

Online checks summary:

Found 1 warning(s). Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected: * /rostopic_4635_1685100348640: * /test_string_2 * /rostopic_6501_1685105570182: * /dusmmy * /rostopic_112_1685102927315: * /test_string

Found 3 error(s).

ERROR Could not contact the following nodes: * /rostopic_4635_1685100348640 * /rostopic_112_1685102927315

ERROR The following nodes should be connected but aren't: * /rostopic_112_1685102927315->/rosout (/rosout)

ERROR Errors connecting to the following services: * service [/rostopic_112_1685102927315/set_logger_level] appears to be malfunctioning: Unable to communicate with service [/rostopic_112_1685102927315/set_logger_level], address [rosrpc://172.16.0.3:45357] * service [/rostopic_4635_1685100348640/get_loggers] appears to be malfunctioning: Unable to communicate with service [/rostopic_4635_1685100348640/get_loggers], address [rosrpc://172.16.0.1:32985] * service [/rostopic_4635_1685100348640/set_logger_level] appears to be malfunctioning: Unable to communicate with service [/rostopic_4635_1685100348640/set_logger_level], address [rosrpc://172.16.0.1:32985] * service [/rostopic_112_1685102927315/get_loggers] appears to be malfunctioning: Unable to communicate with service [/rostopic_112_1685102927315/get_loggers], address [rosrpc://172.16.0.3:45357]

A common cause is that the machine cannot connect to itself. Please check for errors by running:

    ping 172.16.0.3

For more tips, please see

    http://wiki.ros.org/ROS/NetworkSetup

The traceback for the exception was written to ... (more)

edit retag flag offensive close merge delete