Skip to content

Commit

Permalink
Merge branch 'master' into respeaker
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada authored Dec 8, 2022
2 parents ba06180 + 51da476 commit e7e80ec
Show file tree
Hide file tree
Showing 64 changed files with 2,152 additions and 19 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ jobs:
ROS_PARALLEL_TEST_JOBS: "-j8"
CATKIN_PARALLEL_JOBS: "-i"
NOT_TEST_INSTALL : true
BEFORE_SCRIPT : "for name in dialogflow_task_executive ros_speech_recognition sesame_ros ffha libsiftfast nlopt julius julius_ros downward assimp_devel; do echo \\$name; find $GITHUB_WORKSPACE -iname \\$name -exec touch {}/CATKIN_IGNORE \\; ; ls -al \\$(find -iname \\$name)/; done" # Skip large packagses / Skip packages that could not build on indigo dialogflow_task_executive/ros_speech_recognition/sesame_ros
BEFORE_SCRIPT : "for name in dialogflow_task_executive ros_speech_recognition sesame_ros respeaker_ros ffha libsiftfast nlopt julius julius_ros downward assimp_devel google_chat_ros; do echo \\$name; find $GITHUB_WORKSPACE -iname \\$name -exec touch {}/CATKIN_IGNORE \\; ; ls -al \\$(find -iname \\$name)/; done" # Skip large packagses / Skip packages that could not build on indigo dialogflow_task_executive/ros_speech_recognition/sesame_ros/respeaker_ros
- ROS_DISTRO: kinetic
CONTAINER: ubuntu:16.04
ROS_PARALLEL_TEST_JOBS: "-j8"
CATKIN_PARALLEL_JOBS: "-i"
EXTRA_DEB : "python-lxml"
BEFORE_SCRIPT : "sudo add-apt-repository -y ppa:jblgf0/python; sudo apt-get update; sudo apt-get install -y python3.6 python3.6-venv libpython3.6-dev; sudo ln -sf python3.6 /usr/bin/python3; ls -al /usr/bin/python3; python3 --version; python3 -v -m venv /tmp/v"
- ROS_DISTRO: melodic
CONTAINER: ubuntu:18.04
ROS_PARALLEL_TEST_JOBS: "-j8"
Expand Down Expand Up @@ -64,8 +65,8 @@ jobs:
git config --global --add safe.directory $GITHUB_WORKSPACE
fi
- name: Chcekout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3.0.2

- name: Start X server
run: |
Expand All @@ -83,7 +84,8 @@ jobs:
- name: Run jsk_travis
uses: jsk-ros-pkg/jsk_travis@master
with:
ROS_PARALLEL_JOBS : ${{ matrix.ROS_PARALLEL_JOBS }}
# darty hack, jsk_travis runs catkin build --make-args $ROS_PARALLEL_JOBS --
ROS_PARALLEL_JOBS : ${{ matrix.ROS_PARALLEL_JOBS }} LANG=C.UTF-8 LC_ALL=C.UTF-8
CATKIN_PARALLEL_JOBS : ${{ matrix.CATKIN_PARALLEL_JOBS }}
ROS_PARALLEL_TEST_JOBS : ${{ matrix.ROS_PARALLEL_TEST_JOBS }}
CATKIN_PARALLEL_TEST_JOBS : ${{ matrix.CATKIN_PARALLEL_TEST_JOBS }}
Expand All @@ -94,6 +96,7 @@ jobs:
BEFORE_SCRIPT : ${{ matrix.BEFORE_SCRIPT }}
EXTRA_DEB : ${{ matrix.EXTRA_DEB }}


kinetic_i386:
runs-on: ubuntu-latest
name: kinetic_i386
Expand All @@ -102,7 +105,7 @@ jobs:
steps:
- name: Install latest git ( use sudo for ros-ubuntu )
run: apt-get update && apt-get install -y software-properties-common && apt-get update && add-apt-repository -y ppa:git-core/ppa && apt-get update && apt-get install -y git
- name: Chcekout
- name: Checkout
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
Expand All @@ -114,11 +117,13 @@ jobs:
with:
EXTRA_DEB : "python-lxml"
ROS_DISTRO : kinetic
ROS_PARALLEL_JOBS : "LANG=C.UTF-8 LC_ALL=C.UTF-8"
ROS_PARALLEL_TEST_JOBS : "-j8"
CATKIN_PARALLEL_JOBS: "-i"
ROSDEP_ADDITIONAL_OPTIONS : "-n -q -r --ignore-src --skip-keys=python-google-cloud-texttospeech-pip --skip-keys=python-dialogflow-pip" # Skip installation of grpcio by pip because it causes error
# https://github.com/jsk-ros-pkg/jsk_3rdparty/pull/237 : (Note that pip==21.0.1 is incompatible with python 2.x)
BEFORE_SCRIPT : "sudo pip install virtualenv==15.1.0"
BEFORE_SCRIPT : "sudo pip install virtualenv==15.1.0; sudo add-apt-repository -y ppa:jblgf0/python; sudo apt-get update; sudo apt-get install -y python3.6 python3.6-venv libpython3.6-dev; sudo ln -sf python3.6 /usr/bin/python3"


