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

coral edge tpu with python 3

asked 2019-10-16 09:14:30 -0500

I want to use my Coral Edge TPU with my standard ros melodic installation.

The package I want to use (edgetpu_ros) needs to be run in a ROS environment with Python 3, because the Edge TPU API doesn't work with Python 2.

I have a running standard ROS installation, which uses Python 2 as default, and I does not want to change my running system.

The solution of the author is to use catkin config to create a new workspace with python 3:

catkin config -DPYTHON_EXECUTABLE=/home/josh/miniconda3/envs/ros-py3/bin/python \
              -DPYTHON_INCLUDE_DIR=/home/josh/miniconda3/envs/ros-py3/include/python3.5m \
              -DPYTHON_LIBRARY=/home/josh/miniconda3/envs/ros-py3/lib/ \

Will the suggested workflow and the new workspace activated with "catkin config" (never used catkin config before) have an impact on the already existing workspaces / ros installation? Or do I have to switch completely to python3 ?

Then, clone the cv_bridge repository in your source folder. If you have OpenCV 3 built and in your path, then in theory everything is fine. The only issue you may come up against is that Numpy will shout at you. If it does, locate the offending file and check the #ifdef statement - just delete the bit that isn't for Python3.

Never change a running system!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-10-26 10:41:58 -0500

knorth55 gravatar image

I made another ROS package for Coral TPU called coral_usb.

And I also wrote how to build your workspace in Kinetic and Melodic with Python3.5 or Python3.6.

You do not need to use miniconda python, but system python3.

edit flag offensive delete link more


Is only the workspace in Python 3? Can I use it if I installed ROS under Python 2?

Michdo93 gravatar image Michdo93  ( 2020-06-28 18:28:30 -0500 )edit

Coral TPU only runs on Python3.5+. Therefore, we use a trick to build and run our package with Python3 even if you install ROS with python2 (such as ROS kinetic and melodic).

Please read catkin configline in

knorth55 gravatar image knorth55  ( 2020-06-28 19:54:32 -0500 )edit

answered 2022-03-03 22:02:02 -0500

Hi, arminf82. I think you have already solved this. So my question is more about a personal concern rather but not a clue to help you. Any way, which version of coral are you using? Is it a dev board, System Of Module or the USB version?

Thanks in advance.

edit flag offensive delete link more

Question Tools



Asked: 2019-10-16 09:14:30 -0500

Seen: 697 times

Last updated: Oct 26 '19