为ur3机械臂配置夹爪

环境为:ubuntu16.04 ros kinetic
为ur3加上robotiq 2f-85以及Robotiq FT300传感器。

roswiki资料:
http://wiki.ros.org/robotiq/Tutorials/Control%20of%20a%202-Finger%20Gripper%20using%20the%20Modbus%20RTU%20protocol%20%28ros%20kinetic%20and%20newer%20releases%29
http://wiki.ros.org/robotiq

参考:
https://blog.csdn.net/qq_34935373/article/details/117445613

参考2,串口有关。

主要参考3.

下载编译夹爪

参照github以及roswiki,到相应工作空间下:

cd ur_robot/src
git clone -b kinetic-devel  https://github.com/ros-industrial/robotiq.git

dependency:

rosdep install robotiq_modbus_tcp
sudo apt-get install ros-kinetic-soem

连接真实夹爪时注意:
Note that Robotiq devices that use the USB serial port will appear as /dev/ttyUSBn devices in your system (where “n” is a number that depends on the number of USB devices that are plugged in the computer) and require read and write permissions to work properly. One way to permanently ensure you have such permissions is simply to add your user to the dialout group once:

sudo usermod -a -G dialout $USER
或者
(sudo chmod 777 /dev/ttyS4)根据实际情况

这个时候source一下然后看一下模型:

roslaunch robotiq_2f_85_gripper_visualization test_2f_85_model.launch

警报:
The ‘use_gui’ parameter was specified, which is deprecated. We’ll attempt to find and run the GUI, but if this fails you should install the ‘joint_state_publisher_gui’ package instead and run that. This backwards compatibility option will be removed in Noetic.
这里可以不管。也可以参考上述网站。

注意,这个时候src下应该又ur机械臂的功能包以及robotiq的功能包。
可以根据自己需要删去不需要的包。

开始连接

创建新功能包ur_robotiq_description,导入依赖包: urdf、xacro、gazebo_ros、gazebo_ros_control、gazebo_plugins
在功能包下新建urdf,cfg,launch等文件夹。
新建ur3_robotiq.xacro

<?xml version="1.0"?>
<robot name="ur_robotiq.xacro" xmlns:xacro="http://wiki.ros.org/xacro">

<!-- ur3 -->
  <xacro:include filename="$(find ur_description)/urdf/ur3_robot.urdf.xacro" />
<!-- robotiq_2f_85 -->
  <xacro:include filename="$(find robotiq_2f_85_gripper_visualization)/urdf/robotiq_arg2f_85_model.xacro" />  
<!-- robotiq_ft300 -->
 <xacro:include filename="$(find robotiq_ft_sensor)/urdf/robotiq_ft300.urdf.xacro" />  
<!-- connect ur3 and robotiq_2f_85 -->
 <xacro:robotiq_ft300 prefix="" parent="tool0" >
	<origin xyz="0 0 0" rpy="0 0 0"/> 
</xacro:robotiq_ft300>


<joint name="ft_gripper_joint" type="fixed">
    <parent link="robotiq_ft_frame_id"/>
    <child link="robotiq_arg2f_base_link"/>
    <origin xyz="0 0 0" rpy="0 0 0"/>
  </joint>

</robot>  

新建view_robot.launch

<?xml version="1.0" ?>

<launch>
  <arg name="gui" default="True" />
  <param name="use_gui" value="$(arg gui)"/>
  
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find ur_robotiq_description)/urdf/ur_robotiq.xacro'" />  
  
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find ur_robotiq_description)/cfg/visualize.rviz" required="true" />
</launch>

source一下,catkin_make 以及roslaunch上述文件,可以看到生成的模型,如果没出现记得在rviz设置add —— robot model,以及选择based link 为fixed link。


注:
后面根据ur官方包进行了修改整理,采用了up load 的launch文件方式。
并添加了limited joints的版本。

使用moveit setup assistant

后面为目前的模型添加moveit setup assistant,参考了:
https://blog.csdn.net/harrycomeon/article/details/107073020
https://guyuehome.com/22221
1 为环境添加kinect v2
找到了两个关于kinect v2的包,我使用了pr2 description中的sensors部分。
https://github.com/pr2/pr2_common
还有一个是有人上传的:
https://github.com/wangxian4423/kinect_v2_udrf
注意在这里我下载玩pr2的包后编译报错,缺少相关依赖,逐个下载:

sudo apt-get install ros-kinetic-convex-decomposition
sudo apt-get install ros-kinetic-ivcon

2 之后参考
https://www.guyuehome.com/5531
这里我为自己的模型设置了一个grasping frame,位置就在两个夹爪中间。

3 这里写一下我遇到的问题

Interactive marker ‘EE:goal_ee_link’ contains unnormalized
quaternions.

这里我查找了:
https://blog.csdn.net/m0_54720387/article/details/122293508
可以忽略,但是我的end effector末端拖拽的交互记球不显示,这里不知道为什么。并且从上面参考的结果页面中也没看到相关的交互记号。
之后发现该交互记号在机械臂的末端,太小被爪子部分遮住了。
planning request
planning group
interactive marker size

[ERROR] [1648713388.349079727]: Group ‘gripper’ is not a chain [ERROR]
[1648

这里我从moveit配置group中就看到爪子部分只有一个joint是能进行运动规划的,而我在配置group时将整个爪子都包含了进去,导致一直不成功。
参考:
https://www.baidu.com/link?url=NMUggcPRX14HOvootU5MQw-Q-bxqBXAvAewvHgsD_6pW2H3UEWVgWWJWkt3gNIksIAGm4kHmUE_htDslseIHIHhQ3A0qRyyBm-WOriQRmqm&wd=&eqid=a536334100028c9000000005624570eb
并且上面一开始的参考中该group也只是配置了一个joint

demo.launch

配置完setup后,直接使用自动生成的demo.launch
可以正常显示

gazebo

在现在版本的setup assistant的界面中自动生成了在gazebo中仿真的相关的xacro文件,可以复制粘贴直接使用。
该文件以及帮你自动生成了transmission等配置。

问题

从上面github中得到的robotiq的urdf文件导入到gazebo中部分零部件显示有问题。爪子部分有残缺,然而在rviz中是显示正常的。
我试着将一个个部件单独拿出来分别在rviz以及gazebo中显示,发现爪子base link以及ft 300传感器等link是在gazebo显示不正常的。
从xacro中文件差找,发现robotiq中手爪每个零部件都是由单独的dat或者stl引出的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值