在Gazebo 9 里 仿真robotiq 2f85 gripper

  • 环境
  • Mimic 插件
  • 修改transmission文件
  • 添加PID参数
  • 配置launch文件
  • 结果
  • 参考

环境

系统: Ubuntu 18.04
ROS 版本: Melodic

最近在使用Universial robot (UR5e) 和 robotiq 2f85 gripper做一个项目。其中, 要用到Gazebo 仿真。 Robotiq 官方提供了 2f85 gripper的URDF 文件, 但是不支持Gazebo仿真。 要想顺利使用的话需要做一些修改。

Mimic 插件

2f85 gripper有一个主动关节(finger joint)和四个被动关节(mimic joint). 标准Gazebo不支持Mimic 关节仿真, 所以需要安装一个插件。
插件的Github地址是 https://github.com/roboticsgroup/roboticsgroup_gazebo_plugins。
下载到功能包的src文件夹下编译即可。 记得source环境变量。

修改transmission文件

下载Robotiq 的官方github库后, 找到robotiq_2f_85_gripper_visualization/urdf/robotiq_arg2f_transmission.xacro文件。修改为:

<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro"><xacro:macro name="robotiq_arg2f_transmission" params="prefix"><transmission name="${prefix}finger_joint_trans"><type>transmission_interface/SimpleTransmission</type><joint name="${prefix}finger_joint"><hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface></joint><actuator name="${prefix}finger_joint_motor"><mechanicalReduction>1</mechanicalReduction></actuator></transmission><gazebo><!-- loading plugin: mimic joints works in gazebo now--><plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_85_4"><joint>${prefix}finger_joint</joint><mimicJoint>${prefix}right_outer_knuckle_joint</mimicJoint><multiplier>1.0</multiplier></plugin><plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_85_2"><joint>${prefix}finger_joint</joint><mimicJoint>${prefix}left_inner_finger_joint</mimicJoint><multiplier>-1.0</multiplier><!--<offset>0.0</offset>--></plugin><plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_85_1"><joint>${prefix}finger_joint</joint><mimicJoint>${prefix}right_inner_finger_joint</mimicJoint><multiplier>-1.0</multiplier></plugin><plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_85_3"><joint>${prefix}finger_joint</joint><mimicJoint>${prefix}left_inner_knuckle_joint</mimicJoint><multiplier>1.0</multiplier></plugin><plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_85_5"><joint>${prefix}finger_joint</joint><mimicJoint>${prefix}right_inner_knuckle_joint</mimicJoint><multiplier>1.0</multiplier></plugin></gazebo></xacro:macro></robot>

