ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Python2 et catkin still seems to be needed for ROS2 Crystal

asked 2019-03-11 10:36:33 -0600

William Bulle gravatar image

System Used: Docker Built Ubuntu 18.04

I followed the Linux Build ROS2 tutorial. My Dockerfile is mainly the development tools and ROS tools.

These steps were done in the container itself.

I got several issues:

I. Some packages can't be found

python3-vcstool and python3-colcon-common-extensions can't be located using apt and does't seems to exist when searching with https://packages.ubuntu.com/ . The workaround seems to be to install them with pip3

II. Why Python2 is still needed ?

Python3 should be the standard for ROS2, why python-rosdep is needed and not python3-rosdep (wich in reality, python3-rosdep2 is installed).

In anyway, when installing python3-rosdep, no alias are created in /usr/bin. Workaround: Installing python-rosdep (which install the whole python2 which is unwanted) and replace the python shebang line with python3.

III. Why catkin is still required as ROS2 should be using colcon/ament ?

Despite the differents workarounds, I encounter the same issue at this step:

sudo rosdep init
rosdep update
# [Ubuntu 18.04]
rosdep install --from-paths src --ignore-src --rosdistro crystal -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers"

I encounter the same error respectively Python2 or Python3


with Python3:

ERROR: Rosdep experienced an error: Unable to handle package.xml format version '3', please update catkin_pkg (e.g. on Ubuntu/Debian use: sudo apt-get update && sudo apt-get install --only-upgrade python-catkin-pkg)
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://www.ros.org/wiki/rosdep

rosdep version: 0.11.8

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/usr/lib/python3/dist-packages/catkin_pkg/packages.py", line 106, in __call__
    parsed_package = parse_package_string(xml, filename=filename, warnings=warnings)
  File "/usr/lib/python3/dist-packages/catkin_pkg/package.py", line 457, in parse_package_string
    assert pkg.package_format in [1, 2], "Unable to handle package.xml format version '%d', please update catkin_pkg (e.g. on Ubuntu/Debian use: sudo apt-get update && sudo apt-get install --only-upgrade python-catkin-pkg)" % pkg.package_format
AssertionError: Unable to handle package.xml format version '3', please update catkin_pkg (e.g. on Ubuntu/Debian use: sudo apt-get update && sudo apt-get install --only-upgrade python-catkin-pkg)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/rosdep2/main.py", line 137, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/usr/lib/python3/dist-packages/rosdep2/main.py", line 383, in _rosdep_main
    return _package_args_handler(command, parser, options, args)
  File "/usr/lib/python3/dist-packages/rosdep2/main.py", line 436, in _package_args_handler
    pkgs = find_catkin_packages_in(path, options.verbose)
  File "/usr/lib/python3/dist-packages/rosdep2/catkin_packages.py", line 33, in find_catkin_packages_in
    packages = find_packages(path)
  File "/usr/lib/python3/dist-packages/catkin_pkg/packages.py", line 86, in find_packages
    packages = find_packages_allowing_duplicates(basepath, exclude_paths=exclude_paths, exclude_subspaces=exclude_subspaces, warnings=warnings)
  File "/usr/lib/python3/dist-packages/catkin_pkg/packages.py", line 153, in find_packages_allowing_duplicates
    path_parsed_packages, warnings_lists ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-03-11 12:07:17 -0600

marguedas gravatar image

An example of a dockerfile building ROS 2 from source can be found at https://github.com/osrf/docker_images...

I. Some packages can't be found

python3-vcstool and python3-colcon-common-extensions can't be located using apt and does't seems to exist when searching with https://packages.ubuntu.com/ . The workaround seems to be to install them with pip3

Did you setup the ROS apt repository as specified at the beginning of the tutorial?

Python3 should be the standard for ROS2, why python-rosdep is needed and not python3-rosdep (wich in reality, python3-rosdep2 is installed).

The tutorial recommends to install python-rosdep because python3-rosdep and python-rosdep are not side-by-side installable and most ROS1 users already have python-rosdep installed. If you're working in docker you can use python3-rosdep

(wich in reality, python3-rosdep2 is installed).

This is the case only for the debian packages that are not maintained or released by OSRF. The OSRF packages are named python(3)-rosdep and there is no python(3)-rosdep2. You should use the ones from the ROS2 apt repository instead

Why catkin is still required as ROS2 should be using colcon/ament ?

catkin (the build system) and catkin_make (the build tools) are not used in ROS 2 and not required. colcon does rely on the package catkin_pkg to parse the ROS package.xml that are the same between ROS 1 and ROS 2.

ERROR: Rosdep experienced an error: Unable to handle package.xml format version '3'

This is because the version of rosdep installed in you container is too old. The one currently available in the ROS apt repository is 0.15.1 and not 0.11.8

edit flag offensive delete link more

Comments

This is the case only for the debian packages that are not maintained or released by OSRF. The OSRF packages are named python(3)-rosdep and there is no python(3)-rosdep2. You should use the ones from the ROS2 apt repository instead

It looks like the OP ran into wiki/UpstreamPackages.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-11 12:10:42 -0600 )edit

Thank you for your answers. My repositories weren't correctly set which brought all of the others issues. As gvhoorn said, I probably mixed the streams.

William Bulle gravatar image William Bulle  ( 2019-03-12 05:24:15 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-03-11 10:32:36 -0600

Seen: 1,861 times

Last updated: Mar 11 '19