本文章参考博主光头明明的博客进行实现。但是由于明明版本为 kinetic + Gazebo7,实现时存在很多问题不好解决,因此通过此文章记录解决方法。
参考博主链接:
问题一:
报错: Built target tf_example In file included from /home/r418/catkin_ws/src/ur5-gazebo-grasping/ur5-gazebo-grasping/gazebo_grasp_plugin/src/GazeboGraspFix.cpp:9:0: /home/r418/catkin_ws/src/ur5-gazebo-grasping/ur5-gazebo-grasping/gazebo_grasp_plugin/include/gazebo_grasp_plugin/GazeboGraspFix.h:156:38: error: ‘math’ was not declared in this scope bool checkGrip(const std::vector<math::Vector3>& forces, float minAngleDiff, float lengthRatio)
解决方法:
用melodic版本包替换,链接如下
https://github.com/ros-simulation/gazebo_ros_pkgs
问题二:
event::Events::DisconnectWorldUpdateBegin 没有
原因:程序调用的时Gazebo7中的 API,而gazebo9中的函数已经改写,有的函数不存在。
解决方法:
在ROS官网搜roboticsgroup_gazebo_plugins可以找打Gazebo>=8的版本,下载替换掉原来的文件即可。
直接用下面这个链接下载,替换掉之前的文件即可
https://github.com/LCAS/roboticsgroup_gazebo_plugins/blob/master/src/mimic_joint_plugin.cpp
到此处,编译全部成功!
问题三:报错如下
roslaunch ur5_single_arm_tufts ur5_single_arm_gazebo.launch
原因: handeye/src下的文件和 catkin_ws/src下的UR描述文件重复,去掉前者即可
未完待续。。。