以在线命令词识别为例:

主要步骤、易产生的错误其解决办法如下:

1、下载SDK,解压;

2、在ROS工作空间下创建一个Package;

   catkin_create_pkg xfei_asr roscpp rospy std_msgs
3、将SDK文件夹中的头文件,即下载的SDK文件夹中include文件夹下的 .h文件拷贝至xfei_asr/include/下;

4、将SDK文件夹中sample/asr_sample中的asr_sample.c文件拷贝至xfei_asr/src/下;

5、将SDK文件夹中libs/x64/libmsc.so文件拷贝至xfei_asr/lib/下;

6、打开asr_sample.c文件,将#include "qish.h"等修改为:

    #include "xfei_asr/qisr.h"
    #include "xfei_asr/msp_cmn.h"
    #include "xfei_asr/msp_errors.h"

7、打开CMakelist,

    1)修改include_directories为:即包括拷贝的头文件所在的include目录

         include_directories(
                                     ${catkin_INCLUDE_DIRS}
                                     include
                                     )

    2)添加:

        add_executable(asr_sample src/asr_sample.c) # 生成可执行文件
        target_link_libraries(asr_sample ${catkin_LIBRARIES} /home/luyh/catkin_ws02/src/xfei_asr/lib/libmsc.so -ldl -pthread) # 添加链接库,其中动态链接库路径按实际修改
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