一、实验设备
UR5机械臂
Realsense d435
Ubuntu18.04(ros melodic)
二、功能包
realsenseSDK2.0
realsense-ros
ddynamic_reconfigure
Universal_Robots_ROS_Driver
fmauch_universal_robot
aruco_ros
vision_visp
easy_handeye
三、ur5通讯连接
1、网络连接修改为桥接模式
2、开启ur5并用网线连接电脑,手动设置ip地址
3、设置ur5自身网络
设置机器人-网络-ip地址
4、ur设置External Control网络
机器人编程-加载程序-打开externalcontrol.urp-安装设置-External control-设置ip地址、端口
5、确认连接状况
ctrl+alt+t打开终端
ping 192.168.56.101
连接成功
四、手眼标定
1、准备标定板
打印好之后就固定在机械臂末端
2、编写launch文件
easy_handeye 包中给出了用一个 launch 文件实现的示例,在如下的目录中:easy_handeye/docs/example_launch/ur5_kinect_calibration.launch,这里只有ur5+kinect的,ur5+realsense的修改即可。
修改后的launch文件放在easy_handeye/easy_handeye/launch/eye_to_hand_calibration.launch目录下。
修改launch文件如下:
<launch>
<arg name="namespace_prefix" default="ur5_realsense_handeyecalibration" />
<arg name="robot_ip" doc="The IP address of the UR5 robot" />
<arg name="marker_size" doc="Size of the ArUco marker used, in meters" default="0.1" />
<arg name="marker_id" doc="The ID of the ArUco marker used" default="582"/>
<!-- start the realsen435 -->
<include file="$(find realsense2_camera)/launch/rs_camera.launch" >
</include>
<!-- 2. start ArUco -->
<node name="aruco_tracker" pkg="aruco_ros" type="single">
<remap from="/camera_info" to="/camera/color/camera_info" />
<remap from="/image" to="/camera/color/image_raw" />
<param name="image_is_rectified" value="true"/>
<param name="marker_size" value="$(arg marker_size)"/>
<param name="marker_id" value="$(arg marker_id)"/>
<param name="reference_frame" value="camera_color_optical_frame"/>
<param name="camera_frame" value="camera_color_optical_frame"/>
<param name="marker_frame" value="camera_marker" />
</node>
<!-- start the robot -->
<include file="$(find ur_robot_driver)/launch/ur5_bringup.launch">
<arg name="robot_ip" value="192.168.56.101" />
<arg name="kinematics_config" value="$(find example_organization_ur_launch)/etc/ur5_calibration.yaml" />
</include>
<include file="$(find ur5_moveit_config)/launch/ur5_moveit_planning_execution.launch">
</include>
<!-- 4. start easy_handeye -->
<include file="$(find easy_handeye)/launch/calibrate.launch" >
<arg name="namespace_prefix" value="$(arg namespace_prefix)" />
<arg name="eye_on_hand" value="false" />
<arg name="tracking_base_frame" value="camera_link" />
<arg name="tracking_marker_frame" value="camera_marker" />
<arg name="robot_base_frame" value="base" />
<arg name="robot_effector_frame" value="tool0" />
<arg name="freehand_robot_movement" value="false" />
<arg name="robot_velocity_scaling" value="0.5" />
<arg name="robot_acceleration_scaling" value="0.2" />
</include>
</launch>
3、手眼标定过程
1)运行launch文件
ctrl+alt+t打开终端
cd catkin_ws_ur
source devel/setup.bash
打开四个标签页,依次启动这几个launch文件(前面三个launch可以不启动,直接运行最后一个然后启动示教器,因为前面三个在我们最后一个的launch文件里面会依次打开,)
① 启动realsense
roslaunch realsense2_camera rs_camera.launch
② 启动ur机械臂
a.启动机械臂
roslaunch ur_robot_driver ur5_bringup.launch robot_ip:=192.168.56.101 limited:=true
b.启动示教器
c.启动moveit
roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch limited:=true
③ 启动手眼标定的其他程序
roslaunch easy_handeye eye_to_hand_calibration.launch