Skip to content

Commit

Permalink
Merge branch 'master' into develop/pr2
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 authored Jan 27, 2023
2 parents e84b81f + 33118e1 commit dfa5be0
Show file tree
Hide file tree
Showing 30 changed files with 1,004 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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 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
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"
Expand Down
20 changes: 20 additions & 0 deletions 3rdparty/zdepth/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 2.8.3)
project(zdepth)

include(ExternalProject)

if("$ENV{ROS_DISTRO}" STRGREATER "kinetic")
ExternalProject_Add(
zdepth
GIT_REPOSITORY https://github.com/catid/Zdepth.git
GIT_TAG ac7c6d8e944d07be2404e5a1eaa04562595f3756
GIT_SHALLOW TRUE
PATCH_COMMAND cat ${PROJECT_SOURCE_DIR}/fix_cmakelists.patch | patch -p1
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
INSTALL_COMMAND echo "install"
)

install(CODE "execute_process(COMMAND make install WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zdepth-prefix/src/zdepth-build)")
else()
install(CODE "message(WARNING \"Skipping zdepth install because ROS is too old\")")
endif()
50 changes: 50 additions & 0 deletions 3rdparty/zdepth/fix_cmakelists.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b22b2e7..a4251af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,7 @@ include_directories(include)

# zdepth library

-add_library(zdepth STATIC ${SOURCE_FILES})
+add_library(zdepth SHARED ${SOURCE_FILES})
add_library(zdepth::zdepth ALIAS zdepth)

target_link_libraries(zdepth PUBLIC zstd)
@@ -80,10 +80,13 @@ target_link_libraries(zdepth_test PRIVATE zdepth)
################################################################################
# Install

-install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX})
-install(FILES README.md DESTINATION ${CMAKE_INSTALL_PREFIX})
-install(DIRECTORY cmake include DESTINATION ${CMAKE_INSTALL_PREFIX})
-install(TARGETS zdepth EXPORT zdepth LIBRARY DESTINATION lib)
+# install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX})
+# install(FILES README.md DESTINATION ${CMAKE_INSTALL_PREFIX})
+install(FILES include/zdepth.hpp DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zdepth)
+install(FILES tests/test_vectors.inl DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zdepth/tests)
+install(TARGETS zdepth EXPORT zdepth
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)

################################################################################
# Generate zdepthConfig.cmake and zdepthConfigVersion.cmake for cmake projects
diff --git a/zstd/CMakeLists.txt b/zstd/CMakeLists.txt
index 5869d4d..f9339a3 100644
--- a/zstd/CMakeLists.txt
+++ b/zstd/CMakeLists.txt
@@ -19,10 +19,12 @@ include_directories(include src)
################################################################################
# Targets

-add_library(zstd ${ZSTD_SOURCE_FILES})
+add_library(zstd SHARED ${ZSTD_SOURCE_FILES})
target_include_directories(zstd PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)

-install(TARGETS zstd EXPORT zdepth LIBRARY DESTINATION lib)
+install(TARGETS zstd EXPORT zdepth
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
17 changes: 17 additions & 0 deletions 3rdparty/zdepth/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<package format="2">
<name>zdepth</name>
<version>0.0.0</version>
<description>The zdepth package</description>

<maintainer email="shingogo.5511@gmail.com">Shingo Kitagawa</maintainer>

<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>


<export>
<build_type>cmake</build_type>
</export>
</package>
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))
2 changes: 1 addition & 1 deletion google_chat_ros/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ google-auth-oauthlib==0.5.2
google-auth==2.8.0
google-cloud-pubsub==2.12.1
googleapis-common-protos[grpc]==1.56.2
grpc-google-iam-v1
grpc-google-iam-v1==0.12.4
grpcio-status==1.46.3
grpcio==1.46.3
httplib2
Expand Down
48 changes: 35 additions & 13 deletions google_chat_ros/scripts/google_chat_ros_node.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
import datetime
import gdown
import json
import os
Expand Down Expand Up @@ -31,6 +32,8 @@ def __init__(self):
self.download_data = rospy.get_param('~download_data', True)
self.download_directory = rospy.get_param('~download_directory', "/tmp")
self.download_avatar = rospy.get_param('~download_avatar', False)
self.upload_parents_path = rospy.get_param(
'~upload_parents_path', 'chat_notification')

# For sending message
self._client = GoogleChatRESTClient(google_credentials)
Expand Down Expand Up @@ -107,6 +110,7 @@ def rest_cb(self, goal):

