Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ROS1 images to include tools in ROS2 images #370

Closed
ruffsl opened this issue Feb 5, 2020 · 4 comments
Closed

Update ROS1 images to include tools in ROS2 images #370

ruffsl opened this issue Feb 5, 2020 · 4 comments

Comments

@ruffsl
Copy link
Member

ruffsl commented Feb 5, 2020

I've gotten to a nice minimal recipe for building arbitrary ros2 packages in Dockerfiles, provided the rosdistro dependencies in the package.xml are correctly specified and that .repo files for any necessary underlays are given. It'd be nice if the ROS1 images where updated to include the same colcon and mixin tooling so that folks would have a more consistent experience when using either.

Example:
https://github.com/ruffsl/pose_graph_tools/blob/f247e1927551ebffc036d6abd7d3d34237bf2edf/Dockerfile

Basically just updating the ROS1 templates to include:

# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
git \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/*

# setup colcon mixin and metadata
RUN colcon mixin add default \
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
colcon mixin update && \
colcon metadata add default \
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
colcon metadata update

However, colcon doesn't seem to be available from the ros1 apt repo. Suggestions?

@mikaelarguedas
Copy link
Contributor

mikaelarguedas commented Feb 5, 2020

It'd be nice if the ROS1 images where updated to include the same colcon and mixin tooling so that folks would have a more consistent experience when using either.

AFAIK this is explicitly not a goal. Changing the recommended way of building packages in ROS 1 has been avoided for years, this is why all the official tutorials still recommend to use catkin_make instead of catkin-tools. Encouraging people to use colcon instead seems risky and diverges from all the official tutorials and documentation.
Colcon is currently less convenient and definitely less tested in the ROS 1 context than other tools like catkin-tools.

There can be a tutorial on "how to build ROS1 workspaces with colcon" but IMO it doesn't justify including it in the default docker images or recommending its' use.

However, colcon doesn't seem to be available from the ros1 apt repo. Suggestions?

I don't think this is true.
colcon is a Python 3 only tool, maybe you tried to install python-colcon-common-extensions instead of python3-colcon-common-extensions

@ruffsl
Copy link
Member Author

ruffsl commented Feb 6, 2020

Changing the recommended way of building packages in ROS 1 has been avoided for years

I feel like it was more the case that colcon didn't have feature parity with catkin for years before.

Colcon is currently less convenient and definitely less tested in the ROS 1 context than other tools like catkin-tools.

Could you specify where this is still the case using colcon with ROS1 melodic packages? I haven't encountered anything for melodic yet. Also, such could've be said even for catkin years after rosbuild.

I don't think this is true. colcon is a Python 3 only tool

This is what I tried:

FROM ros:melodic

RUN apt-get update && apt-get install --no-install-recommends -y \
    git \
    python3-colcon-common-extensions \
    python3-colcon-mixin \
    python3-rosdep \
    python3-vcstool \
    && rm -rf /var/lib/apt/lists/*

RUN colcon mixin add default \
      https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
    colcon mixin update && \
    colcon metadata add default \
      https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
    colcon metadata update

Build output:

Sending build context to Docker daemon  4.096kB
Step 1/3 : FROM ros:melodic
 ---> 56d421f88256
Step 2/3 : RUN apt-get update && apt-get install --no-install-recommends -y     git     python3-colcon-common-extensions     python3-colcon-mixin     python3-rosdep     python3-vcstool     && rm -rf /var/lib/apt/lists/*
 ---> Running in b0d3829a55cc
Get:1 http://packages.ros.org/ros/ubuntu bionic InRelease [4669 B]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://packages.ros.org/ros/ubuntu bionic/main amd64 Packages [623 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [7061 B]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [800 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [26.7 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [808 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:14 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1342 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [40.4 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [11.1 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1095 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [2496 B]
Get:20 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [4242 B]
Fetched 18.1 MB in 3s (5369 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.17.1-1ubuntu0.5).
git set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-rosdep : Depends: python3-catkin-pkg but it is not going to be installed
                  Depends: python3-rospkg but it is not going to be installed
                  Depends: python3-rosdep-modules (>= 0.18.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends -y     git     python3-colcon-common-extensions     python3-colcon-mixin     python3-rosdep     python3-vcstool     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

Looks like it was the python3 versions of rosdep was conflicting with the python2 version.

@mikaelarguedas
Copy link
Contributor

Changing the recommended way of building packages in ROS 1 has been avoided for years

I feel like it was more the case that colcon didn't have feature parity with catkin for years before.

catkin_tools has been providing many more features than catkin_make and so for multiple years so I don't think that's the reason

Colcon is currently less convenient and definitely less tested in the ROS 1 context than other tools like catkin-tools.

Could you specify where this is still the case using colcon with ROS1 melodic packages?

Several companies deploying fleets of robots in various contexts have been using catkin_tools for years. Many tutorials and resources use it even though it is not the recommended ROS 1 build tool.
It provides convenience features that colcon doesn't provide to this day (colorized output, DESTDIR support, profiles etc) while keeping all the behavior user are familiar with (devel space, not building the test targets by default etc).

I'm not advocating for using one or the other, my point is more that it seems pretty subjective and inconsistent with all the online material and the default workflow advertised for ROS 1.

Ultimately, the decision to change the default build tool and workflow for ROS 1 should be OSRF's and if/when it happens it should be reflected in the docker images. Not the other way around IMO.
And at the moment it looks like the approach is to keep catkin_make as the default build tool for ROS Noetic.

This is what I tried:

Yeah this is unrelated to colcon. ros-infrastructure/rosdep#618

I've gotten to a nice minimal recipe for building arbitrary ros2 packages in Dockerfiles, provided the rosdistro dependencies in the package.xml are correctly specified and that .repo files for any necessary underlays are given.

That logic is build tool independant except the building bit. You can find similar logic in multiple CI systems like ros2ci or industrial_ci. Industrial CI use the same logic for everything but building and just use a different build tool based on the ROS version. Maybe some inspiration / consolidation can result from that work?

It'd be nice if the ROS1 images where updated to include the same colcon and mixin tooling so that folks would have a more consistent experience when using either.

Are there some user requests for adding colcon to the ROS 1 images ? Or is it hypothetical?

@tfoote
Copy link
Contributor

tfoote commented Feb 7, 2020

Indeed we're trying to be as little disruptive to the established workflows. With ROS 1 sunsetting in the forseeable future reworking all the tutorials and documentation to use a new tool is not something that I think we should consider. As @mikaelarguedas we would have liked to have done it for catkin-tools previously but the considerable switching cost was too high. And a switch to colcon will similarly be very expensive in terms of confusion, questions, support, and disruption of existing users.

It's certainly possible for power users to use them together we just don't want to have that as a recommended pattern that we're supporting for the community.

@ruffsl ruffsl closed this as completed May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants