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 Jan 5, 2022
1 parent 8bad4f6 commit cabde28
Show file tree
Hide file tree
Showing 2 changed files with 9 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
7 changes: 7 additions & 0 deletions 3rdparty/voice_text/src/voice_text.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cabde28

Please sign in to comment.