Ask Your Question
0

coral edge tpu with python 3

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

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/libpython3.5m.so \
              -DSETUPTOOLS_DEB_LAYOUT=OFF

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

1 Answer

Sort by ยป oldest newest most voted
1

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

knorth55 gravatar image

I made another ROS package for Coral TPU called coral_usb. https://github.com/knorth55/coral_usb...

And I also wrote how to build your workspace in Kinetic and Melodic with Python3.5 or Python3.6. https://github.com/knorth55/coral_usb...

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

edit flag offensive delete link more

Comments

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 -0600 )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 https://github.com/knorth55/coral_usb...

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 224 times

Last updated: Oct 26 '19