arm:
runs-on: ubuntu-latest
Expand All @@ -137,7 +142,7 @@ jobs:
submodules: 'true'
- name: Skip packagse
run: |
for name in ffha libsiftfast nlopt julius julius_ros downward assimp_devel; do echo $name; find -iname $name -exec touch {}/CATKIN_IGNORE \; ; ls -al $(find -iname $name)/; done
for name in ffha libsiftfast nlopt julius julius_ros downward assimp_devel google_chat_ros; do echo $name; find -iname $name -exec touch {}/CATKIN_IGNORE \; ; ls -al $(find -iname $name)/; done
- uses: uraimo/run-on-arch-action@v2
name: Run commands
with:
Expand All @@ -156,5 +161,6 @@ jobs:
export USE_TRAVIS=true
export USE_DOCKER=false
export NOT_TEST_INSTALL=true
export ROS_PARALLEL_JOBS="--make-args LANG=C.UTF-8 LC_ALL=C.UTF-8"
set +o nounset
source .travis/travis.sh
21 changes: 15 additions & 6 deletions dialogflow_task_executive/node_scripts/dialogflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
from google.oauth2.service_account import Credentials
from google.protobuf.json_format import MessageToJson
import pprint
import Queue
try:
import Queue
except ImportError:
import queue as Queue
import os
import rospy
import sys
import threading
import uuid

Expand Down Expand Up @@ -102,7 +107,7 @@ def make_dialog_msg(self, result):
rospy.logwarn("Unknown action")
msg.action = result.action

if self.language == 'ja-JP':
if self.language == 'ja-JP' and os.environ["ROS_PYTHON_VERSION"] == "2":
msg.query = result.query_text.encode("utf-8")
msg.response = result.fulfillment_text.encode("utf-8")
else:
Expand Down Expand Up @@ -172,8 +177,11 @@ def __init__(self):
# hotwords
self.enable_hotword = rospy.get_param("~enable_hotword", True)
hotwords = rospy.get_param("~hotword", [])
self.hotwords = [ hotword.encode('utf-8') if isinstance(hotword, unicode ) else hotword
for hotword in hotwords ]
try:
self.hotwords = [ hotword.encode('utf-8') if isinstance(hotword, unicode ) else hotword
for hotword in hotwords ]
except NameError:
self.hotwords = hotwords

self.state = State()
self.queue = Queue.Queue()
Expand Down Expand Up @@ -260,11 +268,12 @@ def speak_result(self, result):
volume=self.volume)

# for japanese or utf-8 languages
if self.language == 'ja-JP':
if self.language == 'ja-JP' and sys.version <= 2:
msg.arg = result.fulfillment_text.encode('utf-8')
msg.arg2 = self.language
else:
msg.arg = result.fulfillment_text
if self.language == 'ja-JP':
msg.arg2 = self.language

self.sound_action.send_goal_and_wait(
SoundRequestGoal(sound_request=msg),
Expand Down
2 changes: 1 addition & 1 deletion dialogflow_task_executive/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<build_depend>catkin_virtualenv</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>roslaunch</build_depend>
<run_depend>app_manager</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>speech_recognition_msgs</run_depend>
<run_depend>topic_tools</run_depend>
<!-- <run_depend>python-dialogflow-pip</run_depend> install via catkin_virtualenv -->
<test_depend>roslaunch</test_depend>

<export>
<pip_requirements>requirements.txt</pip_requirements>
Expand Down
1 change: 1 addition & 0 deletions dialogflow_task_executive/requirements.in.noetic
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dialogflow==1.1.1
google-api-core[grpc]==1.33.0
grpcio-status==1.48.1
googleapis-common-protos[grpc]==1.56.2
protobuf==3.20.1 # fix Could not find a version that matches protobuf<4.0.0dev,<5.0.0dev,>=3.15.0,>=3.20.1,>=4.21.3 (from google-api-core[grpc]==1.33.1->dialogflow==1.1.1->-r requirements.in (line 1))
1 change: 1 addition & 0 deletions google_chat_ros/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requirements.txt
73 changes: 73 additions & 0 deletions google_chat_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
cmake_minimum_required(VERSION 2.8.3)
project(google_chat_ros)

find_package(
catkin REQUIRED COMPONENTS
catkin_virtualenv REQUIRED
rospy
actionlib_msgs
std_msgs
message_generation
)

catkin_python_setup()

add_message_files(
DIRECTORY msg
)

add_action_files(
FILES
SendMessage.action
)

generate_messages(
DEPENDENCIES
std_msgs
actionlib_msgs
)

catkin_package()

# generate the virtualenv
catkin_generate_virtualenv(
INPUT_REQUIREMENTS requirements.in
PYTHON_INTERPRETER python3
USE_SYSTEM_PACKAGES FALSE
CHECK_VENV FALSE
)

# install
# euslisp
file(GLOB EUSLISP_SCRIPTS scripts/*.l)
install(FILES ${EUSLISP_SCRIPTS}
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

# python
file(GLOB PYTHON_SCRIPTS scripts/*.py)
catkin_install_python(
PROGRAMS ${PYTHON_SCRIPTS}
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# python requirements
install(FILES requirements.txt
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

# launch
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

# import test
if(CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS catkin_virtualenv rostest)
catkin_install_python(
PROGRAMS test/test_import.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
add_rostest(test/import.test
DEPENDENCIES ${PROJECT_NAME}_generate_virtualenv
)
endif()
Loading

0 comments on commit e7e80ec

Please sign in to comment.