diff --git a/speech_recognition_msgs/CMakeLists.txt b/speech_recognition_msgs/CMakeLists.txt new file mode 100644 index 0000000..3af29d0 --- /dev/null +++ b/speech_recognition_msgs/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.5) +project(speech_recognition_msgs) + +# Default to C++17 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) +endif() +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +find_package(ament_cmake REQUIRED) +find_package(rosidl_default_generators REQUIRED) +find_package(std_msgs REQUIRED) + +set(msg_files + msg/Grammar.msg + msg/PhraseRule.msg + msg/SpeechRecognitionCandidates.msg + msg/Vocabulary.msg +) + +set(srv_files + srv/SpeechRecognition.srv +) + +rosidl_generate_interfaces(${PROJECT_NAME} + ${msg_files} + ${srv_files} + DEPENDENCIES + std_msgs + ADD_LINTER_TESTS +) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_export_dependencies(rosidl_default_runtime) + +ament_package() + diff --git a/speech_recognition_msgs/msg/Grammar.msg b/speech_recognition_msgs/msg/Grammar.msg new file mode 100644 index 0000000..f81b752 --- /dev/null +++ b/speech_recognition_msgs/msg/Grammar.msg @@ -0,0 +1,5 @@ +string name # register this grammar with the name +PhraseRule[] rules + +string[] categories +Vocabulary[] vocabularies diff --git a/speech_recognition_msgs/msg/PhraseRule.msg b/speech_recognition_msgs/msg/PhraseRule.msg new file mode 100644 index 0000000..1da938b --- /dev/null +++ b/speech_recognition_msgs/msg/PhraseRule.msg @@ -0,0 +1,2 @@ +string symbol +string[] definition diff --git a/speech_recognition_msgs/msg/SpeechRecognitionCandidates.msg b/speech_recognition_msgs/msg/SpeechRecognitionCandidates.msg new file mode 100644 index 0000000..8c8dae1 --- /dev/null +++ b/speech_recognition_msgs/msg/SpeechRecognitionCandidates.msg @@ -0,0 +1,2 @@ +string[] transcript # candidate words of speech-to-text API +float32[] confidence # confidence of transcript \ No newline at end of file diff --git a/speech_recognition_msgs/msg/Vocabulary.msg b/speech_recognition_msgs/msg/Vocabulary.msg new file mode 100644 index 0000000..a2120a0 --- /dev/null +++ b/speech_recognition_msgs/msg/Vocabulary.msg @@ -0,0 +1,3 @@ +string name # register vocabulary with the name. +string[] words +string[] phonemes diff --git a/speech_recognition_msgs/package.xml b/speech_recognition_msgs/package.xml new file mode 100644 index 0000000..2a88065 --- /dev/null +++ b/speech_recognition_msgs/package.xml @@ -0,0 +1,31 @@ + + + + speech_recognition_msgs + 4.3.2 + speech_recognition_msgs + Yuki Furuta + + BSD + + http://ros.org/wiki/speech_recognition_msgs + + Yuki Furuta + + ament_cmake + +rosidl_default_generators + + std_msgs + +rosidl_default_runtime + + ament_lint_auto + ament_lint_common + +rosidl_interface_packages + + + ament_cmake + + diff --git a/speech_recognition_msgs/srv/SpeechRecognition.srv b/speech_recognition_msgs/srv/SpeechRecognition.srv new file mode 100644 index 0000000..8dec9cf --- /dev/null +++ b/speech_recognition_msgs/srv/SpeechRecognition.srv @@ -0,0 +1,9 @@ +Vocabulary vocabulary # Specify isolated words candidates to be recognized (Enabled on isolated word mode) +Grammar grammar # Or, specify grammar to be recognized +string grammar_name # Or, simply specify grammar name which is already registered on the server + +float32 duration +bool quiet +float32 threshold +--- +speech_recognition_msgs/SpeechRecognitionCandidates result