机器人开发实践源码编译报错问题解决方法

  • 书中提到,如果将源码包 ros_exploring 直接放到 catkin 工作空间中,需要将 ros2 文件夹移出到工作空间之外,否则编译失败。

  • 将 ros2 文件夹移出之后仍然报错,具体信息如下:

Could not find the required component ‘ecto’. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by “ecto” with any of
the following names:
ectoConfig.cmake
ecto-config.cmake

Add the installation prefix of “ecto” to CMAKE_PREFIX_PATH or set
“ecto_DIR” to a directory containing one of the above files. If “ecto”
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
ros_exploring-master/robot_perception/ork_tutorials/CMakeLists.txt:4 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/qinpeiwang/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/qinpeiwang/catkin_ws/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

出错原因为缺少 ecto 这个包,使用如下命令安装再重新编译即可解决问题:

$ sudo apt-get install ros-kinetic-ecto 

同理,若缺少 manipulation-msgs 包则如下命令安装:

$ sudo apt install ros-kinetic-manipulation-msgs 

gazebo_ros_control 包:

$ sudo apt install ros-kinetic-gazebo-ros-control

  • 缺少链接库报错:

/usr/bin/ld: cannot find -lmsc
collect2: error: ld returned 1 exit status

解决方法:参考书中207页说明,将科大讯飞的SDK库文件拷贝到系统目录下:

注:先进入库文件所在文件夹 ros_exploring/robot_perception/robot_voice/libs/x64(32位系统最后选择x86文件夹) 再执行如下命令

$ sudo cp libmsc.so /usr/lib/libmsc.so
  • 权限错误

/home/jyk/catkin_ws/build/ros_exploring/ros_advanced/dynamic_tutorials/setup_custom_pythonpath.sh: 5:exec: /home/jyk/catkin_ws/src/ros_exploring/ros_advanced/dynamic_tutorials/cfg/Tutorials.cfg: Permission denied
ros_exploring/ros_advanced/dynamic_tutorials/CMakeFiles/dynamic_tutorials_gencfg.dir/build.make:63: recipe for target ‘/home/jyk/catkin_ws/devel/include/dynamic_tutorials/TutorialsConfig.h’ failed

进入 ros_exploring/ros_advanced/dynamic_tutorials/cfg 文件夹,执行如下命令:

$ chmod +x Tutorials.cfg
  • pocketsphinx 语音包安装报错:

ImportError: No module named pygst

错误原因为缺少 python-gst 依赖,执行如下命令即可解决问题:

  $ sudo apt install python-gst0.10

你可能感兴趣的:(ROS)