Duck Dodgers
Duck Dodgers

Reputation: 3461

The Docker image of ROS is unusable?

So, I pulled the ros container from docker hub, using

docker pull ros

which got me the latest docker 'foxy' version.

I proceeded with the tutorial on starting the docker container of ROS. I could successfully start the container and connect to it. It's a small little tutorial. Nothing long nor complicated.

The penultimate step in that tutorial asks for sourcing gthe setup.bash file, which I did and received no errors. (Actually nothing at all. Neither success, nor failure came up).

source /opt/ros/<distro>/setup.bash

And after that, to taste the sweet fruit of my hard labour I entered the final command (as mentioned in the tutorial),

rostopic list

which returned to my surprise,

rostopic command not found

I proceeded then to enter at the terminal roscore, roscd, etc and none of them worked. All of them were not found.

I did try to just run that setup script myself, from the terminal without using source, like:

$ /opt/ros/foxy/setup.bash

(after changing the permissions of course), which brought little change to the situation.

I looked in at the docker page for ros and nothing helpful was to be found there. Plenty of instructions there about how to build my own docker image for ROS, but that is not what I want to do right now, I guess.

I googled and the hits on the first page were:

  1. this (the original tutorial which I am anyways following),
  2. this (something general about docker) and,
  3. this (about how to run GUI with Docker - not there yet frankly),

which begs the question, what good is the container if I have to install everything myself anyways by following their other tutorial?

Or do I not understand something here? If someone could throw some light on it, it would be much appreciated.

Upvotes: 1

Views: 865

Answers (1)

Adam Allevato
Adam Allevato

Reputation: 56

Your container has ROS2, not ROS1. Try

ros2 topic list

If you want to get the ROS1 version instead, try pulling and running a different image instead:

docker pull ros:noetic-robot
docker run ros:noetic-robot

Context

The tutorial you are following was written some time ago, when the default container used ROS1. The new latest container uses ROS2 (in your case, Foxy). ROS2 doesn't have the same command names. rostopic does not work, and there isn't even a master, so roscore would make no sense!

The good news is, the tutorial page is a wiki, so I've already updated it to make it (at least slightly) clearer. If you have ideas for how to improve it, you could also make an account and do so.

Upvotes: 4

Related Questions