手眼标定 示例

更新时间:2023-07-27 18:46:19 阅读: 评论:0

* This example explains how to perform the hand-eye calibration for
* a SCARA robot. In this ca, the camera is attached to the robot tool
* and the calibration object is stationary with respect to the robot. *
* Provide the description file of the calibration plate and the
* camera parameters of the previously calibrated camera
*本示例说明如何执行SCARA机器人的手眼校准。在这种情况下,照相机附接到机器人工具,校准对象相对于机器人是静止的。
*提供校准板的描述文件和以前校准的摄像机的摄像机参数CalibObjDescr := 'calibrate_hand_eye_scara_tup_01_calplate.cpd' CameraParam := [0.004938,-10379.136,4.65138e-006,4.65e-006,617.294,534.687 ,1280,1024]
dev_clo_window ()
dev_open_window_fit_size (0, 0, 1280, 1024, 640, -1, WindowHandle)
t_display_font (WindowHandle, 14, 'mono', 'true', 'fal')
dev_update_off ()
*
* Acquire calibration images and corresponding robot pos
* 获取校准图像和相应的机器人姿势
* Create a new calibration model
create_calib_data ('hand_eye_scara_moving_cam', 1, 1, CalibDataID)
create_calib_data ('hand_eye_scara_moving_cam', 1, 1, CalibDataID1)
工会选举程序
* Set the camera parameters in the calibration model
t_calib_data_cam_param (CalibDataID1, 0, 'area_scan_division', CameraParam)
t_calib_data_cam_param (CalibDataID, 0, 'area_scan_division', CameraParam)
* Set the calibration plate in the calibration model
*在校准模型中设置校准板
t_calib_data_calib_object (CalibDataID, 0, CalibObjDescr)
for Index := 1 to 10 by 1
* Read the calibration image
蛋蛋超人
read_image (CalibImage, '3d_machine_vision/handeye/scara_moving_cam_tup_01_calib _' + Index$'02')
* Read the corresponding robot po (po of the tool in the * robot ba coordinate system)
*读取相应的机器人姿势(机器人基座坐标系中的刀具姿态)
read_po
('scara_moving_cam_tup_01_tool_in_ba_po_' + Index$'02' + '.dat', ToolInBaPo)
* Set the robot po in the calibration model
交通安全第一课t_calib_data (CalibDataID, 'tool', Index, 'tool_in_ba_po', ToolInBaPo)
* Determine the po of the calibration plate in the camera
杰森威廉姆斯* coordinate system and t the po in the calibration model
*确定相机坐标系中校准板的姿态,并在校准模型中设置姿态find_calib_object (CalibImage, CalibDataID, 0, 0, Index, [], []) * Visualize
dev_display (CalibImage)
get_calib_data_obrv_po (CalibDataID, 0, 0, Index, ObjInCameraPo)
disp_caltab (WindowHandle, CalibObjDescr, CameraParam, ObjInCameraPo, 1)
disp_message (WindowHandle, 'Calibration image ' + Index + ' of 10', 'window', 12, 12, 'black', 'true')
wait_conds (0.2)
endfor
disp_continue_message (WindowHandle, 'black', 'true')
stop ()一人比划一人猜题搞笑
电脑装机模拟
*
* 2. Perform the hand-eye calibration
calibrate_hand_eye (CalibDataID, Errors)
*执行手眼校准
* Get the result of the calibration, i.e., the po of
陈皮皮的* the robot ba in the camera coordinate system
*获取校准结果,即摄像机坐标系中机器人基座的姿态
get_calib_data (CalibDataID, 'camera', 0, 'tool_in_cam_po', ToolInCamPoPre)
* Free the calibration model
clear_calib_data (CalibDataID)
* Visualize
disp_preliminary_result (WindowHandle, ToolInCamPoPre, Errors)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
*
* 3. Fix the po ambiguity
*
* When calibrating a SCARA robot, it is impossible to determine * all po parameters unambiguously. In ca of a moving
* camera, the Z translation of ObjInBaPo cannot be determined.
* Therefore, it is necessary to fix the unknown translation in
* Z by moving the robot to a po of known height in the camera
* coordinate system. Becau normally the camera does not e * the object if the tool is moved to the object, the robot is
* moved to two pos. For this, the calibration plate is placed
* at an arbitrary position. The robot is then manually moved such * that the camera can obrve the calibration plate. Now, an image
* of the calibration plate is acquired and the robot po is
* queried (-> ToolInBaPoRef1). From the image, the po of the
* calibration plate in the camera coordinate system can be
* determined (-> ObjInCamPoRef1). Afterwards, the tool of the * robot is manually moved to the origin of the calibration plate
* (-> ToolInBaPoRef2). The three pos and the result of the
* calibration (ToolInCamPoPre) can be ud to fix the
* Z ambiguity by using the procedure fix_scara_ambiguity_moving_cam:
*校准SCARA机器人时,无法明确地确定所有姿态参数。在移动摄像机的情况下,不能确定ObjInBaPo的Z平移。
*因此,需要通过在机器人坐标系中将机器人移动到已知高度的姿势来固定Z中的未知翻译。因为通常情况下,
*如果将工具移动到物体上,相机不会看到物体,则机器人将移动到两个姿势。为此,校准板被放置在任意位置。
*然后手动移动机器人,使得相机可以观察校准板。现在,获取校
准板的图像,
*并查询机器人姿势(- > ToolInBaPoRef1)。从图像中可以确定摄像机坐标系中校准板的姿态
*(- > ObjInCamPoRef1)。然后,将机器人的工具手动移动到校准板的原点
*(- > ToolInBaPoRef2)。这三个姿势和校准结果(ToolInCamPoPre)
*可用于通过使用过程fix_scara_ambiguity_moving_cam来修复Z 模糊性:
read_image (ImageRef1, '3d_machine_vision/handeye/scara_moving_cam_tup_01_calib _ref_1')
get_calib_plate_po (ImageRef1, CameraParam, CalibObjDescr, ObjInCamPoRef1)
read_po
真情作文600字('scara_moving_cam_tup_01_tool_in_ba_po_ref_1.dat', ToolInBaPoRef1)
read_po
('scara_moving_cam_tup_01_tool_in_ba_po_ref_2.dat', ToolInBaPoRef2)
fix_scara_ambiguity_moving_cam (ToolInCamPoPre, ObjInCamPoRef1, ToolInBaPoRef1, ToolInBaPoRef2, ZCorrection)
t_origin_po (ToolInCamPoPre, 0, 0, ZCorrection,

本文发布于:2023-07-27 18:46:19,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1099020.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:校准   机器人   坐标系
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图