Robot eye system based on RGB-D camera and self-calibration method thereof
Technical Field
The invention relates to the technical field of robots, in particular to a robot eye system based on an RGB-D camera and a self-calibration method thereof
Background
Against the background of the project "china manufacturing 2025", the china industry is increasingly demanding flexible production lines and intelligent robots. An important means for making a robot intelligent is to give the robot the ability to see using machine vision. Machine vision refers to acquiring image information of an environment through a vision sensor, so that a machine has a function of visual perception. Through machine vision, the robot can identify the object and determine the position of the object.
The motion coordinate system of the robot and the coordinate system of the camera are combined through 'hand-eye calibration', wherein the end effector of the robot can be regarded as a hand of a person, and the vision sensor can be regarded as an eye of the person. The eye-in-hand system of the robot is generally divided into two types, namely eye-in-hand (eye-in-hand) and eye-to-hand (eye-to-hand), wherein the eye-in-hand system fixes the vision sensor on the robot end effector and can move along with the robot end, and the eye-to-hand system fixes the vision sensor in the environment and does not move along with the robot end. The former tends to have higher flexibility and also allows the robot to act with higher precision.
The traditional robot eye system adopts high-precision markers such as cubes or checkerboards, angular points are extracted from an image, the relative position from a camera to the markers is calculated in a projective geometric mode, meanwhile, the position of the tail end of the robot is recorded, and the relative pose between the tail end of the robot and the camera is calculated through multiple groups of data obtained through multiple shooting. However, the method needs a high-precision marker, and often needs off-line calibration, which greatly limits the application range of the calibration method.
Therefore, those skilled in the art are dedicated to develop a robot eye-hand system based on RGB-D camera and a self-calibration method thereof, which do not need special markers, and only need a certain spatial complexity of the environment around the robot, so that the off-line or on-line calibration of the eye-hand system can be performed through algorithm calculation.
Disclosure of Invention
In view of the above defects in the prior art, the technical problem to be solved by the present invention is to overcome the disadvantage that the prior art needs a high-precision marker, and limits the application range of the conventional calibration method, and to solve the problem that the conventional calibration method only can perform offline calibration because the high-precision marker needs to be used.
In order to achieve the purpose, the invention provides a robot eye system self-calibration method based on an RGB-D camera, which comprises the following steps:
s1, driving an RGB-D camera installed at the tail end of the robot to move through the robot, acquiring a series of surrounding environment depth maps, and recording pose information of the robot at the same moment;
step S2, performing three-dimensional reconstruction on the shot scene by using a series of continuous depth maps, thereby obtaining the camera pose when each depth map is shot;
step S3, combining the camera pose and the robot pose at the same moment into a data pair, and combining any two groups of data pairs at different moments to form a constraint equation about the relative poses of the tail end and the camera of the robot;
s4, combining the poses at all times in pairs to construct a large equation set related to the relative poses of the tail end of the robot and the camera;
and S5, solving the equation set by adopting a Tsai-Lenz algorithm to obtain the relative pose of the robot tail end and the camera.
The invention also provides a robot hand-eye system based on the RGB-D camera, which comprises a robot, a workbench, a robot base, a rigid connecting piece, the RGB-D camera and a robot end effector; the robot base is arranged on the workbench; the robot is arranged on the robot base; the rigid connecting piece is arranged at the tail end of the robot; the RGB-D camera is arranged on the rigid connecting piece; the robot end effector is disposed on the rigid link.
Further, the acquiring of the robot pose and the depth map of the RGB-D camera at the same time is triggered by hardware or software to acquire a frame of image by the RGB-D camera, and the robot pose is acquired by a socket or a robot API.
Furthermore, the three-dimensional reconstruction of the shot scene according to a series of continuous depth maps is to fuse the multi-frame depth maps through a TSDF Volume model, perform three-dimensional reconstruction of the scene and estimate the RGB-D camera pose corresponding to each depth map.
Further, the two groups of data pairs at different time instants are combined to form a constraint equation about the relative pose of the robot end and the camera, the data at two time instants are randomly selected from the continuous multi-time data to be combined, and the established constraint equation is the most basic pose matrix transformation without other prior assumptions.
Further, the equation set is solved through the Tsai-Lenz method to obtain the relative pose of the robot end and the camera, the rotation and translation parts of a relative transformation matrix between the robot end and the camera are separately solved, the change of the pose is represented by using a Rodrigue parameter, a rotation vector is firstly solved, and then a rotation matrix is solved.
Further, the RGB-D camera position is set as the origin of the reference coordinate system in the step S1, and the direction matrix is a unit matrix.
Further, in the moving process of the robot, the following formula is satisfied between any two poses:
wherein subscript g represents robot end coordinate system, c represents camera coordinate system, i, j represent recorded pose sequence numbers, such as: and c _ i represents a camera coordinate system in the poses recorded in the ith group, and Hcjci represents the transformation of the spatial midpoint from the coordinates in the camera coordinate system in the i pose to the coordinates in the camera coordinate system in the j pose.
Further, the robot base is rigidly connected with the workbench, the RGB-D camera is rigidly connected with the robot end effector, and the robot can carry the RGB-D camera and the end effector to move together.
Further, the table is all environmental information around the vision sensor including the table top.
Compared with the prior art, the robot eye calibration method does not need to use special markers, has simple algorithm, can be used for online calibration, and greatly improves the robot eye calibration efficiency.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Drawings
FIG. 1 is a schematic diagram of a hand-eye calibration basic model according to a preferred embodiment of the present invention;
fig. 2 is a schematic structural diagram of a hand-eye calibration system according to a preferred embodiment of the invention.
Detailed Description
The technical contents of the preferred embodiments of the present invention will be more clearly and easily understood by referring to the drawings attached to the specification. The present invention may be embodied in many different forms of embodiments and the scope of the invention is not limited to the embodiments set forth herein.
In the drawings, structurally identical elements are represented by like reference numerals, and structurally or functionally similar elements are represented by like reference numerals throughout the several views. The size and thickness of each component shown in the drawings are arbitrarily illustrated, and the present invention is not limited to the size and thickness of each component. The thickness of the components may be exaggerated where appropriate in the figures to improve clarity.
The invention adopts the following technical scheme:
the RGB-D camera is fixed to the robot end effector so that the RGB-D camera can move with the robot end and keep the connection between the two rigid and free of relative movement. The robot is operated to move and depth map data of the environment surrounding the robot is acquired by a depth sensor. And performing real-time three-dimensional reconstruction on the environment around the robot by taking the posture of the camera when the first depth map is acquired as a reference coordinate system, and simultaneously recording the posture of the robot when the depth map data is acquired each time.
The pose of the camera relative to the reference coordinate system when the depth map is acquired each time can be estimated while the environment around the robot is reconstructed.
For this form of robotic eye system, the basic model is shown in fig. 1.
In the moving process of the robot, the following formula is satisfied between any two poses:
wherein subscript g represents robot end coordinate system, c represents camera coordinate system, i, j represent recorded pose sequence numbers, such as: c. CiCoordinate system of camera in pose representing ith group of records, HcjciThe representation transforms the spatial midpoint from coordinates in the camera coordinate system at i pose to coordinates in the camera coordinate system at j pose. Since the relative position between the robot tip and the camera is fixed, the robot is moved to the second positionThis HgcThe subscripts i, j are omitted. Let A be Hgjgi,B=Hgjgi,X=HgcThen equation (1) can be simplified as:
AX=XB (2)
splitting the above formula, and writing into a block matrix in the form of:
wherein R and t are the rotation and translation components in the transformation matrix, respectively, and comparing the two sides of the equation can yield the equation set:
for the solution of equation set (5), the present invention employs a Tsai two-step solution, commonly referred to as the Tsai-Lenz method, which is one of the most widely used robotic eye calibration methods.
As shown in fig. 2, the robot hand-eye self-calibration method of the present invention includes: the robot comprises a robot base 1, a robot 2, a rigid connecting device 3 of the tail end of the robot and a vision sensor, a robot tail end executor 4 which is an executing mechanism for the robot to execute specific tasks, an RGB-D vision sensor 5 and a workbench environment 6, wherein the workbench environment referred to in the patent is all environment information around the vision sensor including a workbench surface.
(1) The robot 2 is operated to return it to its initial position so that the main part of the worktop environment 6 is within the field of view of the RGB-D camera 5. The camera position at this time is set as the origin of the reference coordinate system, and the direction matrix is a unit matrix. Initializing a working space of visual reconstruction, wherein a reconstruction model adopted by the invention is a TSDF (round Signed Distance function) model.
(2) Operating the robot 2 edgeThe RGB-D camera 5 is driven to move along a set track (such as a Z-shaped route), a scene 6 is continuously shot in the moving process, and an obtained depth map IkAnd simultaneously recording the pose T of the tail end 4 of the robotbgk。
(3) For each obtained depth map IkAccording to Ray casting method, the data in TSDFvolume is processed according to Ik-1Projecting the pose of the moment to obtain I'k-1Calculating I 'by ICP algorithm'k-1And IkRelative pose T therebetweenck,ck-1. Therefore, the pose of the camera at the time k is
(4) Camera pose T according to time kckDepth map IkAnd projecting the three-dimensional space, and then fusing the three-dimensional space into the TSDF Volume according to the definition mode of the TSDF model.
(5) A series of camera poses T can be obtained according to the 2-4 step line circulationckAnd corresponding robot end pose TbgkAnd (4) data. Grouping two of them, e.g. a set of data consisting of time i and time j data, should
(6) Assuming that a total of N data for each position is obtained, N x (N-1)/2 sets of data can be obtained, wherein each set of data can be listed as an equation of the form shown in equation (7). These N x (N-1)/2 equations constitute a large system of equations.
(7) After a plurality of groups of data are obtained, solving is carried out on the equation set according to a Tsai-Lenz method, and finally the relative pose T between the camera and the tail end of the robot is obtainedgc。
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.