diff --git a/3rdparty/julius/CMakeLists.txt b/3rdparty/julius/CMakeLists.txt index b23a5bdb4..d7ffa892c 100644 --- a/3rdparty/julius/CMakeLists.txt +++ b/3rdparty/julius/CMakeLists.txt @@ -24,6 +24,8 @@ add_custom_command( COMMAND make -f ${PROJECT_SOURCE_DIR}/Makefile.dictation-kit MD5SUM_DIR=${MD5SUM_DIR} PATCH_DIR=${PATCH_DIR} INSTALL_DIR=${INSTALL_DIR} ) +# on ROS-O do not download grammer_kit, dictation_kit, instead install download script +if(NOT $ENV{ROS_DISTRO} STREQUAL "debian") add_custom_target(all_installed ALL DEPENDS julius_installed grammar_kit_installed dictation_kit_installed) install(DIRECTORY @@ -36,3 +38,16 @@ install(DIRECTORY ${INSTALL_DIR}/model DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS) +else() +install(PROGRAMS + download_julius_data.sh + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) +install(FILES + Makefile.grammar-kit + Makefile.dictation-kit + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) +install(FILES + md5sum/dictation-kit-v4.4.zip.md5sum + md5sum/grammar-kit-v4.3.1.tar.gz.md5sum + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/md5sum) +endif() diff --git a/3rdparty/julius/download_julius_data.sh b/3rdparty/julius/download_julius_data.sh new file mode 100755 index 000000000..bbfb507cd --- /dev/null +++ b/3rdparty/julius/download_julius_data.sh @@ -0,0 +1,11 @@ +#!/bin/bash -xe + +SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +MD5SUM_DIR=${SCRIPT_DIR}/md5sum +INSTALL_DIR=$(rospack find julius) + +DIR=$(mktemp -d /tmp/julius-XXXX) +cd $DIR +make -f ${SCRIPT_DIR}/Makefile.dictation-kit MD5SUM_DIR=${MD5SUM_DIR} INSTALL_DIR=${INSTALL_DIR} +make -f ${SCRIPT_DIR}/Makefile.grammar-kit MD5SUM_DIR=${MD5SUM_DIR} INSTALL_DIR=${INSTALL_DIR} +rm -fr $DIR diff --git a/julius_ros/scripts/run_julius.sh b/julius_ros/scripts/run_julius.sh index 665378c8f..33badb396 100755 --- a/julius_ros/scripts/run_julius.sh +++ b/julius_ros/scripts/run_julius.sh @@ -13,4 +13,12 @@ for OPT in "$@"; do esac done -exec rosrun julius julius $ARGS +if [ "$ROS_DISTRO" = "debian" ]; then + if ! test -e $(rospack find julius)/conf -a -e $(rospack find julius)/model; then + echo "julius need install grammer and dictation kit, run 'rosrun julius download_julius_data.sh'" + exit 1 + fi + exec julius $ARGS +else + exec rosrun julius julius $ARGS +fi