[go: up one dir, main page]

CN110202948B - Positioning method, positioning device, handheld equipment and storage medium - Google Patents

Positioning method, positioning device, handheld equipment and storage medium Download PDF

Info

Publication number
CN110202948B
CN110202948B CN201910475999.8A CN201910475999A CN110202948B CN 110202948 B CN110202948 B CN 110202948B CN 201910475999 A CN201910475999 A CN 201910475999A CN 110202948 B CN110202948 B CN 110202948B
Authority
CN
China
Prior art keywords
displacement
displacement sensor
determining
parameter
absolute coordinate
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
CN201910475999.8A
Other languages
Chinese (zh)
Other versions
CN110202948A (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.)
Zhuhai Bencai Electronics Co ltd
Original Assignee
Zhuhai Bentsai Printing Technology 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 Zhuhai Bentsai Printing Technology Co ltd filed Critical Zhuhai Bentsai Printing Technology Co ltd
Priority to CN201910475999.8A priority Critical patent/CN110202948B/en
Publication of CN110202948A publication Critical patent/CN110202948A/en
Application granted granted Critical
Publication of CN110202948B publication Critical patent/CN110202948B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41JTYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
    • B41J2/00Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed
    • B41J2/005Typewriters or selective printing mechanisms characterised by the printing or marking process for which they are designed characterised by bringing liquid or particles selectively into contact with a printing material
    • B41J2/01Ink jet
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41JTYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
    • B41J29/00Details of, or accessories for, typewriters or selective printing mechanisms not otherwise provided for
    • B41J29/38Drives, motors, controls or automatic cut-off devices for the entire printing mechanism
    • B41J29/393Devices for controlling or analysing the entire machine ; Controlling or analysing mechanical parameters involving printing of test patterns
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41JTYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
    • B41J3/00Typewriters or selective printing or marking mechanisms characterised by the purpose for which they are constructed
    • B41J3/36Typewriters or selective printing or marking mechanisms characterised by the purpose for which they are constructed for portability, i.e. hand-held printers or laptop printers

Landscapes

  • Length Measuring Devices With Unspecified Measuring Means (AREA)

Abstract

The application provides a positioning method, a positioning device, handheld equipment and a storage medium. The positioning method comprises the following steps: acquiring a first displacement parameter and a second displacement parameter returned for the Nth time by the first displacement sensor and the second displacement sensor on the operation plane; determining a first inclination angle of the first displacement sensor and a first inclination angle of the second displacement sensor relative to the initial position at the current position according to the first displacement parameter and the second displacement parameter, and determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor; and respectively determining a first absolute coordinate position and a second absolute coordinate position of the first displacement sensor according to the first displacement linear distance, the second displacement linear distance and the first inclination angle. Therefore, compared with the prior art, the device does not need to be positioned by arranging the X-axis mechanical positioning aid and the Y-axis mechanical positioning aid, the device cost can be effectively reduced, and the application scene of the device is not limited any more.

Description