# Card
json_body['cards'] = []
timestamp = '{0:%Y%m%d%H%M%S}'.format(datetime.datetime.now())
if goal.cards:
if goal.update_message:
json_body['actionResponse'] = {"type": "UPDATE_MESSAGE"}
Expand All @@ -122,10 +126,12 @@ def rest_cb(self, goal):
if card.header.image_url:
header['imageUrl'] = card.header.image_url
elif card.header.image_filepath:
header['imageUrl'] = self._upload_file(card.header.image_filepath)
header['imageUrl'] = self._upload_file(
card.header.image_filepath, timestamp=timestamp)
# card/sections
sections = []
sections = self._make_sections_json(card.sections)
sections = self._make_sections_json(
card.sections, timestamp=timestamp)
# card/actions
card_actions = []
for card_action_msg in card.card_actions:
Expand Down Expand Up @@ -267,7 +273,7 @@ def _make_message_msg(self, event):

return message

def _make_sections_json(self, sections_msg):
def _make_sections_json(self, sections_msg, timestamp=None):
"""
:type msg: list of google_chat_ros.msgs/Section
:rtype json_body: list of json
Expand All @@ -277,11 +283,12 @@ def _make_sections_json(self, sections_msg):
section = {}
if msg.header:
section['header'] = msg.header
section['widgets'] = self._make_widget_markups_json(msg.widgets)
section['widgets'] = self._make_widget_markups_json(
msg.widgets, timestamp=timestamp)
json_body.append(section)
return json_body

def _make_widget_markups_json(self, widgets_msg):
def _make_widget_markups_json(self, widgets_msg, timestamp=None):
"""Make widget markup json lists.
See https://developers.google.com/chat/api/reference/rest/v1/cards#widgetmarkup for details.
:rtype widgets_msg: list of google_chat_ros.msgs/WidgetMarkup
Expand All @@ -296,7 +303,8 @@ def _make_widget_markups_json(self, widgets_msg):
buttons = []
buttons_msg = msg.buttons
for button_msg in buttons_msg:
buttons.append(self._make_button_json(button_msg))
buttons.append(
self._make_button_json(button_msg, timestamp=timestamp))
if buttons:
json_body.append({'buttons':buttons})

Expand All @@ -309,7 +317,8 @@ def _make_widget_markups_json(self, widgets_msg):
if msg.image.image_url:
image_json['imageUrl'] = msg.image.image_url
elif msg.image.localpath:
image_json['imageUrl'] = self._upload_file(msg.image.localpath)
image_json['imageUrl'] = self._upload_file(
msg.image.localpath, timestamp=timestamp)
if msg.image.on_click.action.action_method_name or msg.image.on_click.open_link_url:
image_json['onClick'] = self._make_on_click_json(msg.image.on_click)
if msg.image.aspect_ratio:
Expand All @@ -328,9 +337,12 @@ def _make_widget_markups_json(self, widgets_msg):
elif msg.key_value.original_icon_url:
keyval_json['iconUrl'] = msg.key_value.original_icon_url
elif msg.key_value.original_icon_localpath:
keyval_json['iconUrl'] = self._upload_file(msg.key_value.original_icon_localpath)
keyval_json['iconUrl'] = self._upload_file(
msg.key_value.original_icon_localpath,
timestamp=timestamp)
if msg.key_value.button.text_button_name or msg.key_value.button.image_button_name:
keyval_json['button'] = self._make_button_json(msg.key_value.button)
keyval_json['button'] = self._make_button_json(
msg.key_value.button, timestamp=timestamp)
json_body.append({'keyValue':keyval_json})
return json_body

Expand All @@ -355,7 +367,7 @@ def _make_on_click_json(self, on_click_msg):
json_body['openLink'] = {'url': on_click_msg.open_link_url}
return json_body

