osrf / docker_images

A repository to hold definitions of docker images maintained by OSRF
Apache License 2.0
527 stars 168 forks source link

Topics not showing up with WSL and ros:humble base image, but show up with osrf/ros:humble-desktop #720

Closed MFHuniovi closed 4 months ago

MFHuniovi commented 4 months ago

I am trying to work with ros2 on dockers but I am finding that the official ros2:humble image if I do the pubsub tutorial it never comes up with the topics "docker run -it --rm -v /mnt/c/dev/:/home ros:humble" image

But the osrf ros2 humble desktop image does it well. "docker run -it --rm -v /mnt/c/dev/:/home osrf/ros:humble-desktop" image

My question is what is the difference between one docker and the other? I would like to work with the official docker in case osrf ever stops supporting it or something.

sloretz commented 4 months ago

I don't know why the ros2:humble image didn't show the topics. I would have expected both to work. However, I can answer the difference between ros and osrf/ros images.

I would like to work with the official docker in case osrf ever stops supporting it or something.

Both ros:humble and osrf/ros:humble are supported by this repository. The ones in ros are part of the docker library, while the osrf/ros ones are pushed to the osrf account on docker hub. There is no difference in support between the two. That is if OSRF decided to stop supporting Docker images then both would disappear as no one would be pushing updates to the official docker library.

That said, I don't think the OSRF is going to go away anytime soon. I think it's safe to rely on both ros and osrf/ros images at least until you get to a production robotic system. In production you'll want more control over when the software on robots update, so you'll likely create your own way of distributing software to them (which might be docker images that you create and push to a container registry you control).

MFHuniovi commented 4 months ago

Thank you very much, what change do you think the osrf image needs to make it work? Is it a network issue that is already preconfigured?

mikaelarguedas commented 4 months ago

In production you'll want more control over when the software on robots update, so you'll likely create your own way of distributing software to them (which might be docker images that you create and push to a container registry you control).

You can totally use official images for production systems and control what version by using digests instead of tags

Thank you very much, what change do you think the osrf image needs to make it work? Is it a network issue that is already preconfigured?

I can't reproduce for now, the same behavior and topic list is shown regardless of the base image used. Is it the same for you ?

Using ros:humble

$ docker pull ros:humble
$ docker run -it --rm ros:humble
root@eda409c38565:/# apt update && apt install -y ros-humble-demo-nodes-cpp
root@eda409c38565:/# ros2 run demo_nodes_cpp listener &
[1] 332
root@eda409c38565:/# ros2 topic list
/chatter
/parameter_events
/rosout

Using osrf/ros:humble-desktop

$ docker pull osrf/ros:humble-desktop
$ docker run -it --rm osrf/ros:humble-desktop
root@5a6436639e58:/# apt update && apt install -y ros-humble-demo-nodes-cpp
root@5a6436639e58:/# ros2 run demo_nodes_cpp listener &
[1] 321
root@5a6436639e58:/# ros2 topic list
/chatter
/parameter_events
/rosout
MFHuniovi commented 4 months ago

Although it seems crazy now I can't reproduce the problem, I updated wsl to the latest pre-release version a few days ago now it works fine but I don't know why.... (I want to work with graphical interface and apparently the latest pre-release version works "fine" gazebo(not working), rviz and rqt (these two do work)) :/

Still thank you very much for the collaboration, I don't like to see a possible problem and that it is solved by "magic". image

mikaelarguedas commented 4 months ago

:thinking: good to know that this showed up with WSL, don't hesitate to provide as much context as possible about your setup in your future issues

I'll close this one out for now to not mix various topics in the same ticket.

If you happen to face the problem again in the future don't hesitate to comment here and we can reopen and investigate further