From cabde28fb1a1d445d7ad1adc34954802fef977f0 Mon Sep 17 00:00:00 2001 From: Naoya Yamaguchi <708yamaguchi@gmail.com> Date: Thu, 16 Dec 2021 13:47:04 +0900 Subject: [PATCH] Restart voice text if verification fails --- 3rdparty/voice_text/launch/voice_text.launch | 3 ++- 3rdparty/voice_text/src/voice_text.cpp.in | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/3rdparty/voice_text/launch/voice_text.launch b/3rdparty/voice_text/launch/voice_text.launch index 8e12b5ba4..95e7d781f 100644 --- a/3rdparty/voice_text/launch/voice_text.launch +++ b/3rdparty/voice_text/launch/voice_text.launch @@ -9,7 +9,8 @@ - diff --git a/3rdparty/voice_text/src/voice_text.cpp.in b/3rdparty/voice_text/src/voice_text.cpp.in index 1022e3d15..372bb5bfa 100644 --- a/3rdparty/voice_text/src/voice_text.cpp.in +++ b/3rdparty/voice_text/src/voice_text.cpp.in @@ -94,6 +94,13 @@ public: } return false; } + VT_GetTTSInfo_JPN(VT_VERIFY_CODE, NULL, &ret, sizeof(int)); + if (ret != 0) { + ROS_FATAL_STREAM("Verification failed (VT_VERIFY_CODE " << ret << ")"); + return false; + } + + // Print voice text info char szTmp[PATH_MAX]; char szTmp2[PATH_MAX]; VT_GetTTSInfo_JPN(VT_BUILD_DATE, NULL, szTmp, PATH_MAX);