ROS中使用catkin_make报错的解决

文章讲述了作者在使用catkin_make编译过程中遇到的PCL包找不到的问题,以及后续的网络连接、PCL安装、rviz工具使用和FileZilla文件传输中的问题。最后解决了网络配置问题并实现了文件互传。
摘要由CSDN通过智能技术生成

catkin_make编译报错:

过了一段时间打开虚拟机,编译cmake文件报错,提示找不到PCL包

尝试各种解决方法仍没有解决,原因未知。

CMake Error at grid_path_searcher/CMakeLists.txt:12 (find_package):
  By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "PCL", but
  CMake did not find one.

  Could not find a package configuration file provided by "PCL" with any of
  the following names:

    PCLConfig.cmake
    pcl-config.cmake

  Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR"
  to a directory containing one of the above files.  If "PCL" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/home/dsy/my/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/dsy/my/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:1370: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed


解决:

在发现虚拟机断网并重新设置网络后,发现~/catkin_ws下catkin_make可以编译成功,而 ~/my/catkin_ws编译仍然出错,报错提示如上,原因未知:

首先安装PCL:
参考:Ubuntu20.04纯命令配置PCL(点云库)

sudo apt-get update
sudo apt-get install libpcl-dev
sudo apt-get install libpcl-dev pcl-tools

重新运行catkin_make命令,在编译到42%时报错:

/home/dsy/my/hw_2/src/grid_path_searcher/src/random_complex_generator.cpp:3:10: fatal error: pcl_conversions/pcl_conversions.h: 没有那个文件或目录
 #include <pcl_conversions/pcl_conversions.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
grid_path_searcher/CMakeFiles/random_complex.dir/build.make:62: recipe for target 'grid_path_searcher/CMakeFiles/random_complex.dir/src/random_complex_generator.cpp.o' failed
make[2]: *** [grid_path_searcher/CMakeFiles/random_complex.dir/src/random_complex_generator.cpp.o] Error 1
CMakeFiles/Makefile2:467: recipe for target 'grid_path_searcher/CMakeFiles/random_complex.dir/all' failed
make[1]: *** [grid_path_searcher/CMakeFiles/random_complex.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
CMakeFiles/Makefile2:1624: recipe for target 'grid_path_searcher/CMakeFiles/demo_node.dir/all' failed
make[1]: *** [grid_path_searcher/CMakeFiles/demo_node.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

安装ros-melodic-pcl-conversions
参考:PCL报错:pcl/conversions.h: 没有那个文件或目录

删除build和devel文件,重新编译,编译成功!


年前没有解决的原因:在install pcl时失败,但是当时并不知道网络没有连接,导致后序操作都没有解决。


按照下列命令操作,运行我们的launch文件

#进入工作空间
cd catkin_ws/
#进入src
cd src
#编译初始化
catkin_init_workspace
#回到上一目录
cd ..
#编译
catkin_make
#将工作空间路径添加到ros
source devel/setup.bash

#rviz使用

#先启动ros
roscore
#启动rviz
rviz
#在rviz中添加demo.rviz
#启动程序,导入地图
roslaunch grid_path_searcher demo.launch


之后使用3DGoal设定target点时报错,之前也遇到过这个问题,记录使用source可以解决,本次操作发现source之后仍然报错。

The class required for this tool, 'rviz_plugins/Goal3DTool', could not be loaded.
Error:
According to the loaded plugin descriptions the class rviz_plugins/Goal3DTool with base class type rviz::Tool does not exist. Declared types are rviz/FocusCamera rviz/Interact rviz/Measure rviz/MoveCamera rviz/PublishPoint rviz/Select rviz/SetGoal rviz/SetInitialPose rviz_plugin_tutorials/PlantFlag

解决啦!打开rviz需要在相同工作目录下才可以!!这也是为什么曾经记录source之后就可以使用3DGoal插件!!


FileZilla连接站点出错:

后来当使用FileZilla将虚拟机文件传输至主机时,站点连接失败

通过建立新站点,更改协议类型、主机ip等信息后仍连接失败,原因未知。


解决:

后来在虚拟机中使用浏览器发现网络连接有误:

解决:
Ubuntu-18.04版本网络配置,连接网络的方法 未解决。
三分钟完成虚拟机联网 小白看了都说好!!! 虚拟机超详细联网教程/步骤 SDN软件定义网络实验 成功联网。
再根据使用Filezilla与虚拟机实现文件互传的方法方法建立站点成功连接虚拟机和主机,实现文件互传。

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值