From 9e4676ed4f5bef593333694808f5758d62235682 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Thu, 26 Dec 2024 13:30:36 +0000 Subject: [PATCH] [ros-o] sound_classification: use Python3 and requirements.in.obase --- sound_classification/CMakeLists.txt | 9 +++++++++ sound_classification/requirements.in.obase | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 sound_classification/requirements.in.obase diff --git a/sound_classification/CMakeLists.txt b/sound_classification/CMakeLists.txt index 3dafdddebd..19b346fe1f 100644 --- a/sound_classification/CMakeLists.txt +++ b/sound_classification/CMakeLists.txt @@ -29,10 +29,19 @@ catkin_package( message_runtime ) +if("$ENV{ROS_DISTRO}" STREQUAL "indigo" OR "$ENV{ROS_DISTRO}" STREQUAL "kinetic" OR + "$ENV{ROS_DISTRO}" STREQUAL "melodic" OR "$ENV{ROS_DISTRO}" STREQUAL "noetic") catkin_generate_virtualenv( PYTHON_INTERPRETER python2 INPUT_REQUIREMENTS requirements.in ) +else() +file(REMOVE requirements.txt) +catkin_generate_virtualenv( + PYTHON_INTERPRETER python3 + INPUT_REQUIREMENTS requirements.in.obase + ) +endif() file(GLOB SCRIPTS_FILES scripts/*.py) catkin_install_python( diff --git a/sound_classification/requirements.in.obase b/sound_classification/requirements.in.obase new file mode 100644 index 0000000000..6aab3c2c1a --- /dev/null +++ b/sound_classification/requirements.in.obase @@ -0,0 +1,3 @@ +chainer # For Python 2.x, chainer 5.x.x is needed, 7.0.0 will not work on Python2 +numpy<2.0 +cv_bridge