Positioning method, positioning device, handheld equipment and storage medium
Technical Field
The present application relates to the field of handheld device positioning, and in particular, to a positioning method, an apparatus, a handheld device, and a storage medium.
Background
At present, equipment moving on a plane is positioned, on one hand, the equipment can be positioned by arranging an X-axis mechanical positioning aid and a Y-axis mechanical positioning aid, however, the equipment is positioned by adopting the X-axis mechanical positioning aid and the Y-axis mechanical positioning aid, the cost is higher, and an application scene is limited by the X-axis mechanical positioning aid and the Y-axis mechanical positioning aid. On the other hand, the displacement image of the surface image of the object can be picked up by using an equipment platform with an optical imaging system and converted into a corresponding coordinate position, so that the positioning is realized. Although the cost can be reduced by means of optical imaging, the positioning accuracy is low.
Disclosure of Invention
In view of this, the positioning method, the positioning apparatus, the handheld device, and the storage medium provided in the embodiments of the present application are used to improve the positioning accuracy of the device on the premise of reducing the device cost.
In a first aspect, a positioning method provided in an embodiment of the present application is applied to a handheld device, where the handheld device includes at least two displacement sensors, where the at least two displacement sensors include a first displacement sensor and a second displacement sensor, and the method includes: acquiring a first displacement parameter and a second displacement parameter returned for the Nth time on an operation plane by the first displacement sensor and the second displacement sensor, wherein the first displacement parameter comprises a first horizontal axis displacement and a first longitudinal axis displacement, the second displacement parameter comprises a second horizontal axis displacement and a second longitudinal axis displacement, and N is an integer greater than 1; determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter; determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
In the implementation process, a first displacement parameter and a second displacement parameter returned for the nth time by the first displacement sensor and the second displacement sensor on an operation plane are obtained, so that a first inclination angle of the current position of the first displacement sensor and the second displacement sensor relative to an initial position is determined, a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor are respectively determined according to the first displacement parameter and the second displacement parameter, and a first absolute coordinate position of the first displacement sensor on the operation plane at the current position is determined according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle, so as to determine the absolute coordinate position of the handheld device on the operation plane through the absolute coordinate positions of the first sensor and the second sensor. Compared with the prior art, on one hand, the equipment does not need to be positioned by arranging the X-axis and Y-axis mechanical positioning aids, so that the equipment cost can be effectively reduced, and the application scene of the equipment is not limited any more; on the other hand, the tilt angle for each position can be accurately calculated, thereby operating without having to keep the apparatus vertical, parallel, or at a fixed tilt angle.
With reference to the first aspect, this embodiment provides a first possible implementation manner of the first aspect, where the determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle includes: determining an included angle between the second displacement sensor at the current position and the second displacement sensor at the initial position based on a trigonometric function and the displacement linear distance; determining a horizontal axis displacement component and a vertical axis displacement component of the second displacement sensor on the operation plane at the current position based on the included angle, the first inclination angle and the displacement straight-line distance; acquiring the historical absolute coordinate position of the second displacement sensor on an operation plane at the Mth time, wherein M is equal to N minus 1; and accumulating the historical horizontal axis displacement component and the historical vertical axis displacement component in the historical absolute coordinate position with the horizontal axis displacement component and the vertical axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane.
In the implementation process, an included angle between the second displacement sensor and the second displacement sensor at the initial position is determined based on a trigonometric function and the displacement linear distance, a transverse axis displacement component and a longitudinal axis displacement component of the second displacement sensor at the current position are determined based on the included angle, the first inclination angle and the displacement linear distance, a historical absolute coordinate position of the second displacement sensor on the operation plane is obtained for the Mth time, and a second absolute coordinate position is calculated according to the historical absolute coordinate position and the transverse axis displacement component and the longitudinal axis displacement component at the current position, so that the current position of the second displacement sensor can be accurately located.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present application provides a second possible implementation manner of the first aspect, where the adding the historical lateral axis displacement component and the historical longitudinal axis displacement component in the historical absolute coordinate position to the lateral axis displacement component and the longitudinal axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane includes: adding the historical horizontal axis displacement component in the historical absolute coordinate position and the horizontal axis displacement component corresponding to the second displacement sensor in the current position to obtain a horizontal axis absolute coordinate; adding the longitudinal axis displacement component in the historical absolute coordinate position to the longitudinal axis displacement component corresponding to the second displacement sensor in the current position to obtain a longitudinal axis absolute coordinate; and determining a second absolute coordinate position of the second displacement sensor on the operation plane according to the absolute coordinates of the horizontal axis and the absolute coordinates of the vertical axis.
With reference to the second possible implementation manner of the first aspect, an application example provides a third possible implementation manner of the first aspect, where the determining, according to the first displacement parameter and the second displacement parameter, a first inclination angle of the first displacement sensor and the second displacement sensor at a current position relative to an initial position includes: determining a third inclination angle of the first displacement sensor and the second displacement sensor relative to the current position at the Mth time according to the first displacement parameter and the second displacement parameter; acquiring initial inclination angles of the first displacement sensor and the second displacement sensor relative to the initial position respectively at the Mth time; determining a first tilt angle of the current position relative to the initial position based on the third tilt angle and the initial tilt angle.
In the implementation process, after the first inclination angle of the current position relative to the previous position is calculated, the third inclination angle of the current position relative to the initial position can be obtained by accumulating the initial inclination angle of the previous position relative to the initial position and the first inclination angle, and then the inclination angle of the handheld device relative to the initial position at any position can be rapidly determined.
With reference to any one implementation manner of the first aspect, an embodiment of the present application provides a fourth possible implementation manner of the first aspect, where the method further includes: and determining the absolute coordinate position of the handheld device on the operation plane according to the first absolute coordinate position and the second absolute coordinate position.
In the implementation process, the absolute coordinate position of the handheld device on the operation plane is determined by utilizing the first absolute coordinate position and the second absolute coordinate position, so that the device is not required to be positioned by arranging an X-axis mechanical positioning aid and a Y-axis mechanical positioning aid on one hand, the cost of the device can be effectively reduced, and the application scene of the device is not limited any more.
With reference to the fourth possible implementation manner of the first aspect, this application provides a fifth possible implementation manner of the first aspect, where the determining an absolute coordinate position of the handheld device on the operation plane according to the first absolute coordinate position and the second absolute coordinate position includes: acquiring the relative positions of the first displacement sensor and the second displacement sensor relative to the handheld device; and determining the absolute coordinate position of the handheld device on the operation plane according to the relative position, the first absolute coordinate position and the second absolute coordinate position.
In the implementation process, the relative positions of the handheld device, the first displacement sensor and the second displacement sensor are utilized, so that the absolute coordinate position of the handheld device on the operation plane is determined according to the relative position, the first absolute coordinate position and the second absolute coordinate position, and therefore on one hand, the device does not need to be positioned by arranging an X-axis mechanical positioning aid and a Y-axis mechanical positioning aid, the cost of the device can be effectively reduced, and the application scene of the device is not limited any more.
With reference to the fifth possible implementation manner of the first aspect, an embodiment of the present application provides a sixth possible implementation manner of the first aspect, where the handheld device is a handheld printer, and the method further includes: and printing according to the absolute coordinate position.
In the implementation process, the printing is carried out through the absolute coordinate position, so that even when the handheld printer is inclined, the handheld printer still can accurately print. Therefore, the handheld printer is not required to be operated under the condition of keeping the handheld printer vertical, parallel or fixed inclination angle during printing, and the operation of a user is facilitated.
With reference to the sixth possible implementation manner of the first aspect, an embodiment of the present application provides a seventh possible implementation manner of the first aspect, and the initial position is a position of the handheld printer when printing on the operation plane for the first time.
With reference to the third possible implementation manner of the first aspect, this application example provides an eighth possible implementation manner of the first aspect, and the determining, according to the first displacement parameter and the second displacement parameter, a third inclination angle of the first displacement sensor and the second displacement sensor with respect to a position where the current position is located at the mth time includes: determining a first linear distance between the first displacement sensor and the second displacement sensor; forming a right-angle triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and the first straight-line distance as a hypotenuse; determining the side lengths of two right-angle sides of the right-angle triangle according to the first displacement parameter and the second displacement parameter; determining the angle value of any acute angle in the right-angled triangle according to the side length of the right-angled side; and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
In the implementation process, a right-angle triangle is formed by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and taking the first straight-line distance as a hypotenuse; therefore, any acute angle of the right triangle is calculated to serve as a third inclination angle, and the inclination angle of the handheld device at the current position relative to the previous position (namely the position of the first sensor and the second sensor at the Mth time) can be determined quickly and accurately.
With reference to the third possible implementation manner of the first aspect, this application example provides a ninth possible implementation manner of the first aspect, where the determining, according to the first displacement parameter and the second displacement parameter, a third inclination angle of the first displacement sensor and the second displacement sensor with respect to a position where the current position is located at the mth time includes: vertically moving the second displacement sensor in the current position to the same horizontal position as the second displacement sensor in the previous position, the distance between the second displacement sensor and the first displacement sensor being a fixed value; determining a first target displacement parameter of the first displacement sensor and a second target displacement parameter of the second displacement sensor after the movement in the current position; determining a right-angled triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes; determining the side lengths of two right-angle sides of the right-angle triangle according to the first target displacement parameter and the second target displacement parameter; determining the angle value of any acute angle in the right-angled triangle according to the side length; and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
In the implementation process, after the second displacement sensor in the current position is vertically moved to the same horizontal position as the second displacement sensor in the previous position, the third inclination angle of the handheld device at the current position relative to the position of the handheld device at the mth time is determined, so that the complexity of data processing can be simplified, the data processing time can be shortened, and the resource overhead can be saved.
In a second aspect, a positioning apparatus provided in an embodiment of the present application is applied to a handheld device, the handheld device includes at least two displacement sensors, where the at least two displacement sensors include a first displacement sensor and a second displacement sensor, the apparatus includes: an obtaining unit, configured to obtain a first displacement parameter and a second displacement parameter of an nth return of the first displacement sensor and the second displacement sensor on an operation plane, where the first displacement parameter includes a first horizontal axis displacement amount and a first vertical axis displacement amount, the second displacement parameter includes a second horizontal axis displacement amount and a second vertical axis displacement amount, and N is an integer greater than 1; the first processing unit is used for determining a first inclination angle of the first displacement sensor and the second displacement sensor relative to an initial position at the current position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter; a second processing unit, configured to determine a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
In a third aspect, an embodiment of the present application provides a handheld device, including: a first displacement sensor, a second displacement sensor, and a processor, the first and second displacement sensors being in communication with the processor, respectively; the processor is configured to: acquiring a first displacement parameter and a second displacement parameter returned for the Nth time on an operation plane by the first displacement sensor and the second displacement sensor, wherein the first displacement parameter comprises a first horizontal axis displacement and a first longitudinal axis displacement, the second displacement parameter comprises a second horizontal axis displacement and a second longitudinal axis displacement, and N is an integer greater than 1; determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter; determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
In a fourth aspect, an embodiment of the present application provides a computer storage medium, where a computer program is stored, and when the computer program is executed by a processor, the positioning method according to any one of the above first aspects is performed.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic structural diagram of a handheld device provided in an embodiment of the present application;
FIG. 2 is a functional block diagram of the handheld device shown in FIG. 1;
fig. 3 is a flowchart of a positioning method according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating the determination of the inclination angle between the current position and the previous position in the positioning method shown in FIG. 3;
FIG. 5 is a schematic diagram of another method for determining the tilt angle between the current position and the previous position in the positioning method shown in FIG. 4;
FIG. 6 is a schematic diagram of the positioning method of FIG. 3 after vertically translating the first and second displacement sensors in the current position;
FIG. 7 is a schematic diagram of the positioning method of FIG. 3 after vertically translating the first and second displacement sensors in the current position;
FIG. 8 is a schematic diagram illustrating a movement from a current position to a next position in the positioning method shown in FIG. 3;
FIG. 9 is a diagram of a plurality of positions in the positioning method shown in FIG. 3 in the same coordinate system;
FIG. 10 is a schematic diagram illustrating calculation of linear distance of displacement in the positioning method shown in FIG. 3;
FIG. 11 is a schematic diagram illustrating the calculation of displacement components in the positioning method shown in FIG. 3;
FIG. 12 is a schematic diagram of any point on the handheld device in absolute coordinates in the positioning method shown in FIG. 3;
fig. 13 is a functional block diagram of a positioning device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1 and fig. 2, which are schematic structural diagrams of a handheld device according to an embodiment of the present disclosure, the handheld device 100 includes at least two displacement sensors, which include a first displacement sensor 110 and a second displacement sensor 120; at least one processor 130, such as a Central Processing Unit (CPU). The first displacement sensor 110 and the second displacement sensor 120 are connected to the processor 130, and are configured to send the displacement amounts acquired by the first displacement sensor and the second displacement sensor to the processor 130.
Alternatively, the handheld device 100 may also be referred to as a mobile device, for example, the handheld device 100 fixed on a certain axis of movement may be referred to as a mobile device.
Optionally, the handheld device 100 comprises a handheld printing device.
Optionally, the handheld printing device is a handheld printer, such as a handheld die-jet ink printer.
Optionally, the first displacement sensor 110 and the second displacement sensor 120 are mounted in the handheld device 100 at intervals.
Alternatively, the first displacement sensor 110 and the second displacement sensor 120 are both XY axis displacement sensors (i.e., sensors capable of measuring the amount of displacement of the horizontal axis and the vertical axis).
Alternatively, the setting of the separation distance between the first displacement sensor 110 and the second displacement sensor 120 may be set according to actual requirements, and is not particularly limited herein.
Optionally, the first displacement sensor 110 and the second displacement sensor 120 are both used to acquire, in real time, the displacement moved in the operation plane, which includes the horizontal axis displacement and the vertical axis displacement.
Alternatively, the operating plane may be a plane printed by a hand-held die-jet ink printer.
Of course, in practical use, the operation plane may be a curved surface. At this time, the first displacement sensor 110 and the second displacement sensor 120 are disposed in the hand-held device 100 by the floating mechanism.
In the following description, a printed plane where the handheld die-jet ink printer is located is taken as an example.
Alternatively, the floating mechanism may be a spring, such as a spring with one end fixed in the handheld device 100 and the other end used to fix the first displacement sensor 110 or the second displacement sensor 120. Here, the number of the carbon atoms is not particularly limited.
It should be noted that in the embodiment of the present application, the number of the displacement sensors may be multiple, and two displacement sensors (the first displacement sensor 110 and the second displacement sensor 120) are taken as an example to be described below.
Optionally, the processor 130 is configured to determine the tilt angle of the handheld device 100 at the current position relative to the previous position according to the displacement amounts returned by the first displacement sensor 110 and the second displacement sensor 120. In particular, the processor 130 is configured to perform the following method: acquiring a first displacement parameter and a second displacement parameter returned for the Nth time on an operation plane by the first displacement sensor and the second displacement sensor, wherein the first displacement parameter comprises a first horizontal axis displacement and a first longitudinal axis displacement, the second displacement parameter comprises a second horizontal axis displacement and a second longitudinal axis displacement, and N is an integer greater than 1; determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter; determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
It is understood that the configuration shown in fig. 2 is merely a schematic diagram of the handheld device 100, and that the handheld device 100 may include more or less components than those shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
Optionally, the processing procedure of the processor 130, please refer to the flowchart of the positioning method shown in fig. 3, which includes the following steps:
step S101, acquiring a first displacement parameter and a second displacement parameter of the first displacement sensor and the second displacement sensor which return for the Nth time on the operation plane.
Optionally, the first displacement parameter comprises a first horizontal axis displacement and a first vertical axis displacement, and the second displacement parameter comprises a second horizontal axis displacement and a second vertical axis displacement.
Alternatively, the first and second longitudinal axis displacements may be negative numbers, e.g., when moving down from a previous position, the first and second longitudinal axis displacements are represented by negative numbers.
Alternatively, the first and second displacement sensors may report back the displacement parameter more than 1000 times per second.
Optionally, N is an integer greater than 1. For example, at the current time, the first displacement parameter returned by the first displacement sensor is the 3 rd return of that sensor. It will be appreciated that there are displacement parameters in the handheld device that register each return of the first and second displacement sensors.
Of course, these displacement parameters may also be recorded in the first and second displacement sensors. For example, the first sensor records the displacement parameter of each return, and the second sensor also records the displacement parameter of each return.
It is to be understood that the above examples are illustrative only and not limiting.
Alternatively, the time interval between the previous position (i.e. the position corresponding to the mth returned data of the sensor, where M is N-1) and the current position (i.e. the nth) may be only one thousandth of a second, however, in order to better describe the position relationship between the previous position and the current position, the previous position and the current position are enlarged, as shown in fig. 4, which represents a schematic diagram of the first displacement sensor and the second displacement sensor moving from the previous position to the current position on the operation plane.
Step S102, determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter.
Alternatively, the first inclination angle may also be referred to as a rotation angle, and is used to represent an inclination angle of the first displacement sensor and the second displacement sensor relative to the initial position after the first displacement sensor and the second displacement sensor are moved (or rotated) from the initial position to the current position. I.e. an angle of inclination relative to the initial position, after the handheld device has been moved (or rotated) from the initial position to the current position.
As an embodiment, determining a first inclination angle of the first displacement sensor and the second displacement sensor at a current position relative to an initial position according to the first displacement parameter and the second displacement parameter includes: determining a third inclination angle of the first displacement sensor and the second displacement sensor relative to the current position at the Mth time according to the first displacement parameter and the second displacement parameter; acquiring initial inclination angles of the first displacement sensor and the second displacement sensor relative to the initial position respectively at the Mth time; determining a first tilt angle of the current position relative to the initial position based on the third tilt angle and the initial tilt angle.
Alternatively, M ═ N-1.
For example, as shown in FIG. 9, assuming that the position corresponding to the Mth time is the previous position, when the first displacement sensor (S) is usedA) And the second displacement sensor (S)B) After the handheld device moves from the previous position to the current position on the operation plane, a third inclination angle of the handheld device at the current position relative to the position at the mth time (the mth time position, which may be referred to as the previous position hereinafter) can be calculated through the first displacement parameter and the second displacement parameter, for example, R shown in the figure2. Since the initial inclination of the previous position relative to the initial position is known (or calculated, if there is no historical data, the initial inclination may be calculated according to a calculation method for the third inclination, and this is not specifically limited), then, the third inclination and the initial inclination are added to obtain the first inclination of the current position relative to the initial position. Therefore, after calculating the first inclination angle of the current position relative to the previous position, the inclination angles of other positions relative to any position can be determined in an accumulation modeThe inclination of the position. For example, if there are N-1 positions before the current position, the inclination angle of the current position relative to the initial position is the sum of the inclination angle corresponding to the current position and the inclination angles of the first N-1 positions.
Continuing by way of example, as shown in FIG. 4, a first displacement sensor (S)A) And the second displacement sensor (S)B) After the handheld device moves from the previous position to the current position on the operation plane, a third inclination angle of the handheld device at the current position relative to the position at the Mth time can be calculated through the first displacement parameter and the second displacement parameter, for example, K is shown in the figure2
Optionally, determining a third inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the position at the mth time according to the first displacement parameter and the second displacement parameter comprises: determining a first linear distance between the first displacement sensor and the second displacement sensor; forming a right-angle triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and the first straight-line distance as a hypotenuse; determining the side lengths of two right-angle sides of the right-angle triangle according to the first displacement parameter and the second displacement parameter; determining the angle value of any acute angle in the right-angled triangle according to the side length of the right-angled side; and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
Optionally, determining a first linear distance between the first displacement sensor and the second displacement sensor comprises: determining a first linear distance between the first and second displacement sensors based on a first displacement parameter and the second displacement parameter. For example, a first linear distance between two coordinates (a first displacement parameter and the second displacement parameter) is determined from the two coordinates already present.
Optionally, the first linear distance is a connection line of a center point of the first displacement sensor and a center point of the second displacement sensor.
It should be noted that, when the first linear distance is calculated by the first displacement parameter and the second displacement parameter, the size of the sensor itself is ignored.
In the implementation process, by calculating the first linear distance between the first displacement sensor and the second displacement sensor in real time, the inaccurate calculation caused by the change of the distance between the first displacement sensor and the second displacement sensor due to the position separation of a certain displacement sensor can be effectively avoided, and the calculation accuracy of the third inclination angle is further improved. For example, the linear distance between the first displacement sensor and the second displacement sensor is a initially, but after a certain time of use, the linear distance between the first displacement sensor and the second displacement sensor becomes short or side length due to loose connection with the handheld device, and if the linear distance a is continuously used, the actually measured first tilt angle is inaccurate.
Optionally, determining a first linear distance between the first displacement sensor and the second displacement sensor comprises: a first linear distance between the first displacement sensor and the second displacement sensor is read from a database.
Wherein the first displacement sensor and the second displacement sensor, after being mounted to the handheld device, have determined a first linear distance between the first displacement sensor and the second displacement sensor, which is stored in a database.
In the implementation process, the first linear distance between the first displacement sensor and the second displacement sensor is directly read from the database, so that the resource overhead of the processor can be effectively reduced within an error allowable range.
Continuing with the above example as an example, in fig. 4, in the current position image, the first linear distance is SAAnd SBThe distance between the first displacement sensor and the second displacement sensor is formed by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and taking the first straight line distance as a hypotenuseA right triangle (shown as a dotted line in the figure), and determining the side lengths of two right-angle sides of the right triangle according to the first displacement parameter and the second displacement parameter; the angle value of any acute angle in the right triangle, such as the acute angle K, can be determined by the trigonometric function and the side length of the right-angle side2(ii) a Will K2As a third tilt angle of the handheld device at the current position relative to the position at the mth time (i.e., the tilt angle of the current position relative to the previous position).
Of course, in actual use, a right triangle formed by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and the first straight-line distance as hypotenuse may also be a right triangle formed by broken lines as shown in fig. 5. And calculating the angle value of any acute angle in the right triangle, such as the acute angle K, based on the manner of the above embodiment2(ii) a Will K2As a third tilt angle of the handheld device at the current position relative to the position at the mth time (i.e., the tilt angle of the current position relative to the previous position).
In the implementation process, a right-angle triangle is formed by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and taking the first straight-line distance as a hypotenuse; therefore, any acute angle of the right triangle is calculated to serve as a third inclination angle, and the inclination angle of the handheld device at the current position relative to the previous position can be determined quickly and accurately.
Optionally, determining a third inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the position at the mth time according to the first displacement parameter and the second displacement parameter comprises: vertically moving the second displacement sensor in the current position to the same horizontal position as the second displacement sensor in the previous position, the distance between the second displacement sensor and the first displacement sensor being a fixed value; determining a first target displacement parameter of the first displacement sensor and a second target displacement parameter of the second displacement sensor after the movement in the current position; determining a right-angled triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes; determining the side lengths of two right-angle sides of the right-angle triangle according to the first target displacement parameter and the second target displacement parameter; determining the angle value of any acute angle in the right-angled triangle according to the side length; and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
Alternatively, the same horizontal position refers to a horizontal plane on which the abscissa of the second displacement sensor is located in the previous position.
For example, as shown in fig. 6, after the first displacement sensor and the second displacement sensor are moved from the previous position to the current position on the operation plane, the first displacement sensor and the second displacement sensor are simultaneously moved vertically upward in the direction of the arrow shown in the current position to the position shown in fig. 7, i.e., the second displacement sensor S in the current positionBWith the second displacement sensor S in the previous positionBAt the same horizontal position. After the movement, a first target displacement parameter after the first displacement sensor moves and a second target displacement parameter after the second displacement sensor moves are determined according to the moved distance, the first displacement parameter and the second displacement parameter. For example, in the current position, the first displacement sensor SAIs (Xa2, Ya2), and a second displacement sensor SBIs (Xb2, Yb2), and assuming that the moving distance is Yb2, the first target displacement parameter is (Xa2, Ya2-Yb2), and the second target displacement parameter is (Xb2, 0); determining a right-angled triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes; determining the side lengths (d 1 and d2 respectively) of two right-angle sides of the right-angle triangle according to the first target displacement parameter and the second target displacement parameter; determining the angle value of any acute angle in the right triangle, e.g. K, based on the side length2(ii) a The K is added2As the handheld device is opposite to the current positionA third inclination of the position at the mth time (i.e., an inclination of the current position with respect to the previous position).
Of course, in actual use, the determination of the distance of movement includes: the movement distance is determined based on the second displacement parameter and a third displacement parameter of the second displacement sensor in the previous position.
For example, assume a second displacement sensor SBThe third displacement parameter in the previous position is (Xb1, Yb1), then the travel distance is Yb2-Yb 1.
Optionally, during data processing, the third displacement parameter (Xb1, Yb1) in the previous position may be set to (0, 0), that is, the previous position is used as the origin, so that the calculation is simpler, and the complexity can be effectively reduced.
As an implementation scenario, as shown in FIG. 8, when the first displacement sensor and the second displacement sensor are moved from the current position to the next position on the operation plane, the tilt angle K of the handheld device at the next position relative to the current position3The data processing procedure in (2) may refer to the description of the above bits, and is not described herein again. The inclination angle of the next position relative to the previous position is equal to the first inclination angle and K3And (4) summing.
In the implementation process, after the second displacement sensor in the current position is vertically moved to the same horizontal position as the second displacement sensor in the previous position, the third inclination angle of the position of the handheld device in the current position at the mth time is determined, so that the complexity of data processing can be simplified, the data processing time can be shortened, and the resource overhead can be saved.
Optionally, determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter respectively includes: and determining a first displacement linear distance corresponding to the first displacement sensor according to the first displacement parameter, and determining a second displacement linear distance corresponding to the second displacement sensor according to the second displacement parameter.
Taking either the first displacement sensor or the second displacement sensor as an example, as shown in fig. 10, assuming that the displacement amount (i.e. the second displacement parameter) responded by the second displacement sensor-B N-th time is (Xn, Yn), the actual displacement distance (i.e. the second displacement linear distance) Sn of the sensor-B is:
Figure BDA0002081166280000121
it should be understood that based on the above analysis, it is known how to derive the first linear distance of displacement, and for the sake of avoiding redundancy, it will not be described here.
Continuing with the above example, after Sn is known, angle θ can be found from the trigonometric function.
Step S103, determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
Optionally, the current location refers to a location corresponding to the handheld device at the current time. Which may also be referred to as the absolute coordinate position of the handheld device in the operation plane.
How to obtain the absolute coordinate position is described below by taking either the first displacement sensor or the second displacement sensor as an example.
Optionally, determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle comprises: determining an included angle between the second displacement sensor at the current position and the second displacement sensor at the initial position based on a trigonometric function and the displacement linear distance; determining a horizontal axis displacement component and a vertical axis displacement component of the second displacement sensor on the operation plane at the current position based on the included angle, the first inclination angle and the displacement straight-line distance; acquiring the historical absolute coordinate position of the second displacement sensor on an operation plane at the Mth time, wherein M is equal to N minus 1; and accumulating the historical horizontal axis displacement component and the historical vertical axis displacement component in the historical absolute coordinate position with the horizontal axis displacement component and the vertical axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane.
Alternatively, the angle refers to θ above (refer to fig. 10).
Alternatively, the horizontal axis displacement component refers to a displacement component of the second displacement sensor on the horizontal axis of the absolute coordinate plane with the operation plane as the absolute coordinate plane and the second displacement parameter as the coordinate point. Similarly, the longitudinal axis displacement component refers to a displacement component of the second displacement sensor on the longitudinal axis of the absolute coordinate plane with the operating plane as the absolute coordinate plane and the second displacement parameter as the coordinate point.
For example, as shown in FIG. 11, the second displacement sensor S is in an initial position on an absolute coordinate plane (including the absolute coordinate X and the absolute coordinate Y)BWhen the value of γ is known, the X-axis component XAn of the displacement of the second displacement sensor in the absolute coordinate and the Y-axis component Yan in the absolute coordinate in the nth return data can be calculated using Sn (displacement linear distance), γ and a trigonometric function, specifically, using Sn as a hypotenuse and γ and α + β as γ and α + β, respectively, from the trigonometric function, and included angles of XAn and Yan can be obtained.
It should be understood that the method of obtaining the transverse axis displacement component and the longitudinal axis displacement component of the first displacement sensor in the operating plane may refer to the above description, and will not be described here in order to avoid redundancy.
Optionally, the adding the historical horizontal axis displacement component and the historical vertical axis displacement component in the historical absolute coordinate position and the horizontal axis displacement component and the vertical axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane includes: adding the historical horizontal axis displacement component in the historical absolute coordinate position and the horizontal axis displacement component corresponding to the second displacement sensor in the current position to obtain a horizontal axis absolute coordinate; adding the longitudinal axis displacement component in the historical absolute coordinate position to the longitudinal axis displacement component corresponding to the second displacement sensor in the current position to obtain a longitudinal axis absolute coordinate; and determining a second absolute coordinate position of the second displacement sensor on the operation plane according to the absolute coordinates of the horizontal axis and the absolute coordinates of the vertical axis.
Optionally, if M is 0, it indicates that the mth corresponding position is the initial position, and at this time, the historical absolute coordinate position is the coordinate of the second displacement sensor on the operation plane. If M is equal to 2, the historical absolute coordinate position comprises two historical positions divided by the initial position, namely two historical absolute coordinate positions exist, at the moment, the second absolute coordinate position is equal to the sum of the historical horizontal axis displacement component in the two historical absolute coordinate positions and the horizontal axis displacement component corresponding to the second displacement sensor in the current position respectively, and the horizontal axis absolute coordinate is obtained; adding the longitudinal axis displacement components in the two historical absolute coordinate positions to the longitudinal axis displacement component corresponding to the second displacement sensor in the current position to obtain a longitudinal axis absolute coordinate; and determining a second absolute coordinate position of the second displacement sensor on the operation plane according to the absolute coordinates of the horizontal axis and the absolute coordinates of the vertical axis.
For example, assuming there is a first historical absolute coordinate position (x3, y3) and a second absolute coordinate position (x2, y2), with a horizontal axis displacement component of x1 and a vertical axis displacement component of y1, then the horizontal axis absolute coordinate at the current position is: x is x3+ x2+ x1, and the absolute coordinate of the vertical axis is: y1+ y2+ y3, the second absolute coordinate position is (x3+ x2+ x1, y1+ y2+ y 3).
Alternatively, the absolute coordinates of the first and second displacement sensors on the operating plane after each movement are stored in the handheld device.
Optionally, the absolute coordinates refer to coordinates of the first displacement sensor, the second displacement sensor and the handheld device on the operation plane.
It should be understood that the method of obtaining the second absolute coordinate position of the first displacement sensor on the operating plane may refer to the above description, and will not be described here in order to avoid redundancy.
In a possible embodiment, the positioning method further includes: and determining the absolute coordinate position of the handheld device on the operation plane according to the first absolute coordinate position and the second absolute coordinate position.
It should be noted that, since the relative positions of the first displacement sensor and the second displacement sensor on the handheld device are known when the handheld device of the first displacement sensor and the second displacement sensor is designed and manufactured, when the first displacement sensor and the second displacement sensor move on the operation plane, the position of the absolute coordinate of each position point on the handheld device on the operation plane can be converted at any time by using the inclination angles and the absolute coordinate positions (the first absolute coordinate position and the second absolute coordinate position) of the first displacement sensor and the second displacement sensor.
For example, as shown in FIG. 12, with sensor-B as the origin of reference coordinates and the coordinates of the mechanism K on the handheld device as (Xk, Yk), the position K (XAk, YAk) in absolute coordinates of the operating plane can be scaled with reference to the above calculations of the horizontal axis displacement component and the vertical axis displacement component.
In the implementation process, as the return speed of the first displacement sensor and the return speed of the second displacement sensor are higher, the time interval between each point in the motion track is shorter, and the error can be reduced.
For example, suppose the sensor reports 1000 coordinates per second, 10cm/1000 is 0.1mm, which is equivalent to drawing a straight line every 0.1mm to describe the movement track. And thus errors can be reduced.
Optionally, the determining an absolute coordinate position of the handheld device on the operation plane according to the first absolute coordinate position and the second absolute coordinate position includes: acquiring the relative positions of the first displacement sensor and the second displacement sensor relative to the handheld device; and determining the absolute coordinate position of the handheld device on the operation plane according to the relative position, the first absolute coordinate position and the second absolute coordinate position.
Optionally, the relative position is pre-stored in the handheld device.
It should be understood that the relative positions of the first and second displacement sensors on the handheld device are known at the time of design and manufacture of the handheld device.
In a possible embodiment, the handheld device is a handheld printer, and the positioning method further includes: and printing according to the absolute coordinate position.
As an application scenario, the handheld device is a handheld printer, and one or more print heads may be installed in the handheld printer, wherein the calculation of the absolute coordinate position of each print head on the operation plane may refer to the above description, so as to determine the absolute coordinate position of each print head in real time, and when the handheld printer moves within the range of the print image, the print information of each absolute coordinate on the moving path may be sent to the print head to print out the image.
In the implementation process, the current position is used for printing, so that even when the handheld printer is inclined, the handheld printer still can accurately print. Therefore, the handheld printer is not required to be operated under the condition of keeping the handheld printer vertical, parallel or fixed inclination angle during printing, and the operation of a user is facilitated.
Optionally, the initial position is a position of the handheld printer when printing on the operation plane for the first time.
According to the positioning method provided by the embodiment of the application, a first displacement parameter and a second displacement parameter returned by the first displacement sensor and the second displacement sensor for the Nth time on an operation plane are obtained, so that a first inclination angle of the first displacement sensor and the second displacement sensor relative to an initial position at the current position is obtained, a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor are respectively determined according to the first displacement parameter and the second displacement parameter, and a first absolute coordinate position of the first displacement sensor on the operation plane at the current position is further determined according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle, so as to determine the absolute coordinate position of the handheld device on the operation plane through the absolute coordinate positions of the first sensor and the second sensor. Compared with the prior art, on one hand, the equipment does not need to be positioned by arranging the X-axis and Y-axis mechanical positioning aids, so that the equipment cost can be effectively reduced, and the application scene of the equipment is not limited any more; on the other hand, the tilt angle for each position can be accurately calculated, thereby operating without having to keep the apparatus vertical, parallel, or at a fixed tilt angle.
Referring to fig. 13, fig. 13 shows a positioning apparatus provided in an embodiment of the present application, it should be understood that the apparatus 300 corresponds to the above-mentioned embodiment of the method of fig. 3, and can perform the steps related to the above-mentioned embodiment of the method, and the specific functions of the apparatus 300 can be referred to the above description, and detailed descriptions are appropriately omitted herein to avoid repetition. The device 300 includes at least one software functional module that can be stored in a memory in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the device 300. Specifically, the apparatus 300 includes:
an obtaining unit 310, configured to obtain a first displacement parameter and a second displacement parameter of an nth return of the first displacement sensor and the second displacement sensor on an operation plane, where the first displacement parameter includes a first horizontal axis displacement and a first vertical axis displacement, the second displacement parameter includes a second horizontal axis displacement and a second vertical axis displacement, and N is an integer greater than 1.
The first processing unit 320 is configured to determine, according to the first displacement parameter and the second displacement parameter, a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to an initial position, and determine, according to the first displacement parameter and the second displacement parameter, a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor, respectively.
A second processing unit 330, configured to determine a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
Optionally, the second processing unit 330 is further configured to determine an included angle between the second displacement sensor at the current position and the second displacement sensor at the initial position based on a trigonometric function and the displacement linear distance; determining a horizontal axis displacement component and a vertical axis displacement component of the second displacement sensor on the operation plane at the current position based on the included angle, the first inclination angle and the displacement straight-line distance; acquiring the historical absolute coordinate position of the second displacement sensor on an operation plane at the Mth time, wherein M is equal to N minus 1; and accumulating the historical horizontal axis displacement component and the historical vertical axis displacement component in the historical absolute coordinate position with the horizontal axis displacement component and the vertical axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane.
Optionally, the adding the historical horizontal axis displacement component and the historical vertical axis displacement component in the historical absolute coordinate position and the horizontal axis displacement component and the vertical axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane includes: adding the historical horizontal axis displacement component in the historical absolute coordinate position and the horizontal axis displacement component corresponding to the second displacement sensor in the current position to obtain a horizontal axis absolute coordinate; adding the longitudinal axis displacement component in the historical absolute coordinate position to the longitudinal axis displacement component corresponding to the second displacement sensor in the current position to obtain a longitudinal axis absolute coordinate; and determining a second absolute coordinate position of the second displacement sensor on the operation plane according to the absolute coordinates of the horizontal axis and the absolute coordinates of the vertical axis.
Optionally, the determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter includes: determining a third inclination angle of the first displacement sensor and the second displacement sensor relative to the current position at the Mth time according to the first displacement parameter and the second displacement parameter; acquiring initial inclination angles of the first displacement sensor and the second displacement sensor relative to the initial position respectively at the Mth time; determining a first tilt angle of the current position relative to the initial position based on the third tilt angle and the initial tilt angle.
In a possible embodiment, the apparatus 300 further comprises: and the third processing unit is used for determining the absolute coordinate position of the handheld device on the operation plane according to the first absolute coordinate position and the second absolute coordinate position.
Optionally, the third processing unit is further configured to: acquiring the relative positions of the first displacement sensor and the second displacement sensor relative to the handheld device; and determining the absolute coordinate position of the handheld device on the operation plane according to the relative position, the first absolute coordinate position and the second absolute coordinate position.
In a possible embodiment, the apparatus 300 further comprises: and the printing unit is used for printing according to the absolute coordinate position when the handheld device is a handheld printer.
Optionally, the initial position is a position of the handheld printer when printing on the operation plane for the first time.
Optionally, the first processing unit 320 is further configured to: determining a first linear distance between the first displacement sensor and the second displacement sensor; forming a right-angle triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and the first straight-line distance as a hypotenuse; determining the side lengths of two right-angle sides of the right-angle triangle according to the first displacement parameter and the second displacement parameter; determining the angle value of any acute angle in the right-angled triangle according to the side length of the right-angled side; and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
Optionally, the first processing unit 320 is further configured to: vertically moving the second displacement sensor in the current position to the same horizontal position as the second displacement sensor in the previous position, the distance between the second displacement sensor and the first displacement sensor being a fixed value; determining a first target displacement parameter of the first displacement sensor and a second target displacement parameter of the second displacement sensor after the movement in the current position; determining a right-angled triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes; determining the side lengths of two right-angle sides of the right-angle triangle according to the first target displacement parameter and the second target displacement parameter; determining the angle value of any acute angle in the right-angled triangle according to the side length; and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
An embodiment of the present application further provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the positioning method shown in fig. 3 is implemented, and details are not repeated here to avoid repetition.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by hardware, or by software plus a necessary general hardware platform, and based on such understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions to enable a computer device (which can be a personal computer, a handheld device, or a network device, etc.) to execute the method of the embodiments of the present application.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