(因为UR5e的gazebo仿真文件里已经有了ros_control插件, 所以不需要单独添加ros_control插件。要是只仿真gripper的话还需要添加如下代码:
<gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotNamespace>/</robotNamespace> <legacyModeNS>true</legacyModeNS> </plugin> </gazebo>

添加PID参数

上面文件只能在gazebo中显示gripper, 要想控制它, 需要为它设置PID 参数。在robotiq_2f_85_gripper_visualization/config文件夹下创建 gazebo_controller.yaml文件:

# Note: You MUST load these PID parameters for all joints that are using the
# PositionJointInterface, otherwise the arm + gripper will act like a giant
# parachute, counteracting gravity, and causing some of the wheels to lose
# contact with the ground, so the robot won't be able to properly navigate. See
# https://github.com/ros-simulation/gazebo_ros_pkgs/issues/612
gazebo_ros_control:pid_gains:# these gains are used by the gazebo_ros_control pluginfinger_joint:p: 20.0i: 0.1d: 0.0i_clamp: 0.2antiwindup: falsepublish_state: true# the following gains are used by the gazebo_mimic_joint pluginleft_inner_knuckle_joint:p: 20.0i: 0.1d: 0.0i_clamp: 0.2antiwindup: falsepublish_state: trueleft_inner_finger_joint:p: 20.0i: 0.1d: 0.0i_clamp: 0.2antiwindup: falsepublish_state: trueright_outer_knuckle_joint:p: 20.0i: 0.1d: 0.0i_clamp: 0.2antiwindup: falsepublish_state: trueright_inner_knuckle_joint:p: 20.0i: 0.1d: 0.0i_clamp: 0.2antiwindup: falsepublish_state: trueright_inner_finger_joint:p: 20.0i: 0.1d: 0.0i_clamp: 0.2antiwindup: falsepublish_state: true

然后创建gripper_controller_robotiq.yaml文件:

gripper_controller:type: position_controllers/JointTrajectoryControllerjoints:- finger_jointconstraints:goal_time: 0.6stopped_velocity_tolerance: 0.05finger_joint: {trajectory: 0.01, goal: 0.01}stop_trajectory_duration: 0.5state_publish_rate:  25action_monitor_rate: 10

创建joint_state_controller.yaml文件:

joint_state_controller:type: joint_state_controller/JointStateControllerpublish_rate: 50

配置launch文件

robotiq_2f_85_gripper_visualization/launch文件夹下创建gripper_gazebo.launch文件:

<?xml version="1.0" ?><launch><param name="robot_description" command="$(find xacro)/xacro --inorder $(find robotiq_2f_85_gripper_visualization)/urdf/robotiq_arg2f_85_model.xacro" /><!-- Load gazebo controller configurations --><!-- Note: You MUST load these PID parameters for all joints that are usingthe PositionJointInterface, otherwise the arm + gripper will act like agiant parachute, counteracting gravity, and causing some of the wheelsto lose contact with the ground, so the robot won't be able to properlynavigate. Seehttps://github.com/ros-simulation/gazebo_ros_pkgs/issues/612 --><rosparam file="$(find robotiq_2f_85_gripper_visualization)/config/gazebo_controller.yaml" command="load" /><!-- Gazebo --><include file="$(find gazebo_ros)/launch/empty_world.launch"><arg name="paused" value="false" /></include><!-- Spawn the robot into Gazebo --><node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot -x 0 -y 0 -z 0.1" /><!-- Load ros_control controller configurations --><rosparam file="$(find robotiq_2f_85_gripper_visualization)/config/joint_state_controller.yaml" command="load" /><rosparam file="$(find robotiq_2f_85_gripper_visualization)/config/gripper_controller_robotiq.yaml" command="load" /><!-- Start the controllers --><node name="controller_spawner" pkg="controller_manager" type="spawner" output="screen" ns="/" args="joint_state_controller gripper_controller"/><!-- Robot state publisher --><node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen" /></launch>

然后编译添加环境变量, 用roslaunch robotiq_2f_85_gripper_visualization gripper_gazebo.launch命令就行了。

结果


后面会介绍如何在gazebo中仿真gripper和UR5e机械臂,先放上视频。

gazebo.mp4

参考

  1. https://www.codenong.com/cs106268506/

在Gazebo 9 里 仿真robotiq 2f85 gripper相关推荐

  1. PROBOT_G603双臂GAZEBO+MoveIt!仿真中配置手眼相机和夹爪

    PROBOT_G603双臂GAZEBO+MoveIt!仿真中配置手眼相机和夹爪 问题描述 安装双臂模型 修改urdf文件 Gripper文件修改 Gripper添加到机械臂上 配置MoveIt! 配置 ...

  2. Ubuntu18.04配置搭建基于Gazebo的虚拟仿真平台(Px4):无人机(UAV)、无人车等模拟实验平台

    这篇我觉得是写得比较详细完整的 摘自:https://dgzc.ganahe.top/ganahe/2021/uavgazebomoni.html Ubuntu18.04配置搭建基于Gazebo的虚拟 ...

  3. 使用MATLAB绘制Gazebo中的仿真小车的运动轨迹

       虽然,Gazebo中自带了绘图工具,当需要绘制一些简单的图像时,非常的方便,但是当需要绘制复杂的图像时,还是MATLAB更加合适一些.    当我们仅仅使用MATLAB以可视化图像的形式去观察G ...

  4. gazebo添加模型仿真

    gazebo添加模型仿真 gazebo添加模型 添加模型颜色和纹理 gazebo添加模型 1.将模型文件夹放到~/.gazebo/models文件夹下(ctrl+h显示隐藏文件夹). 2.再打开Gaz ...

  5. ubuntu20系统+RobotiQ 2F-85夹爪+Ros+VMware配置

    文章目录 环境说明 Ros配置 Vmware虚拟机串口通信配置 运行节点并调试 有关问题解决办法 rosdep相关 缺少ros有关的库 与pymodbus相关 参考 环境说明 环境 说明 系统版本 U ...

  6. Moveit + Gazebo:搭建双臂仿真平台(方案一)

    环境ubuntu20.04 ROS-noetic 国内少有搭建Moveit和Gazebo联合仿真的教程,对于搭建双臂等复杂的仿真平台更是鲜有资料,因此想要把自己的见解分享出来供大家参考,共同提高. 本 ...

  7. ROS学习记录(二)阿克曼转向车运动学模型及在gazebo中搭建仿真环境

    前言:该篇是ROS学习记录的第二篇,如果还没关注过之前文章的读者,如有需要可以通过下方传送门去看之前的文章: ROS学习记录(一) Plugin插件 这两天关注了古月老师的公众号,看到了其中一篇课程推 ...

  8. realsense D435i gazebo slam(px4)仿真(转载)

    转载自:https://blog.csdn.net/weixin_41469272/article/details/117919845?utm_medium=distribute.pc_relevan ...

  9. Gazebo结合ROS仿真时,如何编写机器人的URDF

    译者的话:在用Gazebo做仿真应用时,您想用ROS控制机器人,又想让机器人既能在Gazebo中运行,又能在Rviz中运行,您需要用URDF描述机器人,而不是SDF.原因是Rviz的标配是URDF, ...

最新文章

  1. 一个好的java博客
  2. c语言数组怎么环形阵列,C语言 用于大阵列的无复制线程安全环形缓冲区
  3. 手机信号放大器 让手机信号增强的办法
  4. ConcurrentHashMap 源码分析
  5. OpenShift 4之评估节点自消耗的系统资源
  6. 执行计划有时不准确_高效学习计划的制定原则和分类执行方法
  7. 前端面试知识点归纳:vue,react,webpack,bable,项目开发
  8. 期许伟大-基于CMMI的过程改进之道探索
  9. java案例代码18--算法-选择排序以及二分查找排序
  10. 数据库审计系统(启明设备)
  11. 小白的网站seo经验
  12. 750ti显卡能支持服务器吗,《守望先锋》显卡实测:750Ti降服全特效
  13. 《裸辞后,降薪找工作》
  14. Office Tool Plus 下载使用 365 2021/2019等版本
  15. 第三方支付机构和非银行支付机构的区别?第三方支付客户备付金介绍
  16. 关于开机USB电涌15秒关机的另类解决方法
  17. Mac + Docker + Clickhouse + Dbeaver 套装
  18. 【Android】TypedArray——三个方法获取dimen返回值的类型
  19. FCFS进程调度算法
  20. Python爬虫编程11——JS反爬

热门文章

  1. Apache-mina学习笔记,非常全都资料,附带大量实例
  2. ramps1.4介绍及4988常见问题总结
  3. 跳频通信系统 matlab,毕业设计:基于MATLAB快跳频的通信系统仿真
  4. sencha-touch.js MIUI Android 8.0兼容性问题
  5. odoo 附件上传与下载
  6. linux服务器网络编程之线程模型
  7. 基于后端开发Redisson实现分布式锁源码分析解读
  8. ROS学习笔记52--rosbag图片从compressed格式转raw格式代码实现接口介绍
  9. 查看UOS系统+华为海思麒麟CPU笔记本的相关信息
  10. Vue修炼系列教程 - 元婴篇2