def _make_button_json(self, button_msg):
def _make_button_json(self, button_msg, timestamp=None):
"""Make button json.
See https://developers.google.com/chat/api/reference/rest/v1/cards#button for details.
:rtype button_msg: google_chat_ros.msg/Button.msg
Expand All @@ -379,7 +391,8 @@ def _make_button_json(self, button_msg):
elif button_msg.original_icon_url:
image_icon['iconUrl'] = button_msg.original_icon_url
elif button_msg.original_icon_filepath:
image_icon['iconUrl'] = self._upload_file(button_msg.original_icon_filepath)
image_icon['iconUrl'] = self._upload_file(
button_msg.original_icon_filepath, timestamp=timestamp)
return json_body

def _get_user_info(self, item):
Expand All @@ -394,7 +407,7 @@ def _get_user_info(self, item):
user.human = True if item.get('type') == "HUMAN" else False
return user

def _upload_file(self, filepath, return_id=False):
def _upload_file(self, filepath, return_id=False, timestamp=None):
"""Get local filepath and upload to Google Drive
:param filepath: local file's path you want to upload
:type filepath: string
Expand All @@ -410,8 +423,17 @@ def _upload_file(self, filepath, return_id=False):
rospy.logerr(e)
return
# upload
if timestamp is None:
parents_path = self.upload_parents_path
else:
parents_path = '{}/{}'.format(
self.upload_parents_path, timestamp)
try:
res = gdrive_upload(file_path=filepath)
res = gdrive_upload(
file_path=filepath,
parents_path=parents_path,
use_timestamp_folder=False,
)
except rospy.ServiceException as e:
rospy.logerr("Failed to call Google Drive upload service, status:{}".format(str(e)))
else:
Expand Down
57 changes: 42 additions & 15 deletions jsk_3rdparty/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,55 @@

<buildtool_depend>catkin</buildtool_depend>

<run_depend>bayesian_belief_networks</run_depend>
<run_depend>chaplus_ros</run_depend>
<run_depend>dialogflow_task_executive</run_depend>
<run_depend>gdrive_ros</run_depend>
<run_depend>google_chat_ros</run_depend>
<run_depend>hark_jsk_plugins</run_depend>
<run_depend>influxdb_store</run_depend>
<run_depend>jsk_database_scripts</run_depend>
<run_depend>julius_ros</run_depend>
<run_depend>opt_camera</run_depend>
<run_depend>rosping</run_depend>
<run_depend>pgm_learner</run_depend>
<run_depend>respeaker_ros</run_depend>
<run_depend>ros_google_cloud_language</run_depend>
<run_depend>ros_speech_recognition</run_depend>
<run_depend>rospatlite</run_depend>
<run_depend>nlopt</run_depend>
<run_depend>voice_text</run_depend>
<run_depend>slic</run_depend>
<run_depend>rosping</run_depend>
<run_depend>rostwitter</run_depend>
<run_depend>sesame_ros</run_depend>
<run_depend>switchbot_ros</run_depend>
<run_depend>webrtcvad_ros</run_depend>
<run_depend>zdepth_image_transport</run_depend>

<!-- 3rdparty/ dir -->
<run_depend>aques_talk</run_depend>
<run_depend>assimp_devel</run_depend>
<run_depend>crlibm</run_depend>
<run_depend>downward</run_depend>
<run_depend>ff</run_depend>
<run_depend>mini_maxwell</run_depend>
<run_depend>libcmt</run_depend>
<run_depend>libsiftfast</run_depend>
<run_depend>ffha</run_depend>
<run_depend>downward</run_depend>
<run_depend>rostwitter</run_depend>
<run_depend>bayesian_belief_networks</run_depend>
<run_depend>julius</run_depend>
<run_depend>julius_ros</run_depend>
<run_depend>sesame_ros</run_depend>
<run_depend>dialogflow_task_executive</run_depend>
<run_depend>gdrive_ros</run_depend>
<run_depend>google_cloud_texttospeech</run_depend>
<run_depend>jtalk</run_depend>
<run_depend>julius</run_depend>
<run_depend>libcmt</run_depend>
<run_depend>libsiftfast</run_depend>
<run_depend>lpg_planner</run_depend>
<run_depend>mini_maxwell</run_depend>
<run_depend>nlopt</run_depend>
<run_depend>python_twitter</run_depend>
<run_depend>python_twoauth</run_depend>
<run_depend>slic</run_depend>
<run_depend>voice_text</run_depend>
<run_depend>zdepth</run_depend>

<!-- jsk_ros_patch/ dir -->
<run_depend>collada_urdf_jsk_patch</run_depend>
<!-- <run_depend>depth_image_proc_jsk_patch</run_depend> -->
<run_depend>eecart_imped_jsk_patch</run_depend>
<run_depend>laser_filters_jsk_patch</run_depend>
<!-- <run_depend>openni_tracker_jsk_patch</run_depend> -->

<export>
<metapackage/>
Expand Down
23 changes: 21 additions & 2 deletions respeaker_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
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)
find_package(roslaunch REQUIRED)
add_rostest(test/sample_respeaker.test)
add_rostest(test/sample_respeaker.test
DEPENDENCIES ${PROJECT_NAME}_generate_virtualenv
)
roslaunch_add_file_check(launch/sample_respeaker.launch)
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 @@ -24,6 +26,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.
Loading

0 comments on commit dfa5be0

Please sign in to comment.