Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a sweeping robot recharging method and a sweeping robot recharging device that overcome or at least partially solve the above problems.
In order to solve the above problems, an embodiment of the present invention discloses a recharging method for a sweeping robot, in which a preset charging seat projects a two-dimensional code onto a ceiling, an image sensor is disposed on the sweeping robot, and the charging seat is used for charging the sweeping robot, and the recharging method includes: continuously adopting the image sensor to acquire the relative angle information of the two-dimensional code; and controlling the sweeping robot to move so that the relative angle information is changed according to preset information.
Further, be equipped with first receiver on the charging seat, be equipped with first signal transmitter on the robot of sweeping the floor, control the robot of sweeping the floor removes for after the step that relative angle information changes according to the preset information, include:
when the first receiver receives a first signal sent by the first signal transmitter, an accurate path is generated according to the first signal.
Further, the step of continuously adopting the image sensor to acquire the relative angle information of the two-dimensional code comprises:
continuously adopting the image sensor to acquire an initial image;
performing line detection on the initial image to obtain a line detection image;
performing quadrilateral detection on the line detection image, and screening out a two-dimensional code picture;
and calculating the relative angle information of the two-dimensional code according to the homography matrix and the external parameters of the two-dimensional code picture.
Further, the relative angle information includes a course angle, a pitch angle and a roll angle, and the step of controlling the sweeping robot to move so that the relative angle information changes according to preset information includes:
and controlling the sweeping robot to move, so that the course angle and the roll angle are kept unchanged, and only the pitch angle is continuously reduced.
The embodiment of the invention discloses a floor sweeping robot recharging device, wherein a preset charging seat projects a two-dimensional code to a ceiling, an image sensor is arranged on a floor sweeping robot, and the charging seat is used for charging the floor sweeping robot, and the floor sweeping robot recharging device comprises:
the image acquisition module is used for continuously acquiring the relative angle information of the two-dimensional code by adopting the image sensor;
and the movement control module is used for controlling the sweeping robot to move so that the relative angle information changes according to preset information.
Further, be equipped with first receiver on the charging seat, be equipped with first signal transmitter on the robot of sweeping the floor, still include:
and the fine positioning module is used for generating a fine path according to the first signal when the first receiver receives the first signal sent by the first signal transmitter.
Further, the image acquisition module comprises:
the image acquisition unit is used for continuously acquiring initial images by adopting the image sensor;
the line detection unit is used for carrying out line detection on the initial image to obtain a line detection image;
the quadrangle detection unit is used for carrying out quadrangle detection on the line detection image and screening out a two-dimensional code picture;
and the angle calculation unit is used for calculating the relative angle information of the two-dimensional code according to the homography matrix and the external parameters of the two-dimensional code picture.
Further, the relative angle information includes a heading angle, a pitch angle and a roll angle, and the motion control module includes:
and the movement control unit is used for controlling the sweeping robot to move, so that the course angle and the roll angle are kept unchanged, and only the pitch angle is continuously reduced.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the floor sweeping robot recharging method disclosed by any one of claims 1 to 4 are realized.
The embodiment of the invention discloses a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the floor sweeping robot recharging method of any one of claims 1 to 4.
The embodiment of the invention has the following advantages: through detecting the change of the relative angle between the sweeping robot and the two-dimensional code, the change of the relative angle is controlled so as to control the sweeping robot to be close to the charging seat for charging. The recharging efficiency of the sweeping robot and the positioning precision of the sweeping robot are improved.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
One of the core ideas of the embodiments of the present invention is, as shown in fig. 1, to provide a method for recharging a sweeping robot, where a preset charging seat 2 projects a two-dimensional code 1 onto a ceiling, an image sensor 4 is disposed on a sweeping robot 5, and the charging seat 2 is configured to charge the sweeping robot 5, and includes: continuously adopting the image sensor 4 to acquire the relative angle information of the two-dimensional code 1; and controlling the sweeping robot 5 to move so that the relative angle information is changed according to preset information. Through the change that detects robot 5 and two-dimensional code 1 relative angle of sweeping the floor, the size of control relative angle and then control robot 5 of sweeping the floor is close to charging seat 2 and charges. The recharging efficiency of the sweeping robot 5 and the positioning precision of the sweeping robot are improved.
Referring to fig. 1 to 3, which are flowcharts illustrating steps of an embodiment of a floor sweeping robot recharging method according to the present invention, a preset charging stand 2 projects a two-dimensional code 1 onto a ceiling, an image sensor 4 is disposed on a floor sweeping robot 5, and the charging stand 2 is configured to charge the floor sweeping robot 5, and specifically, the method may include the following steps:
s1, continuously acquiring the relative angle information of the two-dimensional code 1 by using the image sensor 4;
in the embodiment, the laser 3 installed on the charging seat 2 projects the two-dimensional code 1 onto the ceiling, and the image sensor 4 on the sweeping robot 5 can shoot the two-dimensional code 1, and in a specific embodiment, the image sensor 4 adopts a camera mode.
S2, controlling the sweeping robot 5 to move so that the relative angle information changes according to the preset information.
In this embodiment, utilize two-dimensional code location principle can gather the relative angle of 5 relative two-dimensional code 1 of robot of sweeping the floor, and then control the change of relative angle and control 5 removals of robot of sweeping the floor to make robot 5 of sweeping the floor be close to charging seat 2.
In this embodiment, be equipped with first receiver on the charging seat 2, be equipped with first signal transmitter on the robot 5 of sweeping the floor, control robot 5 of sweeping the floor and remove for after the relative angle information is according to the step that preset information changes, include:
when the first receiver receives a first signal sent by the first signal transmitter, an accurate path is generated according to the first signal.
In this embodiment, after adopting two-dimensional code location principle to make robot 5 of sweeping the floor be close to charging seat 2, rethread sensor principle makes robot 5 of sweeping the floor carry out accurate location with charging seat 2. In one embodiment, the charging base 2 has two ir receiving heads, which are aligned with two ir emitting heads of the sweeping robot 5 to complete the charging alignment. After the two-dimensional code positioning enables the sweeping robot 5 to reach the position near the charging seat 2, the infrared sensor is utilized to detect that the sweeping robot 5 has a certain distance from the charging seat 2, and the infrared sensor is utilized to realize final alignment. The two-dimensional code positioning function is to allow the sweeping robot 5 to enter an alignment state quickly, but the final alignment is realized by infrared rays after the sweeping robot approaches the charging stand 2 (with a distance of several centimeters).
The step of continuously adopting image sensor 4 to collect the relative angle information of two-dimensional code 1 includes:
s101, continuously acquiring an initial image by using the image sensor 4;
in the embodiment, the image sensor 4 is used to acquire an initial image with the two-dimensional code 1.
S102, carrying out line detection on the initial image to obtain a line detection image;
and performing line detection on the initial image with the two-dimensional code, wherein the line detection process comprises the steps of calculating the gradient direction and the gradient size of each pixel in the initial image, and then combining adjacent pixel points with similar gradient information into a whole by utilizing the similarity measurement of the pixel point gradients. By adopting a method similar to graph cutting, a node of the graph is a pixel point, and the weight of an edge is the gradient similarity of two pixel points (regions). For pixel (region) n, d (n) represents the gradient direction, m (n) represents the gradient value, and pixel (region) n and pixel (region) m are merged under the condition that:
D(n∪m)≤min(D(n),D(m)+KD/|n∪m|
M(n∪m)≤min(M(n),M(m)+KM/|n∪m|
s103, carrying out quadrilateral detection on the line detection image, and screening out a two-dimensional code picture;
in this embodiment, lines detected in the line detection process are connected by a spatial adjacency criterion to form polygons, the number of the polygons is limited by limiting the side length of the polygons and the number of corner points formed by the polygons, quadrangles are obtained, quadrangles adjacent in space are combined into a new quadrangle, and finally a large quadrangle containing many 0,1 codes (0,1 represents a small quadrangle) is obtained. After the quadrangle is detected, the distance is calculated by comparing the code of the large quadrangle with the preset code type, and a more accurate two-dimensional code detection target is obtained.
S104, calculating the relative angle information of the two-dimensional code according to the homography matrix and the external parameters of the two-dimensional code picture.
The homography matrix represents the secondary transformation performed by projecting the 2D points on the two-dimensional code coordinate system to the camera coordinate system, and can be obtained by a direct linear transformation method. The camera internal parameters are denoted by P and comprise a camera focal length and a center deviation. The external reference is denoted by E. The homography matrix can be written as follows:
wherein R isij(i, j ═ 0,1,2) represents the rotation parameter, Tk(k ═ x, y, z) represents the translation parameters.
Since the column of the rotation matrix must be the unit size, the size and direction of s can be obtained according to the corresponding direction information of the two-dimensional code and the camera (the two-dimensional code appears in front of the camera). The third column of the rotation matrix can be recovered by calculating the cross product of the two known columns, since the rotated column matrix must be orthogonal.
Thereby, the relative positional relationship of the two-dimensional code 1 with respect to the camera can be obtained.
In this embodiment, the step of controlling the sweeping robot 5 to move so that the relative angle information changes according to the preset information includes:
and controlling the sweeping robot to move, so that the course angle and the roll angle are kept unchanged, and only the pitch angle is continuously reduced.
When the robot moves, the angles in three directions represent the angle state of the robot. The angle of the sweeper relative to the two-dimensional code is a roll angle roll, a course angle yaw and a pitch angle pitch.
In the state that the sweeping robot 5 and the charging stand 2 are aligned, only the pitch angle pitch changes, and the roll angle roll and the course angle yaw do not change, so as to determine whether the sweeping robot 5 and the charging stand 2 are aligned.
The robot 5 of sweeping the floor is equipped with the gyroscope that is used for planning and cleans the route in, according to different periods the coordinate of two-dimensional code calculates first contained angle, laser instrument 3 with the line of two-dimensional code 1 is first line segment, two-dimensional code 1 with the line of robot 5 of sweeping the floor is the second line segment, the step that first contained angle is first line segment with the contained angle of second line segment includes:
updating angle information of the gyroscope according to the change amount of the first angle.
The coordinates of the sweeping robot 5 are known relative to the two-dimensional code 1, and since the ceiling is horizontal to the floor, the two-dimensional code coordinate system can be directly converted to the floor coordinate system. The two-dimensional code 1 is sent by the charging seat 2, and when the sweeping robot 5 is started, the relative angle between the sweeping robot 5 and the two-dimensional code 1 is recorded. After the sweeping robot 5 cleans for a period of time, the two-dimensional code is identified through the camera, and the relative angle is calculated. And comparing the relative angle with the initial relative angle, wherein the relative angle change is the angle change of the sweeper in the period of time, so that the angle information of the gyroscope of the sweeper is updated. For calibrating the gyroscope.
The laser 3 is installed to charging seat 2 center department, because the ceiling is flat mostly, laser 3 can be with two-dimensional code 1 projection to the ceiling, and charging seat 2 is leaned on the wall and places, so the installation angle need have certain slope to guarantee that two-dimensional code 1 can project the ceiling completely. The angle should not be too steep to ensure that the two-dimensional code 1 is on the ceiling above the charging stand 2, rather than far away.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 4 to 5, which are block diagrams illustrating structural diagrams of an embodiment of a recharging device for a sweeping robot according to the present invention, a preset charging seat projects a two-dimensional code onto a ceiling, an image sensor is disposed on the sweeping robot, and the charging seat is configured to charge the sweeping robot, and specifically includes the following modules:
the image acquisition module 100 is configured to continuously acquire the relative angle information of the two-dimensional code by using the image sensor;
and the movement control module 200 is used for controlling the sweeping robot to move so that the relative angle information changes according to preset information.
In this embodiment, be equipped with first receiver on the charging seat, it is equipped with first signal transmitter on the robot to sweep the floor, still includes:
and the fine positioning module is used for generating a fine path according to the first signal when the first receiver receives the first signal sent by the first signal transmitter.
In this embodiment, the image capturing module 100 includes:
the image acquisition unit 101 is used for continuously acquiring an initial image by adopting the image sensor;
a line detection unit 102, configured to perform line detection on the initial image to obtain a line detection image;
a quadrangle detection unit 103, configured to perform quadrangle detection on the line detection image, and screen out a two-dimensional code picture;
and the angle calculating unit 104 is configured to calculate the relative angle information of the two-dimensional code according to the homography matrix and the external parameter of the two-dimensional code picture.
In this embodiment, the relative angle information includes a heading angle, a pitch angle, and a roll angle, and the movement control module includes:
and the movement control unit is used for controlling the sweeping robot to move, so that the course angle and the roll angle are kept unchanged, and only the pitch angle is continuously reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the floor sweeping robot recharging method are realized.
The embodiment of the invention discloses a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the sweeping robot recharging method are realized.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The sweeping robot recharging method and the sweeping robot recharging device provided by the invention are described in detail, specific examples are applied in the description to explain the principle and the implementation mode of the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.