rosnodes not connecting to roscore inside docker

asked 2021-01-08 09:30:56 -0500

SS6141 gravatar image

I have built a docker image on my own and run ros nodes in it. However, ros nodes are not able to connect to ros master. kindly find the docker run command I am using below.

 docker run -it \
--user=$(id -u $USER):$(id -g $USER) \
--env="DISPLAY" \
--workdir="/home/$USER" \
--volume="/home/$USER:/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--volume="/dev/ttyUSB0:/dev/ttyUSB0:rw" \
--add-host hostname:127.0.0.1 \
--add-host in_ros_docker:127.0.0.1 \
--hostname in_ros_docker \
--net=host \
--env ROS_MASTER_URI=http://172.17.0.1:11311 \
--env ROS_IP=172.17.0.1  \
--env ROS_HOSTNAME=172.17.0.1 \
--privileged \
  ros:kinetic

Am I missing something? Thanks in advance.

edit retag flag offensive close merge delete