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

ROS Melodic Python 3 Source

asked 2019-04-30 14:17:30 -0500

rukie gravatar image

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/ShreyasSkanda... 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
edit retag flag offensive close merge delete

Comments

Did you get it working in the end?

gustavo.velascoh gravatar image gustavo.velascoh  ( 2020-04-01 09:00:06 -0500 )edit

I did not :(

rukie gravatar image rukie  ( 2020-04-01 13:56:15 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-01 13:58:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-01-05 08:24:46 -0500

fnando1995 gravatar image

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/Installat...)

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

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2019-04-30 14:17:30 -0500

Seen: 641 times

Last updated: Jan 05 '21