01 手眼标定的原理

基坐标系(base_tree)和相机(camera_tree)两个坐标系属于不同的tree,通过将标签贴到手上,相机识别出标签的positionorention,并通过easy_handeye标定包得到tool0(机械手),进一步得到相对于base的位置关系。即子坐标系(camera_rgb_optical_frame)到父坐标系(base_link)之间的关系。

在之后如果摄像头识别到物体的位置(在camera坐标系下),即可通过transform(这种转换关系),转化为base(也就是机器人知道的自己的位置坐标系)坐标系下的位置,这样机器人就通过转化关系得到相机识别到的位置实际在空间中的位置。


对于手眼标定,场景主要有以下两种,

  • eye-to-hand,眼在手外。
    这种场景下我们已知机械臂终端end_linkbase_link、相机camera_link与识别物体object_link之间的关系;
    需要求解camera_linkbase_link之间的变换。

  • eye-in-hand,眼在手上。
    这种场景base_link和机械臂各关节joint_linkend_link已经通过URDF发布了;
    只需要求解camera_linkend_link之间的变换。

02 准备工作

所用系统及硬件版本:

  • Ubuntu18.04(ROS Melodic)
  • UR3机械臂(CB3.12)
  • RealSense D435i

  • 安装ur功能包Universal_Robots_ROS_Driver驱动)
  • 安装realsense-ros

2.1 安装aruco_ros

cd ~/ur_ws/src
git clone -b melodic-devel https://github.com/pal-robotics/aruco_ros.git
cd ..
catkin_make

2.2 安装vision_visp / visp_hand2eye_calibration

cd ~/ur_ws/src
sudo apt-get install ros-melodic-visp
git clone -b melodic-devel https://github.com/lagadic/vision_visp.git
cd ..
catkin_make --pkg visp_hand2eye_calibration
catkin_make

2.3 安装easy_handeye

cd ~/ur_ws/src
git clone https://github.com/IFL-CAMP/easy_handeye
cd ..
catkin_make

03 眼在手外

3.1 修改标定 launch 文件

标定过程需启动ur3机械臂的相关节点realsense节点aruco节点easy_handeye节点,可以写一个 launch 文件同时启动上述节点,也可以分别启动。

easy_handeye 包中给出了用一个 launch 文件实现的示例,在如下的目录中:/home/guyue/ur_ws/src/easy_handeye/docs/example_launch/ur5_kinect_calibration.launch,这里只有ur5+kinect的,ur3+realsense的修改即可。

ur5_kinect_calibration.launch基础上进行修改: