Robotics StackExchange | Archived questions

ROS Melodic Python 3 Source

As I'm a glutton for punishment I keep trying to find a way to get Python 3 to work with ROS, even starting from source.

Side note: I reviewed ROS2, but the TF2 package isn't incorporated into ROS2 Python3 yet.

Anyways, I tried with a fresh install of Ubuntu 18.04 with the commands below, but I don't seem to download the resources consistently. Only about 4 packages downloaded with the VCSTools fix described below.

I guess what I'm asking, does anyone have a well described path on how to build ROS1 (anything) with Python3 support? Really all I desire is ROS commands, debugging tools, and TF2.

I've tried following these bash.scripts as well, https://gist.github.com/ShreyasSkandan/fd8682253d71c960b2b56376db6bd74a which also seem to fail similarly.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

sudo apt update
# can probably leave out wstool?
sudo apt install python3-rosdep python3-rosinstall-generator python3-wstool python3-rosinstall build-essential

sudo rosdep init

sudo rosdep update

# https://github.com/vcstools/vcstools/pull/141
cd ~
git clone https://github.com/tkruse/vcstools
cd vcstools
git checkout mock_server_tar_test
python3 setup.py develop

cd ~
git clone https://github.com/vcstools/wstool
cd wstool
python setup.py develop

mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws

rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall
wstool init -j8 src melodic-desktop-full.rosinstall

Asked by rukie on 2019-04-30 14:17:30 UTC

Comments

Did you get it working in the end?

Asked by gustavo.velascoh on 2020-04-01 09:00:06 UTC

I did not :(

Asked by rukie on 2020-04-01 13:56:15 UTC

At around the time @rukie asked this question, Github changed something which made vcstools unable to download the required release tarballs. This has been fixed for quite some time now.

Building Melodic with Python 3 support is more than possible. Not all packages, but that is something you'll always run into with something as federated as ROS.

Asked by gvdhoorn on 2020-04-01 13:58:56 UTC

Answers

Hey, just check this answer. Please review this:

Datos de la computadora de abordo: Sistema Operativo: Ubuntu 18.04.04

Version de ROS: Melodic (http://wiki.ros.org/melodic/Installation/Ubuntu)

Version de Python: 3.6

Compatibilidad con Python3 Luego de instalar ROS es necesario instalar algunos paquetes para lograr compatibilidad con Python 3.

$ sudo apt-get update

$ sudo apt-get install python3 python3-dev python3-pip python3-yaml

$ pip3 install catkin_pkg

$ pip3 install empy

$ pip3 install rospkg

Asked by fnando1995 on 2021-01-05 09:24:46 UTC

Comments