CN110940302B - Python-based station coordinate self-positioning method and device, computer equipment and storage medium - Google Patents

Python-based station coordinate self-positioning method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110940302B
CN110940302B CN201911237791.9A CN201911237791A CN110940302B CN 110940302 B CN110940302 B CN 110940302B CN 201911237791 A CN201911237791 A CN 201911237791A CN 110940302 B CN110940302 B CN 110940302B
Authority
CN
China
Prior art keywords
offset
points
coordinate
coordinates
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911237791.9A
Other languages
Chinese (zh)
Other versions
CN110940302A (en
Inventor
刘沐芸
郭永幸
杜祥熙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National local joint Engineering Laboratory of personalized cell therapy technology (Shenzhen)
Shenzhen Saidong Intelligent Manufacturing Technology Co ltd
Original Assignee
Individualized Cell Therapy Technology National And Local Joint Engineering Laboratory (shenzhen)
Shenzhen Saidong Biological Automation Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individualized Cell Therapy Technology National And Local Joint Engineering Laboratory (shenzhen), Shenzhen Saidong Biological Automation Co ltd filed Critical Individualized Cell Therapy Technology National And Local Joint Engineering Laboratory (shenzhen)
Priority to CN201911237791.9A priority Critical patent/CN110940302B/en
Publication of CN110940302A publication Critical patent/CN110940302A/en
Application granted granted Critical
Publication of CN110940302B publication Critical patent/CN110940302B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Exposure And Positioning Against Photoresist Photosensitive Materials (AREA)

Abstract

The invention relates to a python-based station coordinate self-positioning method, a python-based station coordinate self-positioning device, computer equipment and a storage medium, wherein the method comprises the following steps: setting two marking points on an operation platform, and acquiring original coordinates of the marking points and relative position data of the operation point and the marking points; monitoring the coordinate change of the mark point, and acquiring the offset coordinate of the offset mark point when the coordinate of the mark point is offset; calculating according to the original coordinates of the mark points and the offset coordinates of the offset mark points to obtain offset data; an offset operating point is located based on the offset data and the relative position data. The invention sets two marking points on the operation platform in advance and obtains corresponding original coordinates, and obtains the offset coordinates of the offset marking points when the coordinates of the marking points are offset, thereby realizing automatic positioning of the offset operation points, ensuring that the operation platform can automatically complete positioning based on the actual coordinates before and after the offset of the marking points when the offset occurs due to accidents, and ensuring the accuracy of operation.

Description

Python-based station coordinate self-positioning method and device, computer equipment and storage medium
Technical Field
The invention relates to the field of automatic processing, in particular to a python-based station coordinate self-positioning method, a python-based station coordinate self-positioning device, computer equipment and a storage medium.
Background
In the existing scheme, when automatic equipment carries out automatic processing, an operation platform moves due to processing requirements or other reasons, so that the original operation point of a workpiece on the operation platform is not in the same position as the current operation point of the workpiece and cannot correspond to the current operation point of the workpiece, and processing operation is directly carried out according to the original operation point, so that a processing error is caused.
Therefore, it is necessary to automatically position the operation point when the operation point is shifted.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a python-based station coordinate self-positioning method, a python-based station coordinate self-positioning device, computer equipment and a storage medium.
In order to achieve the purpose, the invention adopts the following technical scheme: a station coordinate self-positioning method based on python comprises the following steps:
setting two marking points on an operation platform, and acquiring original coordinates of the marking points and relative position data of the operation point and the marking points;
monitoring the coordinate change of the mark point, and acquiring the offset coordinate of the offset mark point when the coordinate of the mark point is offset;
calculating according to the original coordinates of the mark points and the offset coordinates of the offset mark points to obtain offset data;
an offset operating point is located based on the offset data and the relative position data.
Further, the step of setting two marking points on the operation platform, and acquiring the original coordinates of the marking points and the relative position data of the operation point and the marking points includes:
setting two different fixed points on the operating platform as mark points, respectively acquiring original coordinates of the mark points, and connecting the two mark points to obtain an original straight line;
calculating relative position data of the operating point relative to the marking point and the original straight line;
the raw coordinate data and the relative position data are stored in a storage unit.
Further, the step of calculating to obtain the offset data according to the original coordinates of the mark points and the offset coordinates of the offset mark points includes:
connecting the two offset mark points to obtain an offset straight line, translating the original straight line to enable the end points of the original straight line and the offset straight line to coincide, and acquiring translation vector data;
and acquiring a deviation included angle between the original straight line and the deviation straight line, and taking the translation vector data and the deviation included angle as deviation data.
Further, the step of monitoring the coordinate change of the mark point and acquiring the offset coordinate of the offset mark point when the coordinate of the mark point is offset comprises:
acquiring real-time coordinates of the mark points;
comparing whether the real-time coordinate and the original coordinate are corresponding and consistent;
and when the real-time coordinate is not consistent with the original coordinate, the mark point is shifted to be a shifted mark point, and the real-time coordinate is used as the shifted coordinate of the shifted mark point.
The invention also adopts the following technical scheme: a python-based station coordinate self-positioning device comprises:
the original positioning unit is used for setting two marking points on the operating platform and acquiring original coordinates of the marking points and relative position data of the operating points and the marking points;
the offset monitoring unit is used for monitoring the coordinate change of the mark point and acquiring the offset coordinate of the offset mark point when the coordinate of the mark point is offset;
the offset calculation unit is used for calculating to obtain offset data according to the original coordinates of the mark points and the offset coordinates of the offset mark points;
and the offset positioning unit is used for positioning the offset operating point according to the offset data and the relative position data.
Further, the original positioning unit comprises a coordinate acquisition module, a first calculation module and a data storage module;
the coordinate acquisition module is used for setting two different fixed points on the operating platform as mark points, respectively acquiring the original coordinates of the mark points, and connecting the two mark points to obtain an original straight line;
the first calculation module is used for calculating the relative position data of the operation point relative to the marking point and the original straight line;
and the data storage module is used for storing the original coordinate data and the relative position data in a storage unit.
Further, the offset calculation unit comprises a translation module and an offset acquisition module;
the translation module is used for connecting the two offset mark points to obtain an offset straight line, translating the original straight line so as to enable the end points of the original straight line and the offset straight line to coincide, and acquiring translation vector data;
and the offset acquisition module is used for acquiring an offset included angle of the original straight line and the offset straight line and taking the translation data and the offset included angle as offset data.
Further, the offset monitoring unit comprises a real-time acquisition module, a comparison module and an offset coordinate module;
the real-time acquisition module is used for acquiring real-time coordinates of the mark points;
the comparison module is used for comparing whether the real-time coordinate and the original coordinate are correspondingly consistent;
and the offset coordinate module is used for offsetting the mark points to form offset mark points when the real-time coordinates are inconsistent with the original coordinates, and taking the real-time coordinates as the offset coordinates of the offset mark points.
The invention also adopts the following technical scheme: a computer apparatus comprising a memory having stored thereon a computer program and a processor which when executed implements a python-based workstation coordinate self-positioning method as claimed in any one of the preceding claims.
The invention also adopts the following technical scheme: a storage medium storing a computer program which, when executed by a processor, implements a python-based workstation coordinate self-positioning method as claimed in any one of the preceding claims.
Compared with the prior art, the invention has the beneficial effects that: according to the invention, two marking points are preset on the operation platform and corresponding original coordinates are obtained, when the coordinates of the marking points deviate, the deviation coordinates of the deviation marking points are obtained, deviation data are obtained through calculation according to the original coordinates and the deviation coordinates, and finally, the deviation operation points are automatically positioned according to the deviation data and the relative position data, so that when the operation platform deviates due to accidents, the positioning can be automatically completed based on the actual coordinates before and after the deviation of the marking points, and the accuracy of the operation is ensured.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a python-based station coordinate self-positioning method according to an embodiment of the present invention;
FIG. 2 is a schematic sub-flow diagram of a python-based station coordinate self-positioning method according to an embodiment of the present invention;
FIG. 3 is a sub-flow diagram of a python-based station coordinate self-positioning method according to an embodiment of the present invention;
FIG. 4 is a sub-flow diagram of a python-based station coordinate self-positioning method according to an embodiment of the present invention;
FIG. 5 is a scene diagram of an actual application of the station coordinate self-positioning method based on python in the embodiment of the present invention;
FIG. 6 is a schematic block diagram of a python-based workstation coordinate self-positioning apparatus provided by an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a raw positioning unit of a python-based position coordinate self-positioning apparatus provided by an embodiment of the present invention;
FIG. 8 is a schematic block diagram of an offset monitoring unit of a python-based workstation coordinate self-positioning apparatus provided by an embodiment of the present invention;
FIG. 9 is a schematic block diagram of an offset calculation unit of a python-based workstation coordinate self-positioning apparatus provided by an embodiment of the present invention;
FIG. 10 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
FIG. 1 is a schematic flow chart of a python-based workstation coordinate self-positioning method provided by an embodiment of the invention. As shown in fig. 1, the method includes the following steps S110 to S150.
S110, setting two marking points on the operation platform, and acquiring original coordinates of the marking points and relative position data of the operation point and the marking points.
In this embodiment, two fixed points are preselected on the operation platform of the terminal as mark points, and after the operation platform is shifted, the relative positions of the two mark points on the operation platform are unchanged, that is, the mutual position relationship between the operation point and the mark points before the shift occurs is consistent with the position relationship between the operation point and the mark points after the shift, so that the mark points can be used as reference before and after the shift of the operation platform, the shifted operation point is located according to the shift amount of the two mark points, and the automatic location of the operation platform is realized.
In one embodiment, referring to FIG. 2, step S110 includes steps S111-S113.
S111, setting two different fixed points on the operating platform as mark points, respectively acquiring original coordinates of the mark points, and connecting the two mark points to obtain an original straight line.
And S112, calculating relative position data of the operation point relative to the marking point and the original straight line.
In this embodiment, two different fixed points are set as the mark points, and the original coordinates of the two mark points are directly obtained by the CCD camera on the operation platform, where the mark points include a mark point a and a mark point b, and the original straight line ab can be obtained by connecting the mark point a and the mark point b.
In addition, correspondingly, the operation point q is a fixed point, and on the premise that the coordinates of the mark point a, the mark point b and the operation point q are known, the relative position data of the operation point q, the mark point a, the mark point b and the original straight line ab is fixed, and the operation point q can be accurately positioned through the relative position data, wherein the relative position data can be the distance and the direction from the operation point to different mark points.
And S113, storing the original coordinate data and the relative position data in a storage unit.
In this embodiment, the original coordinate data and the relative position data are stored in the storage unit, and after the offset occurs, the original coordinate data and the relative position data are read for positioning the offset coordinates of the offset operation point, and the offset coordinates of the offset mark point and the offset operation point are also stored in the storage unit. The data are stored in a local storage unit, and the data do not need to be frequently transmitted through a network (between an upper computer and a PLC), so that the positioning efficiency is improved. Specifically, the storage unit includes a DB or a register.
And S120, monitoring the coordinate change of the mark points, and acquiring the offset coordinates of the offset mark points when the coordinates of the mark points are offset.
In this embodiment, whether the operation platform is shifted or not is determined by monitoring the coordinate change of the mark point, after the shift occurs, the mark point becomes a shift mark point, correspondingly, the mark point a and the mark point B become a shift mark point a and a shift mark point B, and the shift coordinates of the shift mark point a and the shift mark point B are acquired by the CCD camera.
In one embodiment, referring to FIG. 3, step S120 includes steps S121-S123.
And S121, acquiring real-time coordinates of the mark points.
And S122, comparing whether the real-time coordinate is consistent with the original coordinate.
And S123, when the real-time coordinate is not consistent with the original coordinate, the mark point is shifted to be a shifted mark point, and the real-time coordinate is used as the shifted coordinate of the shifted mark point.
In this embodiment, the real-time coordinate of the mark point is obtained by the CCD camera, and the real-time coordinate and the original coordinate are compared, and when the real-time coordinate is not consistent with the original coordinate, the position of the mark point changes, that is, the operation platform is shifted, and the shifted coordinate of the shifted mark point needs to be obtained again by the CCD for automatic positioning of the operation point.
And S130, calculating to obtain offset data according to the original coordinates of the mark points and the offset coordinates of the offset mark points.
In this embodiment, the mark points include a mark point a and a mark point B, the mark point a and the mark point B are connected to obtain an original straight line AB, the mark point a is an offset mark point a after being offset, the mark point B is an offset mark point B after being offset, and the offset mark point a and the offset mark point B are connected to obtain an offset straight line AB. Offset data corresponding to the operation point can be obtained through the offset data of the original straight line AB relative to the offset straight line AB, and the offset operation point can be positioned according to the offset data and the relative position data of the operation point and the marking point.
In one embodiment, referring to fig. 4, step S130 includes steps S131 and S132.
S131, connecting the two offset mark points to obtain an offset straight line, translating the original straight line to enable the end points of the original straight line and the offset straight line to coincide, and acquiring translation vector data.
S132, obtaining the offset included angle of the original straight line and the offset straight line, and taking the translation vector data and the offset included angle as offset data.
In this embodiment, the original straight line is translated first, so that end points of the original straight line and the offset straight line coincide with each other, and preliminary translation vector data may be obtained, at this time, the operation point may also be regarded as being translated synchronously according to the same offset vector, where the end points coincide with each other, and may be a mark point a and an offset mark point a, or a mark point B and an offset mark point B, and the default coinciding end point may be set as the mark point a or the mark point B, and in this embodiment, the mark point a and the offset mark point a are used by default.
After the translation is finished and the end points are overlapped, the translation coordinate of the marking point a is the coordinate of the offset marking point A, the original coordinate of the marking point B is converted according to the translation vector data, and according to the offset coordinates of the offset marking points A and B, the sinr and cosr values of the offset included angle r between the original straight line and the offset straight line after the translation can be calculated. Specifically, the original coordinates of the operation point q are correspondingly converted according to the translation vector data.
Similarly, the mark point a and the operation point Q after translation are connected to obtain a straight line AQ, the offset mark point a and the offset operation point Q are connected to obtain a straight line AQ, the straight line AQ and the straight line AQ have the same end point, and the included angle between the straight line AQ and the straight line AQ is also the offset included angle r, i.e. the sinr and cosr values of the included angle r between the straight line AQ and the straight line AQ are obtained.
And calculating the coordinate of the offset operating point Q according to the sinr and cosr values of the included angle r and the coordinates of the mark point a, the offset mark point A and the operating point Q, and further realizing the positioning of the corresponding offset mark point.
And S140, positioning the offset operating point according to the offset data and the relative position data.
In this embodiment, the offset data includes translation vector data and an offset included angle; the relative position data includes the original coordinates of the marker points a and B, the coordinates of the offset marker points a and B, and the original coordinates of the operation point q. The original coordinates of the marking points a and b and the original coordinates of the operating point q are converted according to the translation vector data to obtain translated coordinates correspondingly, and the converted coordinate values are adopted in subsequent calculation.
As described above, the coordinates of the offset operating point Q can be calculated based on the sinr and cosr values to the angle r and the coordinates of the mark point a, the offset mark point a, and the operating point Q.
As shown in FIG. 5, a mark point a (a) on the horizontal operation platformx,ay) And b (b)x,by) Operating point q (q)x,qy) For the original operation point, after the operation platform is horizontally shifted due to various unexpected factors, the corresponding shift mark point is A (A)x,Ay) And B (B)x,By)Operating point Q (Q)x,Qy) The original line AB, the offset line AB, and the translated line AB' are the shifted operating points. The specific calculation positioning process is as follows:
translating the original straight line AB until the point a and the point A coincide, defining the translated point b as b ' after translation, and marking the coordinate of the point b ' according to the translation vector data, wherein the offset included angle b ' AB is r.
The coordinates of the three points of triangle b' AB are known and can be found:
Bx-Ax=(bx-Ax)*cosr+(by-Ay)*sinr;
By-Ay=(by-Ay)*cosr-(bx-Ax)*sinr。
the conversion formula yields:
sinr=((Bx-Ax)(by-ay)-(By-Ay)(bx-ax))/((bx-ax)2+(by-ay)2);
cosr=((Bx-Ax)(bx-ax)-(By-Ay)(by-ay))/((bx-ax)2+(by-ay)2)。
from the sinr and cosr values, the coordinate value of the shifted operating point Q is calculated as follows:
Qx=(qx-ax)cosr+(qy-ay)sinr+Ax
Qy=(qy-ay)cosr-(qx-ax)sinr+Ay
thus, the coordinate of the offset operation point Q can be obtained as (Q)x,Qy) And based on the coordinates (Q) of the offset operating point Qx,Qy) And automatically positioning to an offset operating point Q, thereby realizing accidental offset of the operating platform and automatic positioning of the operating point.
Specifically, when the Python-based station coordinate self-positioning method is actually applied, the position coordinate self-positioning method can be written into terminal equipment in a Python script mode, the terminal automatically acquires coordinate values before and after the mark point is shifted through a CCD (charge coupled device), and the Python script is operated to directly obtain the shifted coordinate of the operation point after the shift, so that automatic positioning is realized.
According to the invention, two marking points are preset on the operation platform and corresponding original coordinates are obtained, when the coordinates of the marking points deviate, the deviation coordinates of the deviation marking points are obtained, deviation data are obtained through calculation according to the original coordinates and the deviation coordinates, and finally, the deviation operation points are automatically positioned according to the deviation data and the relative position data, so that when the operation platform deviates due to accidents, the positioning can be automatically completed based on the actual coordinates before and after the deviation of the marking points, and the accuracy of the operation is ensured.
FIG. 6 is a schematic block diagram of a python-based workstation coordinate self-positioning device provided by an embodiment of the invention. As shown in FIG. 6, the invention also provides a python-based station coordinate self-positioning device, which corresponds to the python-based station coordinate self-positioning method. The python-based station coordinate self-positioning device comprises a unit for executing the python-based station coordinate self-positioning method, and can be configured in a desktop computer, a tablet computer, a portable computer and other terminals. Specifically, referring to fig. 6, the python-based station coordinate self-positioning device comprises a raw positioning unit 10, an offset monitoring unit 20, an offset calculating unit 30 and an offset positioning unit 40.
And the original positioning unit 10 is used for setting two marking points on the operating platform, and acquiring original coordinates of the marking points and relative position data of the operating points and the marking points.
In this embodiment, two fixed points are preselected on the operation platform of the terminal as mark points, and after the operation platform is shifted, the relative positions of the two mark points on the operation platform are unchanged, that is, the mutual position relationship between the operation point and the mark points before the shift occurs is consistent with the position relationship between the operation point and the mark points after the shift, so that the mark points can be used as reference before and after the shift of the operation platform, the shifted operation point is located according to the shift amount of the two mark points, and the automatic location of the operation platform is realized.
In one embodiment, referring to FIG. 7, the raw positioning unit 10 includes a coordinate acquisition module 11, a first calculation module 12, and a data storage module 13.
And the coordinate acquisition module 11 is configured to set two different fixed points on the operating platform as mark points, acquire original coordinates of the mark points respectively, and connect the two mark points to obtain an original straight line.
And the first calculating module 12 is used for calculating the relative position data of the operating point relative to the marking point and the original straight line.
In this embodiment, two different fixed points are set as the mark points, and the original coordinates of the two mark points are directly obtained by the CCD camera on the operation platform, where the mark points include a mark point a and a mark point b, and the original straight line ab can be obtained by connecting the mark point a and the mark point b.
In addition, correspondingly, the operation point q is a fixed point, and on the premise that the coordinates of the mark point a, the mark point b and the operation point q are known, the relative position data of the operation point q, the mark point a, the mark point b and the original straight line ab is fixed, and the operation point q can be accurately positioned through the relative position data, wherein the relative position data can be the distance and the direction from the operation point to different mark points.
And a data storage module 13 for storing the original coordinate data and the relative position data in a storage unit.
In this embodiment, the original coordinate data and the relative position data are stored in the storage unit, and after the offset occurs, the original coordinate data and the relative position data are read for positioning the offset coordinates of the offset operation point, and the offset coordinates of the offset mark point and the offset operation point are also stored in the storage unit. The data are stored in a local storage unit, and the data do not need to be frequently transmitted through a network (between an upper computer and a PLC), so that the positioning efficiency is improved. Specifically, the storage unit includes a DB or a register.
And the offset monitoring unit 20 is configured to monitor coordinate changes made by the mark points, and acquire offset coordinates of the offset mark points when the coordinates of the mark points are offset.
In this embodiment, whether the operation platform is shifted or not is determined by monitoring the coordinate change of the mark point, after the shift occurs, the mark point becomes a shift mark point, correspondingly, the mark point a and the mark point B become a shift mark point a and a shift mark point B, and the shift coordinates of the shift mark point a and the shift mark point B are acquired by the CCD camera.
Referring to fig. 8, in one embodiment, the offset monitoring unit 20 includes a real-time acquisition module 21, a comparison module 22, and an offset coordinate module 23.
A real-time obtaining module 21, configured to obtain real-time coordinates of the mark points;
the comparison module 22 is used for comparing whether the real-time coordinates are corresponding to the original coordinates;
and the offset coordinate module 23 is configured to offset the mark point to form an offset mark point when the real-time coordinate is inconsistent with the original coordinate, and use the real-time coordinate as an offset coordinate of the offset mark point.
In this embodiment, the real-time coordinate of the mark point is obtained by the CCD camera, and the real-time coordinate and the original coordinate are compared, and when the real-time coordinate is not consistent with the original coordinate, the position of the mark point changes, that is, the operation platform is shifted, and the shifted coordinate of the shifted mark point needs to be obtained again by the CCD for automatic positioning of the operation point.
And the offset calculating unit 30 is used for calculating to obtain offset data according to the original coordinates of the mark points and the offset coordinates of the offset mark points.
In this embodiment, the mark points include a mark point a and a mark point B, the mark point a and the mark point B are connected to obtain an original straight line AB, the mark point a is an offset mark point a after being offset, the mark point B is an offset mark point B after being offset, and the offset mark point a and the offset mark point B are connected to obtain an offset straight line AB. Offset data corresponding to the operation point can be obtained through the offset data of the original straight line AB relative to the offset straight line AB, and the offset operation point can be positioned according to the offset data and the relative position data of the operation point and the marking point.
Referring to fig. 9, in an embodiment, the offset calculation unit 30 includes a translation module 31 and an offset acquisition module 32.
The translation module 31 is configured to connect the two offset mark points to obtain an offset straight line, translate the original straight line to make the end points of the original straight line and the offset straight line coincide, and obtain translation vector data.
And the offset acquisition module 32 is configured to acquire an offset included angle between the original straight line and the offset straight line, and use the translation amount data and the offset included angle as offset data.
In this embodiment, the original straight line is translated first, so that end points of the original straight line and the offset straight line coincide with each other, and preliminary translation vector data may be obtained, at this time, the operation point may also be regarded as being translated synchronously according to the same offset vector, where the end points coincide with each other, and may be a mark point a and an offset mark point a, or a mark point B and an offset mark point B, and the default coinciding end point may be set as the mark point a or the mark point B, and in this embodiment, the mark point a and the offset mark point a are used by default.
After the translation is finished and the end points are overlapped, the translation coordinate of the marking point a is the coordinate of the offset marking point A, the original coordinate of the marking point B is converted according to the translation vector data, and according to the offset coordinates of the offset marking points A and B, the sinr and cosr values of the offset included angle r between the original straight line and the offset straight line after the translation can be calculated. Specifically, the original coordinates of the operation point q are correspondingly converted according to the translation vector data.
Similarly, the mark point a and the operation point Q after translation are connected to obtain a straight line AQ, the offset mark point a and the offset operation point Q are connected to obtain a straight line AQ, the straight line AQ and the straight line AQ have the same end point, and the included angle between the straight line AQ and the straight line AQ is also the offset included angle r, i.e. the sinr and cosr values of the included angle r between the straight line AQ and the straight line AQ are obtained.
And calculating the coordinate of the offset operating point Q according to the sinr and cosr values of the included angle r and the coordinates of the mark point a, the offset mark point A and the operating point Q, and further realizing the positioning of the corresponding offset mark point.
And an offset positioning unit 40 for positioning the offset operating point based on the offset data and the relative position data.
In this embodiment, the offset data includes translation vector data and an offset included angle; the relative position data includes the original coordinates of the marker points a and B, the coordinates of the offset marker points a and B, and the original coordinates of the operation point q. The original coordinates of the marking points a and b and the original coordinates of the operating point q are converted according to the translation vector data to obtain translated coordinates correspondingly, and the converted coordinate values are adopted in subsequent calculation.
As described above, the coordinates of the offset operating point Q can be calculated based on the sinr and cosr values to the angle r and the coordinates of the mark point a, the offset mark point a, and the operating point Q.
As shown in FIG. 5, a mark point a (a) on the horizontal operation platformx,ay) And b (b)x,by) Operating point q (q)x,qy) For the original operation point, after the operation platform is horizontally shifted due to various unexpected factors, the corresponding shift mark point is A (A)x,Ay) And B (B)x,By)Operating point Q (Q)x,Qy) The original line AB, the offset line AB, and the translated line AB' are the shifted operating points. The specific calculation positioning process is as follows:
translating the original straight line AB until the point a and the point A coincide, defining the translated point b as b ' after translation, and marking the coordinate of the point b ' according to the translation vector data, wherein the offset included angle b ' AB is r.
The coordinates of the three points of triangle b' AB are known and can be found:
Bx-Ax=(bx-Ax)*cosr+(by-Ay)*sinr;
By-Ay=(by-Ay)*cosr-(bx-Ax)*sinr。
the conversion formula yields:
sinr=((Bx-Ax)(by-ay)-(By-Ay)(bx-ax))/((bx-ax)2+(by-ay)2);
cosr=((Bx-Ax)(bx-ax)-(By-Ay)(by-ay))/((bx-ax)2+(by-ay)2)。
from the sinr and cosr values, the coordinate value of the shifted operating point Q is calculated as follows:
Qx=(qx-ax)cosr+(qy-ay)sinr+Ax
Qy=(qy-ay)cosr-(qx-ax)sinr+Ay
thus, the coordinate of the offset operation point Q can be obtained as (Q)x,Qy) And based on the coordinates (Q) of the offset operating point Qx,Qy) And automatically positioning to an offset operating point Q, thereby realizing accidental offset of the operating platform and automatic positioning of the operating point.
According to the invention, two marking points are preset on the operation platform and corresponding original coordinates are obtained, when the coordinates of the marking points deviate, the deviation coordinates of the deviation marking points are obtained, deviation data are obtained through calculation according to the original coordinates and the deviation coordinates, and finally, the deviation operation points are automatically positioned according to the deviation data and the relative position data, so that when the operation platform deviates due to accidents, the positioning can be automatically completed based on the actual coordinates before and after the deviation of the marking points, and the accuracy of the operation is ensured.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the above python-based station coordinate self-positioning apparatus and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
Referring to fig. 10, fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 10, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 comprises program instructions that, when executed, cause the processor 502 to perform a python-based position coordinate self-locating method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute a python-based position coordinate self-positioning method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 10 is a block diagram of only a portion of the configuration relevant to the present teachings and is not intended to limit the computing device 500 to which the present teachings may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is adapted to run a computer program 5032 stored in the memory.
It should be understood that in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A station coordinate self-positioning method based on python is characterized by comprising the following steps:
setting two marking points on an operation platform, and acquiring original coordinates of the marking points and relative position data of the operation point and the marking points;
the setting of two marking points on the operation platform, the acquisition of the original coordinates of the marking points and the relative position data of the operation points and the marking points comprises the following steps: setting two different fixed points on the operating platform as mark points, respectively acquiring original coordinates of the mark points, and connecting the two mark points to obtain an original straight line; calculating relative position data of the operating point relative to the marking point and the original straight line; storing the original coordinate data and the relative position data in a storage unit, reading the original coordinate data and the relative position data after the deviation occurs, positioning the deviation coordinates of the operation point after the deviation occurs, and storing the deviation coordinates of the mark point and the operation point after the deviation in the storage unit;
monitoring the coordinate change of the mark points, and acquiring the offset coordinates of the offset mark points when the coordinates of the mark points are offset;
calculating according to the original coordinates of the mark points and the offset coordinates of the offset mark points to obtain offset data;
the calculating according to the original coordinates of the mark points and the offset coordinates of the offset mark points to obtain offset data comprises the following steps: connecting the two offset mark points to obtain an offset straight line, translating the original straight line to enable the end points of the original straight line and the offset straight line to coincide, and acquiring translation vector data; acquiring an offset included angle of an original straight line and an offset straight line, and taking translation vector data and the offset included angle as offset data;
an offset operating point is located based on the offset data and the relative position data.
2. The python-based station coordinate self-positioning method as claimed in claim 1, wherein the step of monitoring the coordinate change of the mark point and acquiring the offset coordinate of the offset mark point when the coordinate of the mark point is offset comprises the following steps:
acquiring real-time coordinates of the mark points;
comparing whether the real-time coordinate and the original coordinate are corresponding and consistent;
and when the real-time coordinate is not consistent with the original coordinate, the mark point is shifted to be a shifted mark point, and the real-time coordinate is used as the shifted coordinate of the shifted mark point.
3. A python-based station coordinate self-positioning device is characterized by comprising:
the original positioning unit is used for setting two marking points on the operating platform and acquiring original coordinates of the marking points and relative position data of the operating points and the marking points;
the offset monitoring unit is used for monitoring the coordinate change of the mark points and acquiring offset coordinates of the offset mark points when the coordinates of the mark points are offset;
the offset calculation unit is used for calculating to obtain offset data according to the original coordinates of the mark points and the offset coordinates of the offset mark points;
the offset positioning unit is used for positioning an offset operating point according to the offset data and the relative position data;
the original positioning unit comprises a coordinate acquisition module, a first calculation module and a data storage module;
the coordinate acquisition module is used for setting two different fixed points on the operating platform as mark points, respectively acquiring the original coordinates of the mark points, and connecting the two mark points to obtain an original straight line;
the first calculation module is used for calculating the relative position data of the operation point relative to the marking point and the original straight line;
the data storage module is used for storing the original coordinate data and the relative position data in a storage unit;
the offset calculation unit comprises a translation module and an offset acquisition module;
the translation module is used for connecting the two offset mark points to obtain an offset straight line, translating the original straight line so as to enable the end points of the original straight line and the offset straight line to coincide, and acquiring translation vector data;
and the offset acquisition module is used for acquiring an offset included angle of the original straight line and the offset straight line and taking the translation data and the offset included angle as offset data.
4. The python-based workstation coordinate self-positioning apparatus of claim 3, wherein the offset monitoring unit comprises a real-time acquisition module, a comparison module and an offset coordinate module;
the real-time acquisition module is used for acquiring real-time coordinates of the mark points;
the comparison module is used for comparing whether the real-time coordinate and the original coordinate are correspondingly consistent;
and the offset coordinate module is used for offsetting the mark points to form offset mark points when the real-time coordinates are inconsistent with the original coordinates, and taking the real-time coordinates as the offset coordinates of the offset mark points.
5. A computer device comprising a memory having stored thereon a computer program and a processor which, when executed, implements a python-based workstation coordinate self-positioning method as claimed in any one of claims 1 to 2.
6. A storage medium storing a computer program which, when executed by a processor, implements a python-based workstation coordinate self-positioning method as claimed in any one of claims 1 to 2.
CN201911237791.9A 2019-12-06 2019-12-06 Python-based station coordinate self-positioning method and device, computer equipment and storage medium Active CN110940302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911237791.9A CN110940302B (en) 2019-12-06 2019-12-06 Python-based station coordinate self-positioning method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911237791.9A CN110940302B (en) 2019-12-06 2019-12-06 Python-based station coordinate self-positioning method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110940302A CN110940302A (en) 2020-03-31
CN110940302B true CN110940302B (en) 2021-08-24

