主要难点是编译清错
在document文件夹中打开终端,输入
git clone https://github.com/JenniferBuehler/gazebo-pkgs.git
cd gazebo-pkgs/gazebo_world_plugin_loader
mkdir build
cd build
cmake ..
make
退回到gazebo-pkgs目录,再进入gazebo_version_helpers文件夹,输入
mkdir build
cd build
cmake ..
make
编译gazebo_test_tools时发生
-- Could NOT find object_msgs (missing: object_msgs_DIR)
-- Could not find the required component 'object_msgs'. 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/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "object_msgs" with
any of the following names:
object_msgsConfig.cmake
object_msgs-config.cmake
Add the installation prefix of "object_msgs" to CMAKE_PREFIX_PATH or set
"object_msgs_DIR" to a directory containing one of the above files. If
"object_msgs" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_test_tools/build/CMakeFiles/CMakeOutput.log".
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_test_tools/build/CMakeFiles/CMakeError.log".
编译gazebo_state_plugins 时发生
CMake Error at /home/hyh/catkin_ws/devel/share/gazebo_world_plugin_loader/cmake/gazebo_world_plugin_loaderConfig.cmake:113 (message):
Project 'gazebo_world_plugin_loader' specifies
'/home/hyh/catkin_ws/src/gazebo-pkgs/gazebo_world_plugin_loader/include' as
an include dir, which is not found. It does neither exist as an absolute
directory nor in
'/home/hyh/catkin_ws/src/gazebo-pkgs/gazebo_world_plugin_loader//home/hyh/catkin_ws/src/gazebo-pkgs/gazebo_world_plugin_loader/include'.
Report the problem to the maintainer 'Jennifer Buehler
<jennifer.e.buehler@gmail.com>' and request to fix the problem.
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_state_plugins/build/CMakeFiles/CMakeOutput.log".
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_state_plugins/build/CMakeFiles/CMakeError.log".
编译gazebo_grasp_plugin_ros时发生
-- Could NOT find gazebo_grasp_plugin (missing: gazebo_grasp_plugin_DIR)
-- Could not find the required component 'gazebo_grasp_plugin'. 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/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
"gazebo_grasp_plugin" with any of the following names:
gazebo_grasp_pluginConfig.cmake
gazebo_grasp_plugin-config.cmake
Add the installation prefix of "gazebo_grasp_plugin" to CMAKE_PREFIX_PATH
or set "gazebo_grasp_plugin_DIR" to a directory containing one of the above
files. If "gazebo_grasp_plugin" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:5 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_grasp_plugin_ros/build/CMakeFiles/CMakeOutput.log".
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_grasp_plugin_ros/build/CMakeFiles/CMakeError.log".
编译gazebo_grasp_plugin时发生
CMake Error at /home/hyh/catkin_ws/devel/share/gazebo_version_helpers/cmake/gazebo_version_helpersConfig.cmake:113 (message):
Project 'gazebo_version_helpers' specifies
'/home/hyh/catkin_ws/src/gazebo-pkgs/gazebo_version_helpers/include' as an
include dir, which is not found. It does neither exist as an absolute
directory nor in
'/home/hyh/catkin_ws/src/gazebo-pkgs/gazebo_version_helpers//home/hyh/catkin_ws/src/gazebo-pkgs/gazebo_version_helpers/include'.
Report the problem to the maintainer 'jenny <jenny@todo.todo>' and request
to fix the problem.
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_grasp_plugin/build/CMakeFiles/CMakeOutput.log".
See also "/home/hyh/Documents/gazebo-pkgs/gazebo_grasp_plugin/build/CMakeFiles/CMakeError.log".
解决方法:
在新的catkin_ make工作区,把gazebo-pkgs里的gazebo_grasp_plugin,gazebo_grasp_plugin_ros,gazebo_version_helpers,gazebo_world_plugin_loader,以及.git 文件包复制到src目录下,然后把gazebo-pkgs删掉,
回到新工作区进入终端catkin_make ,
此时还会有一些warning
解决方法是找到对应CMakeLists.txt文件,把DEPENDS后小写的gazebo改成大写GAZEBO。
其他几个插件包的CMakeLists都同样的方法改,改完后catkin_make,
然后把build文件夹里的gazebo_grasp_plugin包复制到devel/include文件目录下,再次编译。
在bigmama0310_test.urdf末尾添上如下gazebo插件标签:
1. <gazebo>
2. <plugin name="gazebo_grasp_fix" filename="libgazebo_grasp_fix.so">
3. <arm>
4. <arm_name>arm_bigmama</arm_name>
5. <palm_link>Link_4</palm_link>
6. <gripper_link>Link_forwardsucker</gripper_link>
7. <gripper_link>Link_innersucker</gripper_link>
8. <gripper_link>Link_extersucker</gripper_link>
9. </arm>
10. <forces_angle_tolerance>10</forces_angle_tolerance>
11. <update_rate>130</update_rate>
12. <grip_count_threshold>2</grip_count_threshold>
13. <max_grip_count>8</max_grip_count>
14. <release_tolerance>0.01</release_tolerance>
15. <disable_collisions_on_attach>true</disable_collisions_on_attach>
16. <contact_topic>__default_topic__</contact_topic>
17. </plugin>
18. </gazebo>
插一嘴,plugin标签上面的gazebo标签是用来添加摩擦系数的,具体如下:
1. <gazebo reference="Link_forwardsucker">
2. <material>Gazebo/Yellow</material>
3. <mu1>100</mu1>
4. <mu2>100</mu2>
5. <fdir1>1 0 0</fdir1>
6. </gazebo>
7. <gazebo reference="Link_innersucker">
8. <material>Gazebo/Yellow</material>
9. <mu1>100</mu1>
10. <mu2>100</mu2>
11. <fdir1>1 0 0</fdir1>
12. </gazebo>
13. <gazebo reference="Link_extersucker">
14. <material>Gazebo/Yellow</material>
15. <mu1>100</mu1>
16. <mu2>100</mu2>
17. <fdir1>1 0 0</fdir1>
18. </gazebo>
19. <gazebo reference="Link_0">
20. <material>Gazebo/Green</material>
21. <mu1>0.9</mu1>
22. <mu2>0.9</mu2>
23. <fdir1>1 0 0</fdir1>
</gazebo>
回到工作空间,检查urdf,demo_gazebo.launch,gazebo.launch,world,py文件是否配齐且建立正确的指向关系。最终roslaunch,绿色字段显示插件加载成功。
配置完成,具体参数定义和使用方法请移步总有一天全城的人都要高看我们大佬的《Gazebo插件Grasp_fix介绍与踩坑(识别不到物体,抓取时掉落)》Gazebo插件Grasp_fix介绍与踩坑(识别不到物体,抓取时掉落)_gazebo grasp fix-CSDN博客文章浏览阅读2.8k次,点赞11次,收藏64次。Gazebo插件Grasp_fix介绍0.踩的坑1.Grasp_fix插件下载2.插件介绍一、如何使用二、各参数含义0.踩的坑在抓物体时,可能物体很小,只能用夹爪的前端的尖尖去抓,这样这个插件是很难检测到的,比如我一开始的这个物体就太薄了,不管怎么样设置插件的参数都抓不起来直到后来我换成了圆柱,突然发现能识别到物体了,才意识到物体的厚度问题,后来把这个长方体厚度加大,成功抓起来了可以考虑适当增加物体的厚度,也就是让物体的更多部分和夹爪发生接触,这样能够更容易检测到物体,才能抓起来。1.Gras_gazebo grasp fixhttps://blog.csdn.net/qq_44642372/article/details/124119100