Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some basic functionality for synchronized speech and behavior #14

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d930ee5
first stab at dialogue production
eshort Jul 28, 2017
a9816a3
removing temporary files
eshort Jul 28, 2017
274aa6d
improving documentation
Jul 30, 2017
3f31212
added some states
eshort Jul 31, 2017
93195f3
Merge branch 'speech_production' of github.com:HLP-R/hlpr_speech into…
eshort Jul 31, 2017
75fd6d7
added debug option and updated documentation
eshort Jul 31, 2017
644944f
added cordial submodule (I hope)
eshort Jul 31, 2017
ab2c1fd
Update gitmodules to point to branch
eshort Jul 31, 2017
3c22d7f
fixing some imports that got commented out
eshort Aug 2, 2017
bd0fa8b
updates to dialogue files
eshort Aug 3, 2017
c653f85
trying to get cordial working with Travis
Aug 6, 2017
31de509
fixing dependencies
Aug 6, 2017
8bee89c
fixing dependencies
Aug 6, 2017
c5f565c
joint position based gesture control commented out in various places;…
eshort Feb 12, 2018
a3ed3d4
Merge branch 'speech_production' of github.com:HLP-R/hlpr_speech into…
eshort Feb 12, 2018
bee505e
Fixed include path for hlpr_lookat action
Kukanani Feb 12, 2018
e52be59
Added command line and roslaunch arguments to control functionality
Kukanani Feb 12, 2018
f916444
Fixed keyframe specification
Kukanani Feb 13, 2018
415e58d
Text to speech using AWS
asaran May 18, 2018
ff22810
Visemes for speech production (experimental, unsupported)
maxsvetlik Sep 5, 2018
7872585
Old changes made by Elaine
Dec 7, 2018
ffae88a
tmp file creation to play audio in pygame
asaran Apr 19, 2019
2438bb8
Text to speech tested and working
asaran Apr 26, 2019
3afac13
Merge branch 'speech_production' of github.com:HLP-R/hlpr_speech into…
asaran Apr 26, 2019
640ec08
AWS text to speech
asaran Apr 26, 2019
91fd12a
speech interruption functions added
Apr 26, 2019
f6ffc79
separating file name and directory path as different arguments
Apr 26, 2019
c0e7818
Reorganizing meta info from AWS
asaran May 17, 2019
bbb960e
fixed compatibility w/ dialogue production
May 17, 2019
6992e56
fixed gnarly indentation
May 17, 2019
e2ee0fb
adding support for polly tags
asaran May 17, 2019
0ce3dd9
cleanup to actually work
May 17, 2019
ce0e2c2
cleanup
asaran May 17, 2019
6b73997
tts working on lupe, need to check on moe
May 17, 2019
43cad31
Changes by Elaine on moe
Aug 2, 2019
c095141
resolved merge conflicts on moe
Aug 2, 2019
4843f21
data folders
asaran Aug 2, 2019
687bffc
Merge branch 'speech_production' of github.com:HLP-R/hlpr_speech into…
asaran Aug 2, 2019
0c6e256
Google Speech API usage for speech2text
asaran Aug 2, 2019
f106974
Fix queue import
Aug 9, 2019
f66c6b0
Example of how to say "Lupe" properly
Sep 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.pyc
*.swp
hlpr_dialogue_production/data/*
hlpr_speech_synthesis/src/hlpr_speech_synthesis/data/*
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ install:
before_script:
# source dependencies: install using wstool.
- cd ~/catkin_ws/src
- git clone -b catkin git://github.com/interaction-lab/cordial-public.git
- wstool init
- if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
- wstool up
Expand Down
194 changes: 194 additions & 0 deletions hlpr_dialogue_production/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
cmake_minimum_required(VERSION 2.8.3)
project(hlpr_dialogue_production)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
rospy
smach
smach_ros
control_msgs
actionlib
actionlib_msgs
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

# add_service_files(
# FILES
# LookAt.srv
# LookAtT.srv
# LookAtTS.srv
# )

## Generate actions in the 'action' folder
add_action_files(
FILES
DialogueAct.action
Gesture.action
Viseme.action
)

# Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
geometry_msgs
actionlib_msgs
std_msgs
)

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES hlpr_lookat
# CATKIN_DEPENDS rospy
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(hlpr_lookat
# src/${PROJECT_NAME}/hlpr_lookat.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(hlpr_lookat ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
# add_executable(hlpr_lookat_node src/hlpr_lookat_node.cpp)

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(hlpr_lookat_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(hlpr_lookat_node
# ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS hlpr_lookat hlpr_lookat_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_hlpr_lookat.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
27 changes: 27 additions & 0 deletions hlpr_dialogue_production/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2017, Elaine Short
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of contingency nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 4 additions & 0 deletions hlpr_dialogue_production/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Contingency Detection Package

This package detects contingency in behaviors.

7 changes: 7 additions & 0 deletions hlpr_dialogue_production/action/DialogueAct.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
string text_or_key
string audio_file
string behavior_yaml
---
string outcome
---
string[] active_states
5 changes: 5 additions & 0 deletions hlpr_dialogue_production/action/Gesture.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
string[] poses
---
bool success
---
string current_pose
5 changes: 5 additions & 0 deletions hlpr_dialogue_production/action/Viseme.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
string viseme
---
bool success
---
string current_pose
32 changes: 32 additions & 0 deletions hlpr_dialogue_production/docs/hlpr_dialogue_production.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
HLPR Dialogue Production
=========================

Controllers
-----------
.. automodule:: controllers
:members:

Dialogue
---------
.. automodule:: dialogue

.. autoclass:: Synchronizer
:members: __init__, start, reset

.. autoclass:: ControllerState
:members: __init__, setup_sync

.. autoclass:: TTSSpeechStart
:members: __init__

.. autoclass:: TTSFallbackSpeechStart
:members: __init__

.. autoclass:: FileSpeechStart
:members: __init__

.. autoclass:: NoPrepSpeechStart
:members: __init__

.. autoclass:: SpeechState
:members: __init__
19 changes: 19 additions & 0 deletions hlpr_dialogue_production/launch/all_controllers.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<launch>
<arg name="debug" default="false"/>
<arg name="gesture" default="false"/>
<arg name="visemes" default="true"/>
<arg name="voice" default="Justin"/>

<node name="test_beep_controller" pkg="hlpr_dialogue_production" type="test_action_server.py"/>
<node name="soundplay_node" pkg="sound_play" type="soundplay_node.py"/>
<node if="$(arg gesture)" name="gesture_controller" pkg="hlpr_dialogue_production" type="gesture_action_server.py"/>
<node if="$(arg visemes)" name="viseme_controller" pkg="hlpr_dialogue_production" type="viseme_action_server.py" output="screen"/>
<group unless="$(arg debug)">
<!-- NOTE: can also pass -p to this command, not currently supported in the launch file.
TODO(kukanani): add ROS parameter system so that -t, -p, -d can be passed independently without needing launch file hijinx -->
<node name="hlpr_dialogue" pkg="hlpr_dialogue_production" type="standalone_server.py" args="-t -v $(arg voice)" output="screen"/>
</group>
<node if="$(arg debug)"
name="hlpr_dialogue" pkg="hlpr_dialogue_production" type="standalone_server.py" args="-d" output="screen"/>
</launch>
62 changes: 62 additions & 0 deletions hlpr_dialogue_production/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0"?>
<package>
<name>hlpr_dialogue_production</name>
<version>0.0.0</version>
<description>Speech production with simultaneous behavior for HLP-R robot.</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="[email protected]">Jane Doe</maintainer> -->
<maintainer email="[email protected]">Elaine Short</maintainer>


<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>BSD</license>


<!-- Url tags are optional, but mutiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/hlpr_lookat</url> -->


<!-- Author tags are optional, mutiple are allowed, one per tag -->
<!-- Authors do not have to be maintianers, but could be -->
<!-- Example: -->
<!-- <author email="[email protected]">Jane Doe</author> -->


<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>cordial_tts</build_depend>
<build_depend>hlpr_manipulation_utils</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>control_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>rospy</run_depend>
<run_depend>actionlib</run_depend>
<run_depend>actionlib_msgs</run_depend>
<run_depend>smach</run_depend>
<run_depend>smach_ros</run_depend>
<run_depend>hlpr_manipulation_utils</run_depend>
<run_depend>cordial_tts</run_depend>


<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->

</export>
</package>
12 changes: 12 additions & 0 deletions hlpr_dialogue_production/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['hlpr_dialogue_production'],
package_dir={'': 'src'},
)

setup(**setup_args)
5 changes: 5 additions & 0 deletions hlpr_dialogue_production/speech/gen_phrases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

mkdir audio_data
rosrun cordial_tts gen_phrases.py -o phrases.yaml -d ./audio_data -v Kendra script.txt
oggdec audio_data/*.ogg
Loading