Claims (13)

1. A positioning method applied to a handheld device, wherein the handheld device comprises at least two displacement sensors, and the at least two displacement sensors comprise a first displacement sensor and a second displacement sensor, the method comprising:
acquiring a first displacement parameter and a second displacement parameter returned for the Nth time on an operation plane by the first displacement sensor and the second displacement sensor, wherein the first displacement parameter comprises a first horizontal axis displacement and a first longitudinal axis displacement, the second displacement parameter comprises a second horizontal axis displacement and a second longitudinal axis displacement, and N is an integer greater than 1;
determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter;
determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and the number of the first and second groups,
and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
2. The method of claim 1, wherein said determining a second absolute coordinate position of the second displacement sensor on the operating plane at the current position based on the second linear distance of displacement and the first tilt angle comprises:
determining an included angle between the second displacement sensor at the current position and the second displacement sensor at the initial position based on a trigonometric function and the second displacement linear distance;
determining a horizontal axis displacement component and a vertical axis displacement component of the second displacement sensor on the operating plane at the current position based on the included angle, the first tilt angle and the second displacement linear distance;
acquiring the historical absolute coordinate position of the second displacement sensor on the operation plane at the Mth time, wherein M is equal to N minus 1;
and accumulating the historical horizontal axis displacement component and the historical vertical axis displacement component in the historical absolute coordinate position with the horizontal axis displacement component and the vertical axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operation plane.
3. The method of claim 2, wherein accumulating the historical lateral-axis displacement component and the historical longitudinal-axis displacement component in the historical absolute coordinate position with the lateral-axis displacement component and the longitudinal-axis displacement component corresponding to the second displacement sensor in the current position to obtain a second absolute coordinate position of the second displacement sensor on the operating plane comprises:
adding the historical horizontal axis displacement component in the historical absolute coordinate position and the horizontal axis displacement component corresponding to the second displacement sensor in the current position to obtain a horizontal axis absolute coordinate;
adding the historical longitudinal axis displacement component in the historical absolute coordinate position to the longitudinal axis displacement component corresponding to the second displacement sensor in the current position to obtain a longitudinal axis absolute coordinate;
and determining a second absolute coordinate position of the second displacement sensor on the operation plane according to the absolute coordinates of the horizontal axis and the absolute coordinates of the vertical axis.
4. The method of claim 3, wherein determining a first tilt angle of the first displacement sensor and the second displacement sensor at a current position relative to an initial position based on the first displacement parameter and the second displacement parameter comprises:
determining a third inclination angle of the first displacement sensor and the second displacement sensor relative to the current position at the Mth time according to the first displacement parameter and the second displacement parameter;
acquiring initial inclination angles of the first displacement sensor and the second displacement sensor relative to the initial position respectively at the Mth time;
determining a first tilt angle of the current position relative to the initial position based on the third tilt angle and the initial tilt angle.
5. The method according to any one of claims 1-4, further comprising:
and determining the absolute coordinate position of the handheld device on the operation plane according to the first absolute coordinate position and the second absolute coordinate position.
6. The method of claim 5, wherein determining the absolute coordinate position of the handheld device on the operating plane from the first absolute coordinate position and the second absolute coordinate position comprises:
acquiring the relative positions of the first displacement sensor and the second displacement sensor relative to the handheld device;
and determining the absolute coordinate position of the handheld device on the operation plane according to the relative position, the first absolute coordinate position and the second absolute coordinate position.
7. The method of claim 6, wherein the handheld device is a handheld printer, the method further comprising:
and printing according to the absolute coordinate position.
8. The method of claim 7, wherein the initial position is a position of the handheld printer at a time of initial printing on the operating plane.
9. The method of claim 4, wherein said determining a third tilt angle of the first and second displacement sensors at the current position relative to the position at the mth time based on the first and second displacement parameters comprises:
determining a first linear distance between the first displacement sensor and the second displacement sensor;
forming a right-angle triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes and the first straight-line distance as a hypotenuse;
determining the side lengths of two right-angle sides of the right-angle triangle according to the first displacement parameter and the second displacement parameter;
determining the angle value of any acute angle in the right-angle triangle according to the side lengths of the two right-angle sides;
and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
10. The method of claim 4, wherein said determining a third tilt angle of the first and second displacement sensors at the current position relative to the position at the mth time based on the first and second displacement parameters comprises:
vertically moving the second displacement sensor in the current position to the same horizontal position as the second displacement sensor in the previous position, the distance between the second displacement sensor and the first displacement sensor being a fixed value;
determining a first target displacement parameter of the first displacement sensor and a second target displacement parameter of the second displacement sensor after the movement in the current position;
determining a right-angled triangle by taking the positions of the first displacement sensor and the second displacement sensor as vertexes;
determining the side lengths of two right-angle sides of the right-angle triangle according to the first target displacement parameter and the second target displacement parameter;
determining the angle value of any acute angle in the right-angled triangle according to the side length;
and taking the angle value as a third inclination angle of the current position relative to the position of the first displacement sensor and the second displacement sensor at the Mth time.
11. A positioning apparatus, applied to a handheld device, the handheld device including at least two displacement sensors, the at least two displacement sensors including a first displacement sensor and a second displacement sensor, the apparatus comprising:
an obtaining unit, configured to obtain a first displacement parameter and a second displacement parameter of an nth return of the first displacement sensor and the second displacement sensor on an operation plane, where the first displacement parameter includes a first horizontal axis displacement amount and a first vertical axis displacement amount, the second displacement parameter includes a second horizontal axis displacement amount and a second vertical axis displacement amount, and N is an integer greater than 1;
the first processing unit is used for determining a first inclination angle of the first displacement sensor and the second displacement sensor relative to an initial position at the current position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter;
the second processing unit is used for determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and the number of the first and second groups,
and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
12. A handheld device, comprising: a first displacement sensor, a second displacement sensor, and a processor, the first and second displacement sensors being in communication with the processor, respectively;
the processor is configured to: acquiring a first displacement parameter and a second displacement parameter returned for the Nth time on an operation plane by the first displacement sensor and the second displacement sensor, wherein the first displacement parameter comprises a first horizontal axis displacement and a first longitudinal axis displacement, the second displacement parameter comprises a second horizontal axis displacement and a second longitudinal axis displacement, and N is an integer greater than 1; determining a first inclination angle of the first displacement sensor and the second displacement sensor at the current position relative to the initial position according to the first displacement parameter and the second displacement parameter, and respectively determining a first displacement linear distance corresponding to the first displacement sensor and a second displacement linear distance corresponding to the second displacement sensor according to the first displacement parameter and the second displacement parameter; determining a first absolute coordinate position of the first displacement sensor on the operation plane at the current position according to the first displacement linear distance and the first inclination angle; and determining a second absolute coordinate position of the second displacement sensor on the operation plane at the current position according to the second displacement linear distance and the first inclination angle.
13. A computer storage medium, in which a computer program is stored which, when being executed by a processor, performs a positioning method according to any one of claims 1 to 10.
CN201910475999.8A 2019-05-31 2019-05-31 Positioning method, positioning device, handheld equipment and storage medium Active CN110202948B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910475999.8A CN110202948B (en) 2019-05-31 2019-05-31 Positioning method, positioning device, handheld equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910475999.8A CN110202948B (en) 2019-05-31 2019-05-31 Positioning method, positioning device, handheld equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110202948A CN110202948A (en) 2019-09-06
CN110202948B true CN110202948B (en) 2020-10-02

