Skip to content

Commit

Permalink
use catkin_virtualenv for respeaker_ros
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Dec 6, 2022
1 parent 279ff19 commit ab9d0dd
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
23 changes: 21 additions & 2 deletions respeaker_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
cmake_minimum_required(VERSION 2.8.3)
project(respeaker_ros)

find_package(catkin REQUIRED COMPONENTS dynamic_reconfigure)
find_package(catkin REQUIRED COMPONENTS
catkin_virtualenv
dynamic_reconfigure
)

generate_dynamic_reconfigure_options(
cfg/Respeaker.cfg
)

catkin_package()

if($ENV{ROS_DISTRO} STRGREATER "melodic")
catkin_generate_virtualenv(
PYTHON_INTERPRETER python3
)
else()
catkin_generate_virtualenv(
PYTHON_INTERPRETER python2
)
endif()

install(DIRECTORY config launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS)
install(FILES requirements.txt
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

file(GLOB PYTHON_SCRIPTS scripts/*.py)
catkin_install_python(PROGRAMS ${PYTHON_SCRIPTS}
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/scripts/)

if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest(test/sample_respeaker.test)
add_rostest(test/sample_respeaker.test
DEPENDENCIES ${PROJECT_NAME}_generate_virtualenv
)
endif()
9 changes: 8 additions & 1 deletion respeaker_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<author email="furushchev@jsk.imi.i.u-tokyo.ac.jp">Yuki Furuta</author>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>catkin_virtualenv</build_depend>
<build_depend>dynamic_reconfigure</build_depend>

<exec_depend>angles</exec_depend>
<exec_depend>audio_common_msgs</exec_depend>
<exec_depend>dynamic_reconfigure</exec_depend>
Expand All @@ -23,6 +25,11 @@
<exec_depend condition="$ROS_PYTHON_VERSION == 2">python-pyaudio</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-pyaudio</exec_depend>
<exec_depend>python-pyusb-pip</exec_depend>
<exec_depend>python-speechrecognition-pip</exec_depend>

<test_depend>jsk_tools</test_depend>

<export>
<pip_requirements>requirements.txt</pip_requirements>
</export>

</package>
1 change: 1 addition & 0 deletions respeaker_ros/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SpeechRecognition==3.8.1
Empty file modified respeaker_ros/scripts/respeaker_gencfg.py
100755 → 100644
Empty file.
Empty file modified respeaker_ros/scripts/respeaker_node.py
100755 → 100644
Empty file.
Empty file modified respeaker_ros/scripts/speech_to_text.py
100755 → 100644
Empty file.

0 comments on commit ab9d0dd

Please sign in to comment.