操作过程如下:
mkdir -p ~/Desktop/catkin_project/catkin_04/src
cd ~/Desktop/catkin_project/catkin_04/src
git clone https://github.com/ros-industrial/universal_robot.git
cd ..
catkin_make
source devel/setup.bash
roslaunch ur_gazebo ur10.launch
最后启动Gazebo出现如下的警告:
[ WARN] [1515161906.841343613, 0.156000000]: Deprecated syntax, please prepend 'hardware_interface/' to 'PositionJointInterface' within the <hardwareInterface> tag in joint 'shoulder_pan_joint'.
[ WARN] [1515161906.842791658, 0.156000000]: Deprecated syntax, please prepend 'hardware_interface/' to 'PositionJointInterface' within the <hardwareInterface> tag in joint 'shoulder_lift_joint'.
[ WARN] [1515161906.843854506, 0.156000000]: Deprecated syntax, please prepend 'hardware_interface/' to 'PositionJointInterface' within the <hardwareInterface> tag in joint 'elbow_joint'.
[ WARN] [1515161906.844811837, 0.156000000]: Deprecated syntax, please prepend 'hardware_interface/' to 'PositionJointInterface' within the <hardwareInterface> tag in joint 'wrist_1_joint'.
[ WARN] [1515161906.845638764, 0.156000000]: Deprecated syntax, please prepend 'hardware_interface/' to 'PositionJointInterface' within the <hardwareInterface> tag in joint 'wrist_2_joint'.
[ WARN] [1515161906.846605148, 0.156000000]: Deprecated syntax, please prepend 'hardware_interface/' to 'PositionJointInterface' within the <hardwareInterface> tag in joint 'wrist_3_joint'.
我们根据警告的提示,我们找到ur_description/urdf/ur.transmission.xacro文件中的如下标签:
<joint name="${prefix}shoulder_pan_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}shoulder_lift_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}elbow_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}wrist_1_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}wrist_2_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}wrist_3_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
分别改为如下的形式:
<joint name="${prefix}shoulder_pan_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}shoulder_lift_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}elbow_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}wrist_1_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}wrist_2_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
<joint name="${prefix}wrist_3_joint">
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
</joint>
最后运行:
roslaunch ur_gazebo ur10.launch
警告消失,问题解决.