Family

ID=69909731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911237791.9A Active CN110940302B (en) 2019-12-06 2019-12-06 Python-based station coordinate self-positioning method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110940302B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63131014A (en) * 1986-11-20 1988-06-03 Pioneer Electronic Corp Apparatus for inspecting chip part mounted on substrate
CN1256990A (en) * 1999-12-30 2000-06-21 清华大学 Intelligent locating working method
CN105717395A (en) * 2016-02-24 2016-06-29 深圳精智达技术股份有限公司 Alignment method and device of product to be measured
JP2018012152A (en) * 2016-07-20 2018-01-25 ファナック株式会社 Device and method for calibrating origin position of robot
CN109685784A (en) * 2018-12-19 2019-04-26 森大(深圳)技术有限公司 Pcb board position error calibration method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63131014A (en) * 1986-11-20 1988-06-03 Pioneer Electronic Corp Apparatus for inspecting chip part mounted on substrate
CN1256990A (en) * 1999-12-30 2000-06-21 清华大学 Intelligent locating working method
CN105717395A (en) * 2016-02-24 2016-06-29 深圳精智达技术股份有限公司 Alignment method and device of product to be measured
JP2018012152A (en) * 2016-07-20 2018-01-25 ファナック株式会社 Device and method for calibrating origin position of robot
CN107643064A (en) * 2016-07-20 2018-01-30 发那科株式会社 The origin position calibrating installation and method of robot
CN109685784A (en) * 2018-12-19 2019-04-26 森大(深圳)技术有限公司 Pcb board position error calibration method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110940302A (en) 2020-03-31