Family

ID=67790303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910475999.8A Active CN110202948B (en) 2019-05-31 2019-05-31 Positioning method, positioning device, handheld equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110202948B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE523273C2 (en) * 2001-07-13 2004-04-06 Print Dreams Europe Ab Device and method
US8632266B1 (en) * 2007-01-03 2014-01-21 Marvell International Ltd. Printer for a mobile device
CN101668642B (en) * 2007-02-23 2012-10-03 马维尔国际贸易有限公司 Determining positioning of a handheld image translation device
US8079765B1 (en) * 2007-03-02 2011-12-20 Marvell International Ltd. Hand-propelled labeling printer
CN101983130B (en) * 2008-03-18 2013-08-14 马维尔国际贸易有限公司 Handheld mobile printing device capable of real-time in-line tagging of print surfaces
CN105109211A (en) * 2015-09-08 2015-12-02 天津大学 Handheld seal type miniature printer

Also Published As

Publication number Publication date
CN110202948A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN112507750B (en) System and method for tracking optical codes
US20160236418A1 (en) Error pattern compensation
US7599548B2 (en) Image processing apparatus and image processing method
US20070150194A1 (en) Method for navigation with optical sensors, and a device utilizing the method
CN107976688A (en) Obstacle detection method and related device
US10369781B2 (en) Mobile printers
CN117824666B (en) Two-dimensional code pair for fusion positioning, two-dimensional code calibration method and fusion positioning method
JP2017004228A (en) Trajectory estimation method, trajectory estimation device, and trajectory estimation program
CN114556442A (en) Three-dimensional point cloud segmentation method and device, and movable platform
CN110202948B (en) Positioning method, positioning device, handheld equipment and storage medium
CN113978120A (en) Image alignment method, device and medium based on three-dimensional workbench
CN110930444B (en) Point cloud matching method, medium, terminal and device based on bilateral optimization
CN112419739A (en) Vehicle positioning method and device and electronic equipment
CN109696191B (en) Movement delay measurement method of virtual reality head-mounted display equipment
US11620846B2 (en) Data processing method for multi-sensor fusion, positioning apparatus and virtual reality device
CN114253490B (en) Inkjet printing method, inkjet printing apparatus, electronic device, and computer-readable storage medium
CN110889979B (en) Inland waterway data fusion method and device
CN113344977A (en) Contact pressure measurement model construction method based on image processing
JP5107413B2 (en) Moving distance calculation device and moving distance calculation method
CN113409390A (en) Self-moving tail attitude detection method and device and storage medium
CN113126117A (en) Method for determining absolute scale of SFM map and electronic equipment
WO2018126911A1 (en) Positioning method and apparatus, service processing system and computer readable storage medium
JP5609667B2 (en) Motion estimation apparatus and program
EP3859276A1 (en) Positioning apparatus, recording medium, and positioning method
CN114239302A (en) Closed-loop fitting optimization algorithm

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 519000 area B, 2nd floor, NO.115, Huawei Road, Xiangzhou District, Zhuhai City, Guangdong Province

Patentee after: Zhuhai Bencai Electronics Co.,Ltd.

Address before: 519000 area B, 2nd floor, NO.115, Huawei Road, Xiangzhou District, Zhuhai City, Guangdong Province

Patentee before: ZHUHAI BENTSAI PRINTING TECHNOLOGY Co.,Ltd.