问题:
执行指令:
roslaunch cartographer_ros cartographer_demo_rplidar.launch
报错:
RLException: [cartographer_demo_rplidar.launch] is neither a launch file in package [cartographer_ros] nor is [cartographer_ros] a launch file name
The traceback for the exception was written to the log file
解决:
首先试图回到catkin_ws文件夹目录下终端重新编译工作变量:
catkin_make
报错:
CMake Error at /opt/ros/melodic/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.
看报错是缺少ecto,试图下载sudo apt-get install ros-melodic-ecto,但是因为版本是melodic,不能这样下载。参考了这篇https://blog.csdn.net/ckkboy/article/details/99584987安装ecto:
先回到src文件夹:cd src,克隆代码:
git clone http://github.com/plasmodic/ecto.git
但是我这边网络不太好,于是就直接去GitHub上面下载、解压,然后复制放到src文件夹里面。完成之后继续catkin_make,又有包缺失,继续在GitHub上面下载。。。很多包缺失,重复这个操作。直到一个名为moveit-ros-perception缺失,报错如下:
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
"moveit_ros_perception" with any of the following names:
moveit_ros_perceptionConfig.cmake
moveit_ros_perception-config.cmake
Add the installation prefix of "moveit_ros_perception" to CMAKE_PREFIX_PATH
or set "moveit_ros_perception_DIR" to a directory containing one of the
above files. If "moveit_ros_perception" provides a separate development
package or SDK, be sure it has been installed.
好像和其他包报错一样,但是没有这个包资源下载。执行指令:
sudo apt-get install ros-melodic-moveit-ros-perception
然后catkin_make,继续报错,但是报错变了:(一大段报错,红色部分:)
fatal error: boost/tr1/unordered_map.hpp: 没有那个文件或目录
#include <boost/tr1/unordered_map.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
参考https://blog.csdn.net/weixin_48120620/article/details/126681300?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522172180587716800207099371%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=172180587716800207099371&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-14-126681300-null-null.142^v100^pc_search_result_base5&utm_term=fatal%20error%3A%20boost%2Ftr1%2Funordered_map.hpp%3A%20%E6%B2%A1%E6%9C%89%E9%82%A3%E4%B8%AA%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95%20%20%23include%20%3Cboost%2Ftr1%2Funordered_map.hpp%3E&spm=1018.2226.3001.4187中的第9个问题:ecto的目录下使用如下命令找到这两个文件src/lib/util.cpp(#include <boost/tr1/unordered_map.hpp>)和src/lib/plasm/impl.hpp(#include <boost/tr1/unordered_map.hpp>)在里面删除对应的tr1,同时把代码里的std::tr1::unordered_map字段改成boost::unordered_map
然后catkin_make,出现了/usr/bin/ld: 找不到 -lmsc的报错
《ROS机器人开发实践》书中介绍(科大讯飞那一块207页),将科大讯飞库文件拷贝到系统目录下,进入SDK根目录下的libs文件夹,选择相应的架构平台x64/x86,使用命令拷贝。
sudo cp libmsc.so /usr/lib/libmsc.so
再次catkin_make,终于成功[100%] Built target ecto_test_ectomodule