01 安装过程
- 1/ 下载robotiq功能包
cd ur_ws/src git clone https://github.com/ros-industrial/robotiq.git
- 2/ 修改ur3的描述文件
-
首先,参考robotiq功能包中有关力传感器的部分
cd ~/ur_ws/src/robotiq/robotiq_ft_sensor/urdf gedit robotiq_ft300.urdf.xacro
在
robotiq_ft300.urdf.xacro
中有一段信息描述了怎样将sensor添加到机械臂的末端:<!-- Macro function to instanciate URDF model of the FT300 force-torque sensor with mounting plate Example use: ``` // Import this macro function <xacro:include filename="$(find robotiq_ft_sensor)/urdf/robotiq_ft300.urdf.xacro" /> // Instanciate sensor instance and connect it to robot flange <xacro:robotiq_ft300 parent="robot_flange_link" prefix=""> <origin xyz="0 0 0" rpy="0 0 0"/> </xacro:robotiq_ft300> ``` -->
-
接下来,我们将按照上面所描述的信息,添加到ur3的描述文件中
❤ 打开ur3的描述文件
ur3.urdf.xacro
cd ~/ur_ws/src/fmauch_universal_robot/ur_description/urdf gedit ur3.xacro
在
ur3.xacro
中,添加如下语句<xacro:include filename="$(find robotiq_ft_sensor)/urdf/robotiq_ft300.urdf.xacro" />
效果如图:
❤打开ur3的描述文件
ur3_macro.xacro
cd ~/ur_ws/src/fmauch_universal_robot/ur_description/urdf/inc gedit ur3_macro.xacro
在
ur3_macro.xacro
的末尾处,添加如下语句<xacro:robotiq_ft300 parent="${prefix}tool0" prefix=""> <origin xyz="0 0 0 " rpy="0 0 0"/> </xacro:robotiq_ft300>
效果如图:
❤一些说明:
如下图所示,在
~/ur_ws/src/fmauch_universal_robot/ur_description/urdf/inc
的ur_macro.xacro
文件中,ur机械臂暴露给最外面的link是${prefix}tool0
所以,我们只需要将ft sensor的宏定义的parent赋值为tool0即可
-
02 启动
# 启动gazebo
# 注意是ur3_bringup.launch,而不是ur3.launch
roslaunch ur_gazebo ur3_bringup.launch
# 启动move it规划
roslaunch ur3_moveit_config ur3_moveit_planning_execution.launch sim:=true
# 启动rviz
# 注意后面要给出rviz_config的地址
roslaunch ur3_moveit_config moveit_rviz.launch rviz_config:=$(rospack find ur3_moveit_config)/launch/moveit.rviz
03 报错与解决
3.1 问题1 soem
Could not find a package configuration file provided by "soem" with any of the following names:
-
参考
https://blog.csdn.net/weixin_42661884/article/details/81118724 -
解决
sudo apt-get install ros-melodic-soem
3.2 问题2
Could not find a package configuration file provided by "socketcan_interface" with any of the following names:
-
解决
sudo apt-get install ros-melodic-socketcan-interface
04 参考
下载robotiq的ros package
http://wiki.ros.org/robotiq
issues
https://github.com/ros-industrial/robotiq/issues
ScazLab的安装方法
https://scazlab.github.io/ur5e_setup_guide.html