CN113031628A - Position acquisition method of two-dimensional code, electronic device and storage medium - Google Patents
Position acquisition method of two-dimensional code, electronic device and storage medium Download PDFInfo
- Publication number
- CN113031628A CN113031628A CN202110580489.4A CN202110580489A CN113031628A CN 113031628 A CN113031628 A CN 113031628A CN 202110580489 A CN202110580489 A CN 202110580489A CN 113031628 A CN113031628 A CN 113031628A
- Authority
- CN
- China
- Prior art keywords
- edge
- dimensional code
- mileage
- currently
- current
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 72
- 238000005070 sampling Methods 0.000 claims description 20
- 238000005457 optimization Methods 0.000 description 37
- 230000000875 corresponding effect Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000001276 controlling effect Effects 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/02—Control of position or course in two dimensions
- G05D1/021—Control of position or course in two dimensions specially adapted to land vehicles
- G05D1/0231—Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means
- G05D1/0234—Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means using optical markers or beacons
- G05D1/0236—Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means using optical markers or beacons in combination with a laser
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/02—Control of position or course in two dimensions
- G05D1/021—Control of position or course in two dimensions specially adapted to land vehicles
- G05D1/0212—Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
- G05D1/0221—Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory involving a learning process
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05D—SYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
- G05D1/00—Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
- G05D1/02—Control of position or course in two dimensions
- G05D1/021—Control of position or course in two dimensions specially adapted to land vehicles
- G05D1/0276—Control of position or course in two dimensions specially adapted to land vehicles using signals provided by a source external to the vehicle
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10544—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1417—2D bar codes
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Remote Sensing (AREA)
- Aviation & Aerospace Engineering (AREA)
- Radar, Positioning & Navigation (AREA)
- Automation & Control Theory (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Optics & Photonics (AREA)
- Instructional Devices (AREA)
- Navigation (AREA)
Abstract
The application discloses a position obtaining method of a two-dimensional code, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring the mileage of the current edge in the process of moving the target along the two-dimensional code map, wherein the current edge is the edge through which the target passes currently, and two adjacent two-dimensional codes in the two-dimensional code map form one edge; and optimizing the position of the currently passed two-dimensional code by taking the minimum error corresponding to the currently passed edge as a constraint condition, wherein the error corresponding to the edge is the error between the mileage of the edge and the position difference, and the position difference is the difference between the positions of the two-dimensional codes forming the edge. By the mode, the position accuracy of the two-dimensional code can be improved.
Description
Technical Field
The present disclosure relates to the field of automatic control, and in particular, to a method for obtaining a position of a two-dimensional code, an electronic device, and a computer-readable storage medium.
Background
The two-dimensional code map navigation technology is widely applied to the industrial field. In the process of navigating a target (robot) by using a two-dimensional code map, the target needs to shoot and identify a two-dimensional code passing by the target so as to determine the position and posture of the target.
Before navigating a target by using the two-dimensional code map, the two-dimensional code map needs to be constructed in advance. In general, a two-dimensional code is posted in a work area of a target by a person in accordance with a set coordinate system, thereby forming a two-dimensional code map. However, errors may exist in the positions of the two-dimensional codes manually posted, and the accuracy of subsequent target pose determination is affected.
Disclosure of Invention
The application provides a position obtaining method of a two-dimensional code, electronic equipment and a computer readable storage medium, which can solve the problem that the position accuracy of the two-dimensional code in the existing two-dimensional code map is not high.
In order to solve the technical problem, the application adopts a technical scheme that: a position acquisition method of a two-dimensional code is provided. The method comprises the following steps: acquiring the mileage of the current edge in the process of moving the target along the two-dimensional code map, wherein the current edge is the edge through which the target passes currently, and two adjacent two-dimensional codes in the two-dimensional code map form one edge; and optimizing the position of the currently passed two-dimensional code by taking the minimum error corresponding to the currently passed edge as a constraint condition, wherein the error corresponding to the edge is the error between the mileage of the edge and the position difference, and the position difference is the difference between the positions of the two-dimensional codes forming the edge.
In order to solve the above technical problem, another technical solution adopted by the present application is: an electronic device is provided, which comprises a processor and a memory connected with the processor, wherein the memory stores program instructions; the processor is configured to execute the program instructions stored by the memory to implement the above-described method.
In order to solve the above technical problem, the present application adopts another technical solution: there is provided a computer readable storage medium storing program instructions that when executed are capable of implementing the above method.
Through the mode, in the process that the target moves along the two-dimensional code map, the mileage of the edge passed by the target is obtained in real time, and the positions of the two-dimensional codes corresponding to all the edges passed by the target are obtained (gradually optimized) by taking the minimum error between the mileage of all the edges passed by the target and the position difference as a constraint condition. Compared with the mode that the position of the two-dimensional code posted by the related personnel is directly used as the position of the two-dimensional code in the two-dimensional code map, the position accuracy of the two-dimensional code acquired by the method is higher, and the accuracy of the pose acquired by the follow-up target by means of the two-dimensional code can be improved.
Drawings
Fig. 1 is a schematic flowchart of a first embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application;
FIG. 2 is a schematic diagram of a two-dimensional code map of the present application;
fig. 3 is a schematic flowchart of a second embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application;
fig. 4 is a schematic flowchart of a third embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application;
fig. 5 is a schematic flowchart of a fourth embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application;
FIG. 6 is a schematic view of the detailed process of S43 in FIG. 5;
fig. 7 is a schematic flowchart of a fifth embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application;
fig. 8 is a schematic flowchart of a sixth embodiment of a method for obtaining a position of a two-dimensional code in a two-dimensional code map according to the present application;
FIG. 9 is a schematic structural diagram of an embodiment of an electronic device of the present application;
FIG. 10 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Fig. 1 is a schematic flowchart of a first embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 1 is not limited in this embodiment. As shown in fig. 1, the present embodiment may include:
s11: and acquiring the current mileage in the process of moving the target along the two-dimensional code map.
Wherein, the current edge is the edge that the target passes through at present, and two adjacent two-dimensional codes in the two-dimensional code map form an edge.
The target can be any robot with two-dimensional code navigation requirements, and the application is described with the target being an AGV (Automated Guided Vehicle). The automobile body is provided with the odometer (the encoder and the IMU sensor), the encoder is used for obtaining the movement distance of the automobile body, and the IMU sensor is used for obtaining the orientation of the automobile body, so that the movement distance of the automobile body in the orientation can be collected in real time in the movement process of the automobile body and accumulated to obtain the mileage of the current passing edge of the target, namely the mileage between the starting point two-dimensional code and the terminal point two-dimensional code which form the current edge.
The object may pass the current edge one or more times during the movement of the object along the two-dimensional code map. Each time the target passes the current edge, a current mileage can be acquired. The mileage acquired last time through the current is called the latest mileage on the current side, and the mileage acquired historically through the current side is called the historical mileage on the current side.
The current latest mileage can be taken as the current mileage in this step.
Or, in order to improve the accuracy of the current mileage, the average value of the current historical mileage and the current latest mileage may be used as the current mileage in this step. In this case, the implementation manner of this step may be: in the process that the target moves along the two-dimensional code map, obtaining the current latest mileage; and acquiring the average value between the current latest mileage and the current historical mileage as the current mileage. And the current historical mileage is acquired when the target history passes through the current edge.
For example, the average value of the current j-1 historical mileages acquired when the current time passes through the previous time j-1 isThe latest mileage obtained by the current edge the jth time (current time/latest time) isThen, the current mileage in this step is:
in addition, the mileage currently acquired in this stepThe stored current mileage can also be updated afterwards. For example, by usingUpdating the stored current mileage. Or, the current mileage stored at presentIs replaced by。
In addition, the number of times the current edge is passed by the target may also be updated. And updating the number of times that the current edge is passed by the target once every time the current edge is passed by the target, namely adding 1 to the number of times that the current edge is passed by the target. Table 1 below is an example of a storage form of the mileage (x, y, th) of the current edge Edges.
TABLE 1
S12: and optimizing the position of the two-dimensional code which passes through at present by taking the minimum error corresponding to the edge which passes through at present as a constraint condition.
The error corresponding to the edge is the error between the mileage of the edge and the position difference, and the position difference is the difference between the positions of the two-dimensional codes forming the edge.
The two-dimensional code which passes through at present is the two-dimensional code corresponding to the edge which passes through at present. The optimization of the position of the two-dimensional code, which is referred to in the application, is to iteratively update the initial position of the two-dimensional code. The initial position of the two-dimensional code may be randomly assigned, or may be a position of the two-dimensional code posted by a relevant person according to a coordinate system. Generally, the position of the two-dimensional code posted by the relevant person according to the coordinate system is closer to the real position of the two-dimensional code, so that the optimization time can be reduced by taking the two-dimensional code as the initial position of the two-dimensional code. Fig. 2 is a schematic diagram of a two-dimensional code map according to the present application. As shown in FIG. 2, the two-dimensional code map includes 6 two-dimensional codes (A-F).
The sum of squared errors corresponding to the edges that have passed through at present may be used as a target constraint to obtain a target plan:
The error corresponding to the ith edge can be calculated by the following formula:
wherein the ith side consists of a start two-dimensional code a and an end two-dimensional code b,indicating the current sub-optimal pre-a position,indicating the current sub-optimal top b position,indicating the mileage of the ith side.
Using ceres to solve the target plan, an optimization result (updated position of the currently passed two-dimensional code) can be obtained.
In addition, in other embodiments, the optimization result may also be obtained by solving the errors corresponding to all the edges and the target plan with the minimum constraint condition.
As shown in fig. 2, in the two-dimensional code map obtained through optimization, the position of a is (1.0, 1.0, 0.0), the position of B is (2.0, 1.0, 0.0), the position of C is (3.0, 1.0, 0.0), the position of D is (1.0, 0.0, 0.0), the position of E is (2.0, 0.0, 0.0), and the position of F is (3.0, 0.0, 0.0).
Through the implementation of the embodiment, in the process that the target moves along the two-dimensional code map, the mileage of the edge passed by the target is obtained in real time, and the positions of the two-dimensional codes corresponding to all the edges passed by the target are obtained (gradually optimized) by taking the minimum error between the mileage of all the edges passed by the target and the position difference as a constraint condition. Compared with the mode that the position of the two-dimensional code posted by the related personnel is directly used as the position of the two-dimensional code in the two-dimensional code map, the position accuracy of the two-dimensional code acquired by the method is higher, and the accuracy of the pose acquired by the follow-up target by means of the two-dimensional code can be improved.
The execution of the above S11 may be followed by proceeding directly to S12. Alternatively, S12 may be entered if the optimization condition is satisfied. The determination of the optimization condition may be performed in real time. The optimization conditions may include at least one of:
optimizing the condition 1: whether the difference between the current time and the last optimized time is greater than a preset time difference.
In case of optimizing condition 1, the above embodiment may be further extended. The method comprises the following specific steps:
fig. 3 is a schematic flowchart of a second embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 3 is not limited in this embodiment. As shown in fig. 3, the present embodiment may include:
s21: and judging whether the difference between the current time and the last optimized time is larger than a preset time difference.
During the movement of the object, the movement time of the object may be recorded by using a timer. After the last optimization is completed, the time recorded by the timer may be cleared and the recording may be restarted. And when the recorded time is greater than the preset time difference value, determining whether the difference value between the current time and the last optimized time is greater than the preset time difference value. Or, the time recorded by the timer may not be cleared, but the last optimized time is determined according to the time recorded by the timer, and then the difference between the current time recorded by the timer and the last optimized time is determined.
It can be understood that the time between two adjacent optimizations is too short, for example, the target is optimized by passing through a two-dimensional code from the previous optimization, which may cause invalid optimization (i.e. the optimization is not effective), and cause unnecessary resource consumption. The number of optimizations can thus be limited by the time between two consecutive optimizations, i.e. the difference between the current time and the time of the last optimization.
The preset time difference value can be set through the scale of the working area of the target, namely, the preset time difference value is set according to the time required by the target to traverse all the two-dimensional codes in the map once. For example, the preset time difference is 1 hour. Of course, the setting may be made in other ways in other embodiments.
If so, then S22 is performed.
S22: s12 is executed.
Optimization condition 2: the number of effective edges in the currently passed edges is greater than the number of preset edges, and the effective edges are the edges in the currently passed edges, and the number of times of passing by the target is greater than the number of preset times.
In case of optimizing condition 2, the above embodiment may be further extended. The method comprises the following specific steps:
fig. 4 is a schematic flowchart of a third embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 4 is not limited in this embodiment. As shown in fig. 4, the present embodiment may include:
s31: and counting the passing times of each edge in the currently passed edges by the target, and taking the edge with the corresponding times larger than the preset times as an effective edge.
The mileage of the combined edge mentioned above is the latest mileage of the edge, or the average of the latest mileage of the edge and the historical mileage. Thus, the accuracy of the mileage on the edge is positively correlated with the number of times it is passed by the target. The method and the device consider the effective edge as the edge which is passed by at present and meets the requirement on the mileage precision.
S32: and judging whether the number of the effective edges is larger than the preset number of edges.
If so, then S33 is performed.
S33: s12 is executed.
It can be understood that the greater the number of effective edges in the edges that have been currently passed, the better the optimization effect. Therefore, under the condition that the number of the effective edges is larger than the number of the preset edges, the positions of the two-dimensional codes corresponding to the edges which pass through at present are optimized, and the optimization effect can be improved.
The preset number of times needs to be determined before S31. Specifically, the following may be mentioned:
fig. 5 is a schematic flowchart of a fourth embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 5 is not limited in this embodiment. As shown in fig. 5, the present embodiment may include:
s41: and determining a preset path.
The preset path is composed of at least two-dimension codes in the two-dimension code map. The number of the specifically selected two-dimensional codes and the mileage between the two-dimensional codes can be set according to requirements.
S42: and controlling the target to move along the preset path so as to obtain a plurality of sampling mileage of the same edge in the preset path.
S43: and determining the preset times based on the distribution condition of a plurality of sampling mileage on the same edge.
Referring collectively to FIG. 6, this step includes, but is not limited to, achieving the predetermined number of determinations through the following sub-steps.
S431: and acquiring the sampling mean value and the sampling variance of a plurality of sampling mileage.
S432: the maximum difference between the several sampled mileage and the sampled mean is determined.
And respectively obtaining the difference value between each sampling mileage and the sampling average value, and taking the largest one of the obtained sampling mileage and the sampling average value as the largest difference value between the plurality of sampling mileage and the sampling average value.
S433: the preset number of times is determined based on the ratio of the sampling variance to the square of the maximum difference.
The formula according to this step may be as follows:
wherein,the number of times of the preset times is shown,indicates a confidence level ofThe Z-distribution of (a) and (b),the variance of all the sampled mileage is represented,the maximum difference (allowable error) is indicated.
For example, 1000 sampling mileage of the same edge is acquired, the maximum difference is 0.001m, the sampling variance is 0.000001, and the confidence level is selected to be 95%. Then the preset number n =1.96 × 0.000001/(0.001 × 0.001) =3.84 ≈ 4.
Optimization condition 3: the number of loops formed by the edges which are passed by currently is larger than the preset number of loops.
In case of optimization condition 3, the above embodiment can be further extended. The method comprises the following specific steps:
fig. 7 is a schematic flowchart of a fifth embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 7 is not limited in this embodiment. Wherein S51-S52 are steps included before S12, and S53 is a further extension to S12. As shown in fig. 7, the present embodiment may include:
s51: and determining the number of loops formed by the edges which are passed by currently.
It can be understood that if two-dimensional code 1 exists in the two-dimensional code corresponding to the currently passed edge, it is used as the start two-dimensional code of one edge forming the currently passed edge and is also used as the end two-dimensional code of the other edge. That is, the object moves from the two-dimensional code 1, passes through at least two edges, and then returns to the two-dimensional code 1. Then the edge that has currently passed through is said to have a loop consisting of two-dimensional code 1.
The loop formed by edges that have currently passed through may be determined in a traversal manner. The logic of traversal may be as follows:
for each edge, the two-dimensional code of the starting point of the edge is taken as a father node, and the two-dimensional code of the ending point of the edge is taken as a child node. In the traversal process, the state is added for each node to represent the traversal state, and the traversal state has three types. The first is UNVISIT, which is used to indicate that the node has not been traversed; the second is visitation, which is used to represent traversal through the node; the third is VISITED, which represents that all children nodes of the node have been traversed. Performing node traversal by using depth traversal, and setting the node as visibility if the node is UNVISIT; traversing other nodes of the parent node of the node if the node is VISITED; if a reverse edge is found (then the ring is considered to be found), no child nodes are found, then the node is set to VISITED.
The preset number of loops may be determined according to the desired robustness. For example, the preset number of loops is set to 2.
S52: and judging whether the number of the loops formed by the currently passed edges is larger than the preset number of loops or not.
If so, then S53 is performed.
S53: and optimizing the position of the two-dimensional code forming the loop by taking the minimum error corresponding to the edges forming the loop as a constraint condition.
Please refer to the related description of S12 for the formula of this step, which is not described herein.
It can be understood that, in the optimization process, the positions of the two-dimensional codes corresponding to the edges forming the loop may affect each other, that is, the error in the optimization process may be distributed among the positions of the two-dimensional codes in the loop, so that the error of the position of each two-dimensional code in the loop obtained by optimization may be reduced, and the optimization effect may be improved.
In a specific embodiment of the present application, the optimization conditions include the above-described optimization condition 1, optimization condition 2, and optimization condition 3. That is, the optimization is performed in the case where the above three optimization conditions are simultaneously satisfied. In this case, the determination as to whether or not the three optimization conditions are satisfied may be made before S12, where the order of determination of the three optimization conditions is not limited. Taking the determination of the optimization condition 1, the optimization condition 2, and the optimization condition 3 in sequence as an example, the first embodiment can be further extended to the following sixth embodiment.
Fig. 8 is a schematic flowchart of a sixth embodiment of a method for acquiring a position of a two-dimensional code in a two-dimensional code map according to the present application. It should be noted that, if the result is substantially the same, the flow sequence shown in fig. 8 is not limited in this embodiment. As shown in fig. 8, the present embodiment may include:
s61: and acquiring the current mileage in the process of moving the target along the two-dimensional code map.
S62: and judging whether the difference between the current time and the last optimized time is larger than a preset time difference.
If so, then S63 is performed.
S63: and counting the passing times of each edge in the currently passed edges by the target, and taking the edge with the corresponding times larger than the preset times as an effective edge.
S64: and judging whether the number of the effective edges is larger than the preset number of edges.
If so, then S65 is performed.
S65: and judging whether the number of the loops formed by the effective edges is greater than the preset number of loops or not.
If so, then S66 is performed.
S66: and optimizing the position of the two-dimensional code forming the loop by taking the minimum error corresponding to the effective edge forming the loop as a constraint condition.
For a detailed description of the present embodiment, reference is made to the foregoing embodiments, which are not repeated herein.
The following describes a process of acquiring, storing, and updating the mileage by the present application in a specific example. The information of the edge that the target has currently passed is as follows 2:
TABLE 2
Starting point | Terminal point | Latest mileage | Mean value | Number of times | Number of loops |
A | B | (1.01, 0.02,0.0) | (1.01, 0.02,0.0) | AB is passed through for 1 time | 0 |
B | A | (-1.02,-0.01,0.3) | (-1.02,-0.01,0.3) | BA pass 1 time | 1 |
A | B | (1.00, 0.00,0.0) | (1.005,0.01,0.0) | AB is passed for 2 times | 1 |
B | D | (0.00, -1.00,0.0) | (0.00, -1.00,0.0) | AD was passed 1 time | 1 |
D | B | (0.00, 1.00,0.0) | (0.00, 1.00,0.0) | DA was passed through 1 pass | 2 |
The following describes a process of acquiring information of edges as shown in table 2:
moving the target from a to B, obtaining mileage 1= (1.01,0.02,0.0), and storing mileage 1 as the mileage on side AB;
further, the target moves from B to a, and mileage 2= (-1.02, -0.01,0.3) is obtained, and mileage 2 is taken as the mileage by BA. The side that the target has passed through at this time forms a loop A → B → A, and the number of loops is 1;
further, the target moves from a to B, resulting in a mileage of 3= (1.00,0.00, 0.0). The target has now passed the edge AB twice and the average of the mileage 3 and mileage 1 (1.005,0.01,0.0) is calculated and stored as the new edge AB mileage. The number of loops is not increased at this time.
Further, the target moves from B to D, and a mileage of 4= (0.00, -1.00,0.0) is obtained, and the mileage 4 is stored as a mileage by BD. The number of loops is not increased at this time.
Further, the target moves from D to B, and mileage 5= (0.00,1.00,0.0) is obtained, and mileage 5 is stored as the mileage of the side DB. At this time, the side where the target has passed forms another loop a → B → D → B, and the number of loops increases to 2.
The method provided by the application can be applied to the process of constructing the two-dimensional code map. In addition, in the process of navigating the target by using the two-dimensional code map, the situation that the two-dimensional code is damaged and replaced may exist, so that the method provided by the application can also be applied to the process of navigating the target by using the two-dimensional code map.
And navigating the target by using the two-dimensional code map of the working area, so that the target moves along the specified path to finish the work. In the process of constructing the two-dimensional code map, the target can not move according to the designated path, so that a path can be additionally set in the process of constructing the two-dimensional code map, and under the guidance of the path, the edge passed by the target can be more easily an effective edge or a ring, so that the optimization effect is provided.
Fig. 9 is a schematic structural diagram of an embodiment of an electronic device according to the present application. As shown in fig. 9, the electronic device may include a processor 71, a memory 72 coupled to the processor 71.
Wherein the memory 72 stores program instructions for implementing the method of any of the embodiments described above; processor 71 is operative to execute program instructions stored in memory 72 to implement the steps of the above-described method embodiments. The processor 71 may also be referred to as a CPU (Central Processing Unit). The processor 71 may be an integrated circuit chip having signal processing capabilities. The processor 71 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 71 may be any conventional processor or the like.
FIG. 10 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application. As shown in fig. 10, the computer-readable storage medium 80 of the embodiment of the present application stores program instructions 81, and the program instructions 81 implement the method provided by the above-mentioned embodiment of the present application when executed. The program instructions 81 may form a program file stored in the computer-readable storage medium 80 in the form of a software product, so as to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned computer-readable storage medium 80 includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application 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 can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.
Claims (10)
1. A method for acquiring the position of a two-dimensional code in a two-dimensional code map is characterized by comprising the following steps:
acquiring the current mileage in the process of moving a target along a two-dimensional code map, wherein the current mileage is the edge through which the target passes currently, and two adjacent two-dimensional codes in the two-dimensional code map form one edge;
and optimizing the position of the two-dimensional code which passes through at present by taking the minimum error corresponding to the edge which passes through at present as a constraint condition, wherein the error corresponding to the edge is the error between the mileage of the edge and the position difference, and the position difference is the difference between the positions of the two-dimensional codes forming the edge.
2. The method according to claim 1, wherein before optimizing the position of the two-dimensional code that has been currently passed by using the minimum error corresponding to the edge that has been currently passed as a constraint condition, the method comprises:
determining the number of loops formed by the edges which are passed by currently;
the optimizing the position of the two-dimensional code which has passed through currently by using the minimum error corresponding to the edge which has passed through currently as a constraint condition includes:
and if the number of the loops formed by the currently passed edges is larger than the preset number of the loops, optimizing the position of the two-dimensional code forming the loops by taking the minimum error corresponding to the edges forming the loops as a constraint condition.
3. The method according to claim 1, wherein before optimizing the position of the two-dimensional code that has been currently passed by using the minimum error corresponding to the edge that has been currently passed as a constraint condition, the method comprises:
judging whether the difference between the current time and the last optimized time is larger than a preset time difference or not;
and if so, executing the step of optimizing the position of the two-dimensional code which passes through currently by taking the minimum error corresponding to the edge which passes through currently as a constraint condition.
4. The method of claim 3, wherein after the obtaining the current mileage during the movement of the object along the two-dimensional code map, the method further comprises:
updating the stored mileage of the current edge, and/or updating the number of times the current edge is passed by the target.
5. The method according to claim 4, wherein before optimizing the position of the two-dimensional code that has been currently passed by using the minimum error corresponding to the edge that has been currently passed as a constraint condition, the method comprises:
counting the number of times that each edge of the currently passed edges is passed by a target, and taking the corresponding edge of which the number of times is greater than a preset number of times as an effective edge;
judging whether the number of the effective edges is larger than the number of preset edges or not;
and if so, executing the step of optimizing the position of the two-dimensional code which passes through currently by taking the minimum error corresponding to the edge which passes through currently as a constraint condition.
6. The method according to claim 5, wherein before the taking the edge corresponding to the number of times greater than a preset number of times as a valid edge, the method comprises:
determining a preset path, wherein the preset path is composed of at least two-dimension codes in the two-dimension code map;
controlling the target to move along the preset path so as to obtain a plurality of sampling mileage of the same edge in the preset path;
and determining the preset times based on the distribution condition of a plurality of sampling mileage of the same edge.
7. The method according to claim 6, wherein the determining the preset number of times based on the distribution of the sampled mileage of the same edge comprises:
acquiring a sampling mean value and a sampling variance of the plurality of sampling mileage;
determining a maximum difference between the number of sampled miles and the sampled mean;
determining the preset number of times based on a ratio of the sampling variance to a square of the maximum difference.
8. The method of claim 1, wherein the obtaining the current mileage during the movement of the object along the two-dimensional code map comprises:
acquiring the latest mileage of the current edge in the process of the target moving along the two-dimensional code map;
and acquiring an average value between the current latest mileage and the current historical mileage as the current mileage, wherein the current historical mileage is acquired when the target history passes through the current mileage.
9. An electronic device comprising a processor, a memory coupled to the processor, wherein,
the memory stores program instructions;
the processor is configured to execute the program instructions stored by the memory to implement the method of any of claims 1-8.
10. A storage medium, characterized in that the storage medium stores program instructions that, when executed, implement the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110580489.4A CN113031628B (en) | 2021-05-26 | 2021-05-26 | Position acquisition method of two-dimensional code, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110580489.4A CN113031628B (en) | 2021-05-26 | 2021-05-26 | Position acquisition method of two-dimensional code, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113031628A true CN113031628A (en) | 2021-06-25 |
CN113031628B CN113031628B (en) | 2021-10-15 |
Family
ID=76455775
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110580489.4A Active CN113031628B (en) | 2021-05-26 | 2021-05-26 | Position acquisition method of two-dimensional code, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113031628B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090242650A1 (en) * | 2008-03-27 | 2009-10-01 | Denso Wave Incorporated | Two-dimensional code having rectangular region provided with specific patterns for specification of cell postions and distinction from background |
CN103345247A (en) * | 2013-06-20 | 2013-10-09 | 无锡普智联科高新技术有限公司 | Mobile robot positioning method used for correcting code adherence errors |
CN106091924A (en) * | 2016-05-30 | 2016-11-09 | 深圳普智联科机器人技术有限公司 | A kind of system and method using laser-adjusting patch code error |
CN109093621A (en) * | 2018-08-10 | 2018-12-28 | 北京极智嘉科技有限公司 | Robot running precision monitoring method, device, robot, server and medium |
CN109739247A (en) * | 2019-04-02 | 2019-05-10 | 常州市盈能电气有限公司 | Rail mounted crusing robot localization method |
CN109759684A (en) * | 2018-12-28 | 2019-05-17 | 上海理工大学 | The vehicle body auxiliary clamp method of assist people automation arc-welding |
CN110020570A (en) * | 2019-03-29 | 2019-07-16 | 东风设计研究院有限公司 | A kind of two dimensional code two-dimensional positioning system and method for multifunctional lifting slide plate |
CN112462325A (en) * | 2020-11-11 | 2021-03-09 | 清华大学 | Spatial positioning method and device and storage medium |
-
2021
- 2021-05-26 CN CN202110580489.4A patent/CN113031628B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090242650A1 (en) * | 2008-03-27 | 2009-10-01 | Denso Wave Incorporated | Two-dimensional code having rectangular region provided with specific patterns for specification of cell postions and distinction from background |
CN103345247A (en) * | 2013-06-20 | 2013-10-09 | 无锡普智联科高新技术有限公司 | Mobile robot positioning method used for correcting code adherence errors |
CN106091924A (en) * | 2016-05-30 | 2016-11-09 | 深圳普智联科机器人技术有限公司 | A kind of system and method using laser-adjusting patch code error |
CN109093621A (en) * | 2018-08-10 | 2018-12-28 | 北京极智嘉科技有限公司 | Robot running precision monitoring method, device, robot, server and medium |
CN109759684A (en) * | 2018-12-28 | 2019-05-17 | 上海理工大学 | The vehicle body auxiliary clamp method of assist people automation arc-welding |
CN110020570A (en) * | 2019-03-29 | 2019-07-16 | 东风设计研究院有限公司 | A kind of two dimensional code two-dimensional positioning system and method for multifunctional lifting slide plate |
CN109739247A (en) * | 2019-04-02 | 2019-05-10 | 常州市盈能电气有限公司 | Rail mounted crusing robot localization method |
CN112462325A (en) * | 2020-11-11 | 2021-03-09 | 清华大学 | Spatial positioning method and device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113031628B (en) | 2021-10-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111536964B (en) | Robot positioning method and device, and storage medium | |
CN109059924B (en) | Accompanying robot incremental path planning method and system based on A-x algorithm | |
CN211668521U (en) | Automatic guide vehicle for image acquisition and processing system | |
CN110135278B (en) | Obstacle detection method and device and electronic equipment | |
CN113551664A (en) | Map construction method and device, electronic equipment and storage medium | |
CN113475976B (en) | Method and device for determining passable area of robot, storage medium and robot | |
CN113110499B (en) | Determination method of traffic area, route searching method, robot and chip | |
CN114061573A (en) | Ground unmanned vehicle formation positioning device and method | |
CN113031628B (en) | Position acquisition method of two-dimensional code, electronic device and storage medium | |
CN114565670A (en) | Pose optimization method and device | |
CN114222365A (en) | Ultra-wideband positioning method, device, computing unit and system based on single base station | |
JP2016177749A (en) | Mobile body control device, program, and integrated circuit | |
CN118053153A (en) | Point cloud data identification method and device, storage medium and electronic equipment | |
CN115267667B (en) | Underground high-precision positioning correction method, device, equipment and storage medium | |
CN112097772A (en) | Robot and map construction method and device thereof | |
CN110340935B (en) | Robot fusion positioning method and robot | |
CN113588195B (en) | Collision blockage detection method and device | |
CN115982592A (en) | Trajectory similarity calculation method, trajectory similarity calculation device, and storage medium | |
CN116466704A (en) | Obstacle avoidance optimization method, device, equipment and storage medium | |
CN113126117B (en) | Method for determining absolute scale of SFM map and electronic equipment | |
CN114430524A (en) | Ultra-wideband base station calibration method and device and electronic equipment | |
CN109324716B (en) | Touch screen anti-interference method based on hill climbing algorithm, touch device and mobile terminal | |
CN108572939B (en) | VI-SLAM optimization method, device, equipment and computer readable medium | |
CN113297259A (en) | Robot and environment map construction method and device thereof | |
CN114577215B (en) | Method, equipment and medium for updating characteristic map of mobile robot |
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 | ||
CB02 | Change of applicant information |
Address after: 310051 8 / F, building a, 1181 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province Applicant after: Zhejiang Huarui Technology Co.,Ltd. Address before: No. 1199, Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province, 310051 Applicant before: ZHEJIANG HUARAY TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |