ROS学习总结-《Effective Robotics Programming with ROS, Third Edition》

ROS学习总结


本文以《Effective Robotics Programming with ROS, Third Edition》为学习教材,总结在学习过程中的报错现象及解决办法。

报错1:文件“example4”已存在
报错提示
报错原因:因为生成的执行文件重名

CMake Error add_executable cannot create target "example4" because another target with the same name already exists.

解决办法:修改CMakeLists.txt,修改.c文件
发现chapter2_tutorials和chapter3_tutorials的src中都有example4.cpp文件,选择其一对文件进行修改,并修改对应的CMakeLists.txt中的内容。

报错2:缺少moveit_simple_graspsConfig.cmake文件

错误原因:工程目录中缺少moveit_simple_grasps的功能包
编译文件缺失
解决办法
方法一:
安装ros-kinetic-simple-grasping功能包,在工程src下安装moveit_simple_grasps
安装simple-grasping并不能实现完全成功编译,必须通过github将moveit_simple_grasps放入src文件夹中才能使得后续编译成功。
解决办法引用自ROSWiki,缺少moveit_simple_graspsConfig.cmake文件
指令窗口输入:

git clone https://github.com/davetcoleman/moveit_simple_grasps.git

方法二:
使用方法一会产生功能包依赖问题,moveit_simple_grasps功能包会需要moveit_visual_tools来实现其中的部分功能,但是不能直接使用

sudo apt-get install ros-kinetic-moveit-visual-tools

来进行依赖添加,因为moveit_simple_grasps属于老版功能包,需要对应版本的moveit_visual_tools来实现其功能。
使用moveit_simple_grasps可以使用simple_grasping功能包来验证(该方法对最后可执行效果有待验证)

报错3:未定义的引用函数
对‘cv::VideoCapture::~‘未定义的引用
报错原因:需要增加OpenCV功能包的依赖

解决办法
在package.xml文件中添加对opencv的依赖(根据安装的OpenCV版本添加即可)

<depend>OpenCV</depend>

在cmakelists.txt文件中的find_package中添加OpenCV包即可

find_package(catkin REQUIRED COMPONENTS OpenCV)

语句结构范例

报错4:未找到OpenCV功能包
未定义OpenCV文件位置
解决办法:在CMakeLists.txt中添加OpenCV的文件路径
一般需要先使用locate对文件进行定位

set(OpenCV_DIR /opt/ros/kinetic/share/OpenCV-3.3.1-dev/)

报错5:fatal error: moveit_visual_tools/visual_tools.h: 没有那个文件或目录
在这里插入图片描述
报错6:OpenCV版本不同导致调用函数库报错
未找到对应的函数声明
E: 文件 list 第 1 行的记录格式有误 /etc/apt/sources.list.d/ros-latest.list (Component)

执行sudo apt-get update出现错误:

E: 文件 list 第 1 行的记录格式有误 /etc/apt/sources.list.d/ros-latest.list (Component)
E: 无法读取源列表。

解决办法:

sudo rm /etc/apt/sources.list.d/ros-latest.list
Effective Robotics Programming with ROS - Third Edition English | 27 Dec. 2016 | ISBN: 1786463652 | 468 Pages | AZW3/MOBI/EPUB/PDF (conv) | 59.11 MB Find out everything you need to know to build powerful robots with the most up-to-date ROS About This Book This comprehensive, yet easy-to-follow guide will help you find your way through the ROS framework Successfully design and simulate your 3D robot model and use powerful robotics algorithms and tools to program and set up your robots with an unparalleled experience by using the exciting new features from Robot Kinetic Use the latest version of gazebo simulator, OpenCV 3.0, and C++11 standard for your own algorithms Who This Book Is For This book is suitable for an ROS beginner as well as an experienced ROS roboticist or ROS user or developer who is curious to learn ROS Kinetic and its features to make an autonomous Robot. The book is also suitable for those who want to integrate sensors and embedded systems with other software and tools using ROS as a framework. What You Will Learn Understand the concepts of ROS, the command-line tools, visualization GUIs, and how to debug ROS Connect robot sensors and actuators to ROS Obtain and analyze data from cameras and 3D sensors Use Gazebo for robot/sensor and environment simulation Design a robot and see how to make it map the environment, navigate autonomously, and manipulate objects in the environment using MoveIt! Add vision capabilities to the robot using OpenCV 3.0 Add 3D perception capabilities to the robot using the latest version of PCL In Detail Building and programming a robot can be cumbersome and time-consuming, but not when you have the right collection of tools, libraries, and more importantly expert collaboration. ROS enables collaborative software development and offers an unmatched simulated environment that simplifies the entire robot building process. This book is packed with hands-on examples that will help you program your robot and give you complete solutions using open source ROS libraries and tools. It also shows you how to use virtual machines and Docker containers to simplify the installation of Ubuntu and the ROS framework, so you can start working in an isolated and control environment without changing your regular computer setup. It starts with the installation and basic concepts, then continues with more complex modules available in ROS such as sensors and actuators integration (drivers), navigation and mapping (so you can create an autonomous mobile robot), manipulation, Computer Vision, perception in 3D with PCL, and more. By the end of the book, you'll be able to leverage all the ROS Kinetic features to build a fully fledged robot for all your needs. Style and approach This book is packed with hands-on examples that will help you program your robot and give you complete solutions using ROS open source libraries and tools. All the robotics concepts and modules are explained and multiple examples are provided so that you can understand them easily.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值