Question:

ROS melodic instalation for Ubuntu 20.04

Nathan: 02 February 2022

A lot of packages are still not supported in ros noetic, so i was trying to build melodic from source in ubuntu 20.04. While following instructions from here (http://wiki.ros.org/Installation/Source), i got stuck in this command rosdep install --from-paths src --ignore-src --rosdistro melodic -y

The errors i got were:-

ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: laser_geometry: No definition of [python-numpy] for OS version [focal] genpy: No definition of [python-yaml] for OS version [focal] gencpp: No definition of [python-setuptools] for OS version [focal] python_orocos_kdl: No definition of [python-sip] for OS version [focal]

I understand that these are because ubuntu 20.04 doesnt have python in it. So i tried doing

  1. alias python=python3 in my bashrc
  2. sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

but i still receive these errors. How to resolve these issues? Even if i sudo apt-get install all these packages, still these erros are present.

Answer:
Stella: 02 February 2022

Towards answering your question...

I began down the path suggested by @HimnashuTanwar, building melodic from source, but ultimately concluded that a full ros melodic install is not viable in 20.04.

A few notes:

  • Adding a -r to the rosdep command immediately exposed all of the
    dependencies related to Python2 Most such dependencies could be met
    using pip install -U [package].
  • A notable exception was pyqt5, which in turn depended on sip. At first I endeavored to build the sources of these two, as per https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-and-installing-from-source, but settled on this solution instead: How to get PyQt5 for Python2 on Ubuntu 20.04 (https://askubuntu.com/questions/1254347/how-to-get-pyqt5-for-python2-on-ubuntu-20-04)
  • What caused me to abandon the build was a nasty dependence of
    melodic's tf2 on an earlier version of Boost. It turns out that 20.04 runs on libboost1.71, wherein boost-signals has been deprecated and deleted, and this breaks the build of tf2 -- this issue is of course remedied in Noetic.

So in the end, it's probably best to stick with the supported version pairs: melodic on 18.04 or noetic on 20.04+, as per (http://wiki.ros.org/Distributions)