Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a robot coordinate self-positioning method and device based on VAL3 language, computer equipment and a storage medium.
In order to achieve the purpose, the invention adopts the following technical scheme: a robot coordinate self-positioning method based on VAL3 language comprises the following steps:
setting three marking points on an operation platform, and acquiring original coordinates of the marking points;
establishing an original coordinate system according to the original coordinate values of the marking points, and acquiring the original coordinates of the operation points in the original coordinate system;
monitoring the coordinate change of the mark points, and acquiring the offset coordinates of the offset mark points when the three-dimensional offset or rotation occurs to the coordinates of the mark points;
and establishing an offset coordinate system according to the offset coordinates of the mark points, and changing the coordinate system to obtain the mapping coordinates of the operation points in the offset coordinate system so as to complete positioning.
Further, the step of setting three marking points on the operating platform and acquiring the original coordinates of the marking points
Setting three different fixed points on the operating platform as mark points, and respectively acquiring the original coordinates of the mark points.
Further, the step of monitoring the coordinate change of the mark point and acquiring the offset coordinate of the offset mark point when the mark point coordinate is three-dimensionally offset or rotated includes:
acquiring real-time coordinates of the mark points through a CCD camera;
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.
Further, the step of establishing an original coordinate system according to the original coordinate values of the marking points and acquiring the original coordinates of the operation points in the original coordinate system comprises the steps of
Establishing an original coordinate system based on the original coordinates of the mark points through a VAL3 language setFrame instruction;
the original coordinates of the operation point in the original coordinate system are obtained through the VAL3 language position instruction.
Further, the step of establishing an offset coordinate system according to the offset coordinates of the mark points, and obtaining the mapping coordinates of the operation points in the offset coordinate system through the coordinate system change to complete the positioning includes:
establishing an offset coordinate system based on offset coordinates of the mark points through a VAL3 language setFrame instruction;
and transforming the coordinate system through a VAL3 language link instruction, acquiring the mapping coordinate of the operating point in the offset coordinate system, and positioning the offset operating point according to the mapping coordinate.
The invention adopts the following technical scheme: a VAL3 language-based robot coordinate self-positioning device comprises:
the initial setting unit is used for setting three marking points on the operating platform and acquiring original coordinates of the marking points;
the establishing and obtaining unit is used for establishing an original coordinate system according to the original coordinate values of the marking points and obtaining the original coordinates of the operating points in the original coordinate system;
the change monitoring unit is used for 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 three-dimensionally offset or rotated;
and the establishing and positioning unit is used for establishing an offset coordinate system according to the offset coordinates of the mark points, and acquiring the mapping coordinates of the operation points in the offset coordinate system through coordinate system change to complete positioning.
Further, the change monitoring unit comprises a real-time acquisition module, a coordinate comparison module and an offset acquisition module;
the real-time acquisition module is used for acquiring real-time coordinates of the mark points through the CCD camera;
the coordinate comparison module is used for comparing whether the real-time coordinate is corresponding to the original coordinate;
and the offset acquisition module is used for offsetting the mark points into offset mark points when the real-time coordinates are inconsistent with the original coordinates, and taking the real-time coordinates as offset coordinates of the offset mark points.
Further, the establishing and positioning unit comprises a second establishing module and a transformation and positioning module;
the second establishing module is used for establishing an offset coordinate system based on offset coordinates of the mark points through a VAL3 language setFrame instruction;
the transformation positioning module is used for transforming the coordinate system through a VAL3 language link instruction, acquiring the mapping coordinates of the operation point in the offset coordinate system, and positioning the offset operation point according to the mapping coordinates.
The invention adopts the following technical scheme: a computer device, characterized in that the computer device comprises a memory and a processor, the memory stores a computer program, the processor realizes the VAL3 language-based robot coordinate self-positioning method as any one of the above when executing the computer program.
The invention adopts the following technical scheme: a storage medium storing a computer program which, when executed by a processor, implements the VAL3 language based robot coordinate self-positioning method as described in any one of the above.
Compared with the prior art, the invention has the beneficial effects that: the three marking points are selected on the operation platform in advance, the original coordinate system is established according to the marking points, the original coordinates of the operation points in the original coordinate system are obtained, when the operation platform deviates or rotates, the deviation coordinate system is established according to the deviation coordinates of the mark points after deviation, then the mapping coordinates of the operation points in the deviation coordinate system can be obtained through coordinate system transformation, and the three-dimensional deviation or rotation automatic positioning of the operation points can be realized according to the mapping coordinates, so that the efficient and high-quality processing of the robot is ensured.
The invention is further described below with reference to the accompanying drawings and specific embodiments.
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 flow chart schematic diagram of a robot coordinate self-positioning method based on VAL3 language according to an embodiment of the present invention. As shown in fig. 1, the method includes steps S110 to S140.
And S110, setting three marking points on the operating platform, and acquiring the original coordinates of the marking points.
In this embodiment, three fixed points are preselected on the operation platform as mark points, and after the operation platform is three-dimensionally shifted or rotated, the relative position of a plane formed by the three mark points on the operation platform is unchanged, that is, the mutual positional relationship between the operation point and the mark points before the three-dimensionally shifted or rotated is consistent with the positional relationship between the operation point after the shift and the mark points, so that the mark points can be used as reference before and after the operation platform is shifted, the operation point after the shift is positioned according to the shift amounts of the three mark points, and the automatic positioning of the operation platform is realized.
In an embodiment, step S110 specifically includes step S111.
And S111, setting three different fixed points on the operating platform as mark points, and respectively acquiring the original coordinates of the mark points.
In this embodiment, three different fixed points are set as the mark points, and the original coordinates of the corresponding mark points are directly obtained by the CCD camera on the operation platform, where the mark points include a mark point a, a mark point b, and a mark point c, a spatial plane can be formed according to the mark point a, the mark point b, and the mark point c, and an original coordinate system is further established.
And S120, establishing an original coordinate system according to the original coordinate values of the mark points, and acquiring the original coordinates of the operation points in the original coordinate system.
In this embodiment, the coordinate system is a special data structure type in the VAL3 code, and a point includes 6 attributes in a coordinate system, which are coordinate values in 3 coordinate axes and angles with 3 coordinate axes. An original coordinate system Frame _ a is established through a setFrame instruction of the VAL3, input parameters are coordinate values of three points, namely mark points a, b and c, and the setFrame instruction is packaged in the VAL3 in advance.
Referring to fig. 2, in an embodiment, step S120 includes steps S121 and S122.
And S121, establishing an original coordinate system based on the original coordinates of the mark points through a language setFrame instruction of VAL 3.
And S122, acquiring original coordinates of the operating point in an original coordinate system through a VAL3 language position instruction.
In this embodiment, by writing the execution plan into a corresponding instruction in advance, after the coordinates of the mark points are obtained, the VAL3 language setFrame instruction establishes the original coordinate system Frame _ a based on the coordinate values of the three mark points, and after the original coordinate system Frame _ a is established, the original coordinate values of the current operation point in the original coordinate system Frame _ a are obtained through the position instruction. And the marking bit, the original coordinate system Frame _ a and the coordinate data of the operating point are directly stored in a storage unit (DB or register), so that the robot can be conveniently and directly called from the operating platform locally to perform subsequent data processing, the data do not need to be frequently transmitted through a network (between an upper computer and a PLC), and the positioning efficiency is improved. Specifically, the storage unit includes a DB or a register.
And S130, 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 three-dimensionally offset or rotated.
In this embodiment, the coordinate change of the mark point is monitored by the CCD camera to determine whether the operation platform is shifted, after three-dimensional shifting or rotation occurs, the mark point becomes a shift mark point, and correspondingly, the mark point a, the mark point B, and the mark point C become a shift mark point a, a shift mark point B, and a shift mark point C, and the shift coordinates of the shift mark point a, the shift mark point B, and the shift mark point C are acquired by the CCD camera.
Referring to FIG. 3, in one embodiment, step S130 includes steps S131-S133.
S131, acquiring real-time coordinates of the mark points through the CCD camera.
And S132, comparing whether the real-time coordinates are corresponding to the original coordinates or not.
And S133, 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 CCD camera is used to obtain the real-time coordinates of the mark points on the operation platform, and compare the real-time coordinates with the original coordinates, and when the real-time coordinates are inconsistent with the original coordinates, the mark points are represented to have changed positions, that is, the operation platform rotates after three-dimensional deviation occurs, and the CCD camera is used to obtain the deviation coordinates of the deviated mark points again, so as to automatically position the operation points.
And S140, establishing an offset coordinate system according to the offset coordinates of the mark points, and changing the coordinate system to obtain the mapping coordinates of the operation points in the offset coordinate system to finish positioning.
In this embodiment, after the operation platform is shifted or rotated, the CCD camera and the laser sensor can determine that the position of the operation platform has changed, and the CCD camera obtains the coordinates of the shifted mark A, B, C after the mark a, b, and c are shifted, and a new shifted coordinate system Frame _ a is established by the setFrame instruction again. After obtaining the offset coordinate system Frame _ a, transforming according to the original coordinate system and the offset coordinate system through a VAL3 language link instruction, obtaining a mapping coordinate of the operation point in the offset coordinate system, and positioning the offset operation point according to the mapping coordinate system, thereby realizing automatic positioning after three-dimensional offset or rotation of the operation point. Specifically, after obtaining the offset coordinates, the offset coordinate system, and the offset operation point coordinate data of the offset mark point, the data are stored in a local storage unit (DB or register), the latest coordinate data refreshed in real time are stored locally, and the operation triggering after each offset of self-positioning is performed only once and is in the ms-level.
Referring to fig. 4, in an embodiment, step S140 includes steps S141 and S142.
And S141, establishing an offset coordinate system based on the offset coordinates of the mark points through a language setFrame instruction of VAL 3.
And S142, transforming the coordinate system through a VAL3 language link instruction, acquiring the mapping coordinate of the operating point in the offset coordinate system, and positioning the offset operating point according to the mapping coordinate.
In this embodiment, the execution plan is written as a corresponding instruction in advance, after the coordinates of the offset mark points are obtained, an offset coordinate system Frame _ a is established based on the coordinates of the three offset mark points through a start Frame instruction in VAL3 language, after the offset coordinate system Frame _ a is established, the coordinate system is transformed through a link instruction in VAL3 language, the mapping coordinates of the operation point in the offset coordinate system are obtained, and the offset operation point is located according to the mapping coordinates, so that the automatic positioning of the operation point is realized.
The three marking points are selected on the operation platform in advance, the original coordinate system is established according to the marking points, the original coordinates of the operation points in the original coordinate system are obtained, when the operation platform deviates or rotates, the deviation coordinate system is established according to the deviation coordinates of the mark points after deviation, then the mapping coordinates of the operation points in the deviation coordinate system can be obtained through coordinate system transformation, and the three-dimensional deviation or rotation automatic positioning of the operation points can be realized according to the mapping coordinates, so that the efficient and high-quality processing of the robot is ensured.
Fig. 5 is a schematic block diagram of a robot coordinate self-positioning device based on VAL3 language according to an embodiment of the present invention. As shown in fig. 5, the invention further provides a robot coordinate self-positioning device based on VAL3 language, corresponding to the above robot coordinate self-positioning method based on VAL3 language. The VAL3 language-based robot coordinate self-positioning device comprises a unit for executing the VAL3 language-based robot 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. 5, the robot coordinate self-positioning device based on VAL3 language includes an initial setting unit 10, a setup acquisition unit 20, a change monitoring unit 30, and a setup positioning unit 40.
The initial setting unit 10 is configured to set three marking points on the operation platform, and acquire original coordinates of the marking points.
In this embodiment, three fixed points are preselected on the operation platform as mark points, and after the operation platform is three-dimensionally shifted or rotated, the relative position of a plane formed by the three mark points on the operation platform is unchanged, that is, the mutual positional relationship between the operation point and the mark points before the three-dimensionally shifted or rotated is consistent with the positional relationship between the operation point after the shift and the mark points, so that the mark points can be used as reference before and after the operation platform is shifted, the operation point after the shift is positioned according to the shift amounts of the three mark points, and the automatic positioning of the operation platform is realized.
The initial setting unit 10 is further configured to set three different fixed points on the operating platform as mark points, and respectively obtain original coordinates of the mark points.
In this embodiment, three different fixed points are set as the mark points, and the original coordinates of the corresponding mark points are directly obtained by the CCD camera on the operation platform, where the mark points include a mark point a, a mark point b, and a mark point c, a spatial plane can be formed according to the mark point a, the mark point b, and the mark point c, and an original coordinate system is further established.
And the establishing and acquiring unit 20 is used for establishing an original coordinate system according to the original coordinate values of the marking points and acquiring the original coordinates of the operating points in the original coordinate system.
In this embodiment, the coordinate system is a special data structure type in the VAL3 code, and a point includes 6 attributes in a coordinate system, which are coordinate values in 3 coordinate axes and angles with 3 coordinate axes. An original coordinate system Frame _ a is established through a setFrame instruction of the VAL3, input parameters are coordinate values of three points, namely mark points a, b and c, and the setFrame instruction is packaged in the VAL3 in advance.
Referring to fig. 6, in an embodiment, the setup acquisition unit 20 includes a first setup module 21 and a coordinate acquisition module 22.
The first establishing module 21 is configured to establish an original coordinate system based on the original coordinates of the mark points through the start frame instruction in the VAL3 language setFrame.
And the coordinate acquisition module 22 is used for acquiring original coordinates of the operating point in the original coordinate system through a VAL3 language position instruction.
In this embodiment, by writing the execution plan into a corresponding instruction in advance, after the coordinates of the mark points are obtained, the VAL3 language setFrame instruction establishes the original coordinate system Frame _ a based on the coordinate values of the three mark points, and after the original coordinate system Frame _ a is established, the original coordinate values of the current operation point in the original coordinate system Frame _ a are obtained through the position instruction. And the marking bit, the original coordinate system Frame _ a and the coordinate data of the operating point are directly stored in a storage unit (DB or register), so that the robot can be conveniently and directly called from the operating platform locally to perform subsequent data processing, the data do not need to be frequently transmitted through a network (between an upper computer and a PLC), and the positioning efficiency is improved. Specifically, the storage unit includes a DB or a register.
And the change monitoring unit 30 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 three-dimensionally offset or rotated.
In this embodiment, the coordinate change of the mark point is monitored by the CCD camera to determine whether the operation platform is shifted, after three-dimensional shifting or rotation occurs, the mark point becomes a shift mark point, and correspondingly, the mark point a, the mark point B, and the mark point C become a shift mark point a, a shift mark point B, and a shift mark point C, and the shift coordinates of the shift mark point a, the shift mark point B, and the shift mark point C are acquired by the CCD camera.
Referring to fig. 7, in one embodiment, the change monitoring unit 30 includes a real-time acquisition module 31, a coordinate comparison module 32, and an offset acquisition module 33.
And the real-time acquisition module 31 is used for acquiring the real-time coordinates of the mark points through the CCD camera.
And the coordinate comparison module 32 is used for comparing whether the real-time coordinate is consistent with the original coordinate.
And the offset obtaining module 33 is configured to, when the real-time coordinate is inconsistent with the original coordinate, offset the mark point to form an offset mark point, and use the real-time coordinate as an offset coordinate of the offset mark point.
In this embodiment, the CCD camera is used to obtain the real-time coordinates of the mark points on the operation platform, and compare the real-time coordinates with the original coordinates, and when the real-time coordinates are inconsistent with the original coordinates, the mark points are represented to have changed positions, that is, the operation platform rotates after three-dimensional deviation occurs, and the CCD camera is used to obtain the deviation coordinates of the deviated mark points again, so as to automatically position the operation points.
And the establishing and positioning unit 40 is used for establishing an offset coordinate system according to the offset coordinates of the mark points, and acquiring the mapping coordinates of the operation points in the offset coordinate system through coordinate system change to complete positioning.
In this embodiment, after the operation platform is shifted or rotated, the CCD camera and the laser sensor can determine that the position of the operation platform has changed, and the CCD camera obtains the coordinates of the shifted mark A, B, C after the mark a, b, and c are shifted, and a new shifted coordinate system Frame _ a is established by the setFrame instruction again. After obtaining the offset coordinate system Frame _ a, transforming according to the original coordinate system and the offset coordinate system through a VAL3 language link instruction, obtaining a mapping coordinate of the operation point in the offset coordinate system, and positioning the offset operation point according to the mapping coordinate system, thereby realizing automatic positioning after three-dimensional offset or rotation of the operation point. Specifically, after obtaining the offset coordinates, the offset coordinate system, and the offset operation point coordinate data of the offset mark point, the data are stored in a local storage unit (DB or register), the latest coordinate data refreshed in real time are stored locally, and the operation triggering after each offset of self-positioning is performed only once and is in the ms-level.
Referring to fig. 8, in an embodiment, the set-up positioning unit 40 includes a second set-up module 41 and a transformation positioning module 42.
And a second establishing module 41, configured to establish, through the VAL3 language setFrame instruction, an offset coordinate system based on the offset coordinates of the mark point.
And the transformation positioning module 42 is configured to transform the coordinate system through the VAL3 language link instruction, acquire the mapping coordinates of the operation point in the offset coordinate system, and position the offset operation point according to the mapping coordinates.
In this embodiment, the execution plan is written as a corresponding instruction in advance, after the coordinates of the offset mark points are obtained, an offset coordinate system Frame _ a is established based on the coordinates of the three offset mark points through a start Frame instruction in VAL3 language, after the offset coordinate system Frame _ a is established, the coordinate system is transformed through a link instruction in VAL3 language, the mapping coordinates of the operation point in the offset coordinate system are obtained, and the offset operation point is located according to the mapping coordinates, so that the automatic positioning of the operation point is realized.
The three marking points are selected on the operation platform in advance, the original coordinate system is established according to the marking points, the original coordinates of the operation points in the original coordinate system are obtained, when the operation platform deviates or rotates, the deviation coordinate system is established according to the deviation coordinates of the mark points after deviation, then the mapping coordinates of the operation points in the deviation coordinate system can be obtained through coordinate system transformation, and the three-dimensional deviation or rotation automatic positioning of the operation points can be realized according to the mapping coordinates, so that the efficient and high-quality processing of the robot is ensured.
It should be noted that, as will be clear to those skilled in the art, for the concrete implementation process of the robot coordinate self-positioning apparatus and each unit based on the VAL3 language, reference may be made 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. 9, fig. 9 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. 9, 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 robot coordinate self-positioning method based on the VAL3 language.
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 may be enabled to execute a robot coordinate self-positioning method based on the VAL3 language.
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. 9 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer 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.