Disclosure of Invention
In order to solve the technical problems, the invention aims to: the space registration method and system for the robot and the image equipment are provided, and particularly, the space registration of the robot and the image or image equipment can be realized conveniently, quickly, reliably, accurately and at low cost in the process of performing the operation or assisting the operation by the robot.
The technical scheme of the invention is as follows:
a space registration calibration method for a robot and an imaging device comprises the following steps:
s01: installing a first measuring object on a robot, and determining the pose of the first measuring object relative to the robot, wherein the first measuring object is an object with a cylindrical surface;
s02: placing at least three second measuring objects within the working range of the robot, the second measuring objects being convex objects having a protruding portion shaped as a sphere, any three second measuring objects not being on the same straight line;
s03: moving the robot until the cylindrical surface of the first measurement object is in mechanical contact with the spherical surface of a second measurement object from at least four different directions; reading the pose of the robot when the cylindrical surface is in mechanical contact with the spherical surface of the second measurement object;
s04: repeating the step S03 for the other second measuring objects, and calculating the sphere center coordinates of each second measuring object in the robot coordinate system;
s05: acquiring image information of a second measurement object through the imaging equipment, and processing the acquired image information of the second measurement object to obtain the spherical center coordinate of each second measurement object in the image coordinate system;
s06: and obtaining a coordinate transformation matrix between the robot coordinate system and the image coordinate system according to the spherical center coordinate of the second measurement object in the robot coordinate system and the spherical center coordinate in the image coordinate system, and finishing the registration and calibration of the robot and the imaging equipment when the robot is on the robot mounting seat.
In a preferred embodiment, before the step S01, the method further includes acquiring a marker image of the robot mount by the visual recognition unit, and storing the marker image as a registered calibration.
In the preferred technical scheme, a marker image of a current robot mounting seat is acquired through a visual identification unit, the acquired current marker image and a marker image for registration and calibration are compared and analyzed, and the deviation of the installation pose of the robot mounted on the robot mounting seat relative to the pose of the robot mounted on the robot mounting seat in the registration and calibration stage is obtained;
and correcting a coordinate transformation matrix between the robot coordinate system and the image coordinate system according to the obtained deviation, and finishing the registration of the robot and the image equipment when the robot is positioned on the robot mounting base.
The invention also discloses a space registration calibration system of the robot and the image equipment, which comprises the following steps:
installing a first measuring object on a robot, and determining the pose of the first measuring object relative to the robot, wherein the first measuring object is an object with a cylindrical surface;
setting at least three second measuring objects within a working range of the robot, the second measuring objects being convex objects having a protruding portion shaped as a sphere, any three second measuring objects not being on the same straight line;
a robot driving device that moves the robot until the cylindrical surface of the first measuring object is in mechanical contact with the spherical surface of the second measuring object from at least four different directions;
the image processing unit is used for acquiring the image information of the second measuring object through the imaging equipment and processing the acquired image information of the second measuring object to obtain the spherical center coordinate of the second measuring object in the image coordinate system;
the data recording and processing unit is used for recording the pose of the robot when the cylindrical surface is in mechanical contact with the spherical surface of the second measuring object; calculating to obtain the sphere center coordinate of each second measuring object in the robot coordinate system; and obtaining a coordinate transformation matrix between the robot coordinate system and the image coordinate system according to the spherical center coordinate of the second measurement object in the robot coordinate system and the spherical center coordinate in the image coordinate system, and finishing the registration and calibration of the robot and the imaging equipment when the robot is on the robot mounting seat.
In a preferred technical scheme, the robot further comprises a visual recognition unit, wherein the visual recognition unit is mounted on the robot base and used for acquiring a marker image of the robot mounting base.
In a preferred technical scheme, the data recording and processing unit further comprises a registration use module, the registration use module is used for acquiring a marker image of the current robot mounting seat through the visual recognition unit, and comparing and analyzing the acquired current marker image and the marker image subjected to registration calibration to obtain the deviation of the installation pose of the robot mounted on the robot mounting seat relative to the installation pose of the robot mounted on the robot mounting seat in the registration calibration stage;
and correcting a coordinate transformation matrix between the robot coordinate system and the image coordinate system according to the obtained deviation, and finishing the registration of the robot and the image equipment when the robot is on the robot mounting seat.
Compared with the prior art, the invention has the advantages that:
1. according to the invention, the operation area is divided to set different robot mounting seat positions, and further the space registration of the robot and the image equipment at each mounting position is calibrated, so that the mounting error of the robot when the robot is mounted on the robot mounting seat is only needed to be analyzed during each use, and the error is compensated to the coordinate conversion matrix between the robot coordinate system and the image coordinate system obtained during registration calibration, so that the space registration of the robot and the image equipment can be completed, the space registration time of the robot and the image equipment can be greatly shortened, the operation preparation time is further shortened, and the operation efficiency and the utilization rate of the medical equipment are improved;
2. error calibration in each use is automatically completed, so that only professional personnel are required to perform registration calibration, no professional knowledge requirement is required on the user during registration use, universality is high, and human error can be reduced;
3. the invention directly registers the robot coordinate system and the image coordinate system of the image device, so that the invention has very high precision for rigid tissues and soft tissues;
4. the technical means used by the invention are lower in cost compared with optical tracking devices or electromagnetic tracking devices.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
A robot and imaging device space registration system includes:
the robot comprises a robot mounting seat, a visual recognition unit, a first measuring object, a second measuring object, an image processing unit and a data recording and processing unit.
As shown in fig. 1, a plurality of robot mounts 2, 6 robot mounts are shown, are provided near an operating table 1 for different treatment areas, the robot mounts 2 have markers 21 and identification codes 22, and as shown in fig. 2, the robot mounts 2 have mechanical interfaces (not shown) for constraining the spatial positions of the robots.
As shown in fig. 3, the robot 3 is installed on a robot base 4, the robot base 4 has wheels and can move, a vision recognition unit 5 is arranged below the robot base 4, the vision recognition unit 5 and the robot base 4 are installed relatively immovably, the vision recognition unit 5 is a 3D vision or a 2D vision plus displacement sensor, and the robot base 4 is installed on a mechanical interface on the robot mounting base 2.
The first measurement object is an object having a cylindrical surface, for example, a cylindrical rod, which is referred to herein as a measurement rod, and the measurement rod is described below as an example, the measurement rod has a certain rigidity and is made of any material, and the position of the measurement rod relative to the robot is determined to obtain a tool coordinate system of the measurement rod in the robot.
The second measuring object is a convex object with a protruding part shaped as a sphere, the bottom of which is connected with the sensor; the second measuring objects can be balls, and are called measuring balls herein, the second measuring objects have certain rigidity, the materials are not limited, at least three second measuring objects are arranged in the working range of the robot, and any three measuring balls are not on the same straight line. As shown in fig. 4, there are 4 measuring balls 10, the measuring balls 10 are disposed on the base 20, the bottom of the measuring balls 10 is connected to the sensor 30, and the data recording and processing unit communicates with the robot and the sensor 30 in real time to obtain the motion information of the robot and the signal of the sensor 30. As shown in fig. 4, the base 20 is a vertical support for easy identification of the object coordinate system.
The image processing unit is communicated with the image equipment and processes the image data.
The data recording and processing unit is communicated with the robot, the image processing unit, the visual identification unit and the sensor in real time.
And the robot driving device is used for driving the robot to move until the cylindrical surface of the measuring rod is in mechanical contact with the spherical surface of each measuring ball 10 from at least four different directions, as shown in figure 5.
And the data recording and processing unit is used for acquiring a common point between the two coordinate systems and calculating a coordinate transformation matrix between the two coordinate systems through the common point between the two coordinate systems. Recording the pose of the robot when the cylindrical surface of the measuring rod is in mechanical contact with the surface of the measuring ball; and calculating to obtain the sphere center coordinates of each measuring sphere in the robot coordinate system.
The implementation of the invention is divided into two stages: a registration calibration stage and a registration use stage.
As shown in fig. 6, the registration calibration phase includes the following steps:
for each robot mount:
1. the robot base 4 and the robot mounting seat 2 are fixedly connected by using a mechanical interface on the robot mounting seat 2;
2. the visual recognition unit 5 acquires and stores an image of a marker and an identification code image on the robot mounting base 2;
3. installing the measuring rod on the robot, and determining the pose of the measuring rod relative to the robot;
4. at least three measuring balls are placed on the treatment bed in the working range of the robot, and any three measuring balls are not on the same straight line, as shown in fig. 7.
5. Moving the robot until the cylindrical surface of the measuring rod is in mechanical contact with the spherical surface of the measuring ball from at least four different directions, reading the pose of the robot when the cylindrical surface is in mechanical contact with the spherical surface of the measuring ball, and calculating and storing the spherical center coordinate of the second measuring object relative to the robot coordinate system by using the data recording and processing unit according to the pose of the robot;
6. repeating the step 5 to obtain and store the sphere center coordinates of all the measured objects relative to the robot coordinate system;
in step 5, the method for obtaining the sphere center coordinate of the measuring rod in the robot coordinate system through calculation of the data recording and processing unit comprises the following steps:
s51: calculating a new position for keeping the current posture to advance for a certain distance along the axis of the measuring rod according to the current posture information of the robot when the measuring rod is in mechanical contact with the measuring ball for the first time;
s52: calculating the linear direction vector of the axis of the measuring rod at present according to the coordinates of the two positions to obtain a linear equation of the axis of the measuring rod at present;
s53: repeating the steps S51-S52 to obtain linear equations of at least 3 other directions;
s54: and obtaining the sphere center coordinate of the second measuring object in the robot coordinate system according to the relation between the distance between the axis of the cylindrical surface and the sphere center when the cylindrical surface of the first measuring object is contacted with the spherical surface of the second measuring object for at least four times.
When the measuring ball is contacted with the surface of the sphere of the measuring ball for four times, the distance between the axis of the cylindrical surface of the measuring rod and the center of the sphere is equal and is the radius of the sphere plus the radius of the round rod.
The specific measurement process comprises the following steps: and mounting the measuring rod at the tail end of the robot and calibrating the position of the measuring rod relative to the robot to obtain a tool coordinate system of the measuring rod in the robot. All measuring balls are in the working range of the robot. And for each measuring ball, driving the robot to enable the cylindrical surface of the measuring rod to be in mechanical contact with the measuring ball from at least four different directions so as to acquire the pose of the robot when the measuring rod is in four-time contact with the measuring ball. The data recording and processing unit always communicates with the robot and the sensor in real time to obtainAnd (3) taking motion information of the robot and signals of the sensor, sending out the signals by the sensor at the moment when the cylindrical surface of the measuring rod is in mechanical contact with the measuring ball, and recording the pose of the robot by the data recording and processing unit at the moment. Acquiring the pose (X) of the robot when the measuring rod is in mechanical contact with the same measuring ball for at least four times according to the measuring processT1、YT1、ZT1、UT1、VT1、WT1)、(XT2、YT2、ZT2、UT2、VT2、WT2)、(XT3、YT3、ZT3、UT3、VT3、WT3)、(XT4、YT4、ZT4、UT4、VT4、WT4) And then, processing the acquired data by an algorithm loaded by the data recording and processing unit to obtain the position of the measuring ball. And calculating a coordinate transformation matrix between the two coordinate systems through a common point between the two coordinate systems.
The following is a description of specific calculation steps:
according to the current pose information (X) of the robot when the measuring rod is in mechanical contact with the measuring ball for the first timeT1、YT1、ZT1、UT1、VT1、WT1) Calculating new positions (Xs1, Ys1, Zs1) keeping the current attitude measurement stick advanced by a distance L (not 0 value) along the measurement stick axis;
from the coordinates (X) of the two positionsT1、YT1、ZT1) (Xs1, Ys1 and Zs1) calculating a linear direction vector (l1, m1 and n1) of the axis of the current measuring rod;
from this, the current linear equation of the measuring rod axis in the robot coordinate system can be found as follows:
where (X1, Y1, Z1) are points on a first straight line where the axis of the measurement stick is located.
In the same way, the linear equations of at least 3 other directions (direction 2, direction 3, direction 4) are found as:
wherein (X2, Y2, Z2) is a point on the second straight line of the axis of the measuring stick, (X3, Y3, Z3) is a point on the third straight line of the axis of the measuring stick, and (X4, Y4, Z4) is a point on the fourth straight line of the axis of the measuring stick.
And judging whether the obtained straight lines are mutually opposite in pairs or not. If the non-coplanar surfaces are not different, re-measuring until at least four straight lines with mutually different surfaces are obtained.
Let the sphere center coordinates of the ball 1 be: (X01, YO1, ZO1), assuming that the coordinates of the intersection of a line passing through the center of the sphere and perpendicular to the straight line 1 and the straight line 1 are: (Xq1, Yq1, Zq 1);
assume that the equation for line 1 is:
the intersection point is also located on the straight line 1, and the coordinates of the intersection point are: xq1 ═ l1 × t + Xs 1;
Yq1=m1*t+Ys1;
Zq1=n1*t+Zs1。
assuming (X, Y, Z) that it is a point on a plane passing through the center of the sphere and perpendicular to line 1, the plane equation is:
l1*(X-Xo1)+m1*(Y-Yo1)+n1*(Z-Zo1)=0
the intersection of a line passing through the center of the sphere and perpendicular to the straight line 1 and the straight line 1 is located on the plane, so that the intersection is substituted into the formula:
Then, the distance from the center of the sphere to the straight line 1
Wherein R is the radius of the ball plus the radius of the round rod, and similarly,
the equations (1), (2), (3) and (4) are combined, and the system of equations can be solved:
sphere center coordinates (Xo1, Yo1, Zo1) of the ball 1 in the robot base coordinate system (base coordinate system);
in the same way, the sphere center coordinates of other measuring spheres in the robot base coordinate system can be measured.
7. Operating the imaging device to obtain the image information of the measuring ball 20, as shown in fig. 8, and inputting the image information to the image processing unit;
8. the image processing unit processes the acquired image information of the measuring ball 20, reconstructs the image information acquired by the imaging device to reconstruct a two-dimensional image and a three-dimensional image, performs image segmentation on the area of the measuring ball from the image to identify the measuring ball, and then performs data interpolation to calculate and store the center coordinates of the measuring ball;
9. and according to the sphere center coordinates of the measuring ball in the robot coordinate system and the sphere center coordinates in the image coordinate system, calculating and storing a coordinate conversion matrix between the robot coordinate system and the image coordinate system by using the data recording and processing unit, and finishing the registration and calibration of the robot and the image equipment when the robot is positioned on each robot mounting base.
As shown in fig. 9, the registration use phase:
10. according to the operation requirement, the robot and the corresponding robot mounting seat are fixedly connected by utilizing a mechanical interface on the robot mounting seat;
12. the visual identification unit acquires an image of a marker on the robot mounting seat and an identification code image;
13. and the visual identification unit analyzes the acquired identification code image and judges whether the robot mounting seat connected with the robot currently is correct or not. If not, the correct robot mounting base needs to be selected again for robot mounting.
14. If the position of the robot is correct, the vision identification unit calls a marker image acquired during corresponding registration calibration according to the identification code and compares the marker image with the image of the currently acquired marker to obtain the deviation between the installation pose of the robot installed on the robot installation seat and the installation pose of the robot in the registration calibration stage, and the calculation method of the deviation can be obtained by adopting the existing positioning error and correction method of the working plane of the vision-guided grabbing manipulator and the like.
15. And the data recording and processing unit compensates the deviation between the current robot installation pose and the robot installation pose in the registration and calibration stage into a coordinate transformation matrix between a robot coordinate system and an image coordinate system, and the registration of the robot and the image equipment when the robot is positioned on the robot installation base is completed.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.