无法使用localhost以外的任何东西连接到UrSim docker

n53p2ov0  于 2023-08-03  发布在  Docker
关注(0)|答案(1)|浏览(116)

我正在尝试运行ursim_e-series docker container并使用ur_robot_driver连接到它。我已经按照说明进行了设置,以便它使用命令docker run --rm -it -p 5900:5900 -p 6080:6080 -v ${HOME}/.ursim/urcaps:/urcaps -v ${HOME}/.ursim/programs:/ursim/programs --name ursim --net ursim_net --ip 192.168.56.101 universalrobots/ursim_e-series启动,并且应该可以通过浏览器由http://192.168.56.101:6080/vnc.html访问。
它成功启动,但我只能使用http://localhost:6080/vnc.html访问brovser中的VNC,这也不允许我看到机器人模拟器,当尝试使用ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur5e robot_ip:=192.168.56.101连接到它时,因为它无法在IP地址上找到机器人。
我有Linux Ubuntu 22.04和Docker Desktop 4.21.1(114176)。让我知道如果其他信息是必需的!
Related question
当运行ifconfig时,我得到输出

enp7s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.13.136.72  netmask 255.255.254.0  broadcast 10.13.137.255
        inet6 fe80::7943:8ae8:4740:e969  prefixlen 64  scopeid 0x20<link>
        ether 98:fa:9b:bb:d4:af  txqueuelen 1000  (Ethernet)
        RX packets 2896104  bytes 772999648 (772.9 MB)
        RX errors 0  dropped 222  overruns 0  frame 0
        TX packets 2516553  bytes 170849174 (170.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 251007  bytes 56927434 (56.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 251007  bytes 56927434 (56.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

字符串
docker network inspect -v ursim_net返回

[
    {
        "Name": "ursim_net",
        "Id": "249333ce0b18910f29a69f69d5e9ff6229a14faaf4ff14f8d3c9cb51062d7c80",
        "Created": "2023-07-26T12:59:11.831234829Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.56.0/24",
                    "Gateway": "192.168.56.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "42219db95f6fd3be6fac11943664582a99e34276239e47844fe74f0c6d5e1b1b": {
                "Name": "ursim",
                "EndpointID": "2485afa6b5ed449706dca7164dc736325e5a2dab2724666204e43d71f431df14",
                "MacAddress": "02:42:c0:a8:38:65",
                "IPv4Address": "192.168.56.101/24",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

bq3bfh9z

bq3bfh9z1#

使用docker.io而不是docker-desktop解决了这个问题。可悲的是,我不知道他们之间有什么不同,使这种情况发生。

相关问题