From c3a1b342efe195af9b71de2264762a23a6c2c65d 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 | 6 ++++++ 2 files changed, 8 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 24716ecea..f52955098 100644 --- a/3rdparty/voice_text/src/voice_text.cpp.in +++ b/3rdparty/voice_text/src/voice_text.cpp.in @@ -74,7 +74,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);