Similar Documents

Publication Publication Date Title
CN110561423B (en) Pose transformation method, robot and storage medium
CN108931795B (en) Positioning equipment track optimization and boundary extraction method and device
WO2020252920A1 (en) Picture correction method and apparatus, computer device and computer-readable storage medium
CN110458772B (en) Point cloud filtering method and device based on image processing and storage medium
CN109366472B (en) Method and device for placing articles by robot, computer equipment and storage medium
US20220319050A1 (en) Calibration method and apparatus, processor, electronic device, and storage medium
CN109598637B (en) Ship pipe section calibration method, device, system, storage medium and terminal
WO2022160266A1 (en) Vehicle-mounted camera calibration method and apparatus, and terminal device
CN112330752A (en) Multi-camera combined calibration method and device, terminal equipment and readable storage medium
CN108364313A (en) A kind of method of automatic aligning, system and terminal device
CN111767965A (en) Image matching method and device, electronic equipment and storage medium
CN114663500A (en) Vision calibration method, computer device and storage medium
CN113687629A (en) Circular arc straight line fitting method, system, equipment and storage medium for laser CAM processing
CN112686950A (en) Pose estimation method and device, terminal equipment and computer readable storage medium
WO2022205845A1 (en) Pose calibration method and apparatus, and robot and computer-readable storage medium
CN110940302B (en) Python-based station coordinate self-positioning method and device, computer equipment and storage medium
CN113119083B (en) Robot calibration method and device, robot and storage medium
CN113868064A (en) Method and device for automatically measuring PCIE eye diagram, computer equipment and storage medium
US20210200224A1 (en) Method for controlling a robot and its end-portions and device thereof
CN111055278B (en) Robot coordinate self-positioning method and device based on VAL3 language, computer equipment and storage medium
CN110826146B (en) Jig frame correction method, device and equipment based on CATIA (computer-graphics aided three-dimensional Interactive application), and storage medium
CN111429529A (en) Calibration method for coordinate transformation, electronic equipment and computer storage medium
CN113269767B (en) Batch part feature detection method, system, medium and equipment based on machine vision
CN115239520A (en) Method and device for eliminating errors of model component, electronic device and storage medium
CN112347210B (en) Lane center line bending error correction method and system for medium-precision map

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 518000 2 / F, Beike building, 59 Gaoxin South 9th Road, high tech Zone community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen saidong Intelligent Manufacturing Technology Co.,Ltd.

Patentee after: National local joint Engineering Laboratory of personalized cell therapy technology (Shenzhen)

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee before: SHENZHEN SAIDONG BIOLOGICAL AUTOMATION Co.,Ltd.

Patentee before: National local joint Engineering Laboratory of personalized cell therapy technology (Shenzhen)