Skip to content

Commit

Permalink
Restart voice text if verification fails
Browse files Browse the repository at this point in the history
  • Loading branch information
708yamaguchi authored and knorth55 committed Apr 4, 2022
1 parent 7d289ff commit c4a3f2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 3rdparty/voice_text/launch/voice_text.launch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

<arg name="sound_play_respawn" default="true" />

<node name="voice_text" pkg="voice_text" type="voice_text" output="screen"
<node name="voice_text" pkg="voice_text" type="voice_text"
output="screen" respawn="true" respawn_delay="10"
machine="$(arg voice_text_machine)">
<remap from="text_to_speech" to="voice_text/text_to_speech" />
<rosparam>
Expand Down
6 changes: 6 additions & 0 deletions 3rdparty/voice_text/src/voice_text.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c4a3f2b

Please sign in to comment.