CN111178315B - Method and device for identifying corner and computer equipment - Google Patents

Method and device for identifying corner and computer equipment Download PDF

Info

Publication number
CN111178315B
CN111178315B CN202010007032.XA CN202010007032A CN111178315B CN 111178315 B CN111178315 B CN 111178315B CN 202010007032 A CN202010007032 A CN 202010007032A CN 111178315 B CN111178315 B CN 111178315B
Authority
CN
China
Prior art keywords
position coordinate
straight line
corner
wall
sweeping robot
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
CN202010007032.XA
Other languages
Chinese (zh)
Other versions
CN111178315A (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.)
Shenzhen Water World Co Ltd
Original Assignee
Shenzhen Water World 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 Shenzhen Water World Co Ltd filed Critical Shenzhen Water World Co Ltd
Priority to CN202010007032.XA priority Critical patent/CN111178315B/en
Publication of CN111178315A publication Critical patent/CN111178315A/en
Application granted granted Critical
Publication of CN111178315B publication Critical patent/CN111178315B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/35Categorising the entire scene, e.g. birthday party or wedding scene
    • G06V20/36Indoor scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
  • Manipulator (AREA)

Abstract

The application provides a method and a device for identifying a corner and computer equipment. And finally, calculating to obtain an intersection point coordinate between the first straight line and the fourth straight line, wherein the intersection point coordinate corresponds to the intersection of two walls, namely the corner position. According to the method, the first straight line and the second straight line expressed by the equation are obtained through three position coordinates, the intersection point coordinates of the first straight line and the second straight line are calculated through mathematics, the calculation is simple and fast, and the wall angle position is accurately positioned.

Description

Method and device for identifying corner and computer equipment
Technical Field
The application relates to the technical field of floor sweeping robots, in particular to a method and a device for identifying a corner and computer equipment.
Background
The floor sweeping robot is also called an automatic sweeper, an intelligent dust collector, a robot dust collector and the like, is one of intelligent household appliances, and can automatically complete floor sweeping work in a room by means of certain artificial intelligence. The sweeping robot generally adopts a brush sweeping and vacuum mode to absorb the impurities on the ground into the garbage storage box, so that the function of sweeping the ground is completed.
Generally, sweeping robots generally support sweeping along a wall. Being different from other cleaning areas, wall limit department accumulates the dust easily generally, cleans comparatively difficultly, and especially two sides wall limit junction is the corner department, cleans more difficultly.
In prior art, when sweeping along the wall, if the robot that sweeps the floor meets preceding wall in the course of marcing, all direct switch direction is usually continued to sweep along the wall in the front, and then leaves wall angle department to make the region in wall angle department neglected, can't be swept by the robot recognition of sweeping the floor.
Disclosure of Invention
The application mainly aims to provide a wall corner identification method, a wall corner identification device and computer equipment, and aims to overcome the defect that an existing sweeping robot cannot identify a wall corner area.
In order to achieve the above object, the present application provides a method for identifying a corner, which is applied to a sweeping robot, and the method includes:
sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition sequence;
judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line;
if the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, recording the straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly added fourth position coordinate is not on the first straight line;
sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot, and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, recording the straight line where the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line;
and calculating the coordinates of the intersection point of the first straight line and the second straight line, and marking the coordinates of the intersection point as the coordinates of the corner position.
Further, the robot of sweeping the floor includes along the wall sensor, under the state of following the wall, the order acquires the position coordinate of robot of sweeping the floor, until obtaining the step of three position coordinate of robot of sweeping the floor, include:
judging whether the wall-following sensor meets a preset normal state condition or not;
if the wall-following sensor meets the preset normal state condition, entering a wall-following state through the wall-following sensor;
and acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until three position coordinates of the sweeping robot are obtained.
Further, the robot of sweeping the floor still includes collision sensor, judge whether follow the step of wall sensor and satisfy preset normal condition after, include:
if the wall-following sensor does not meet the preset normal state condition, entering a wall-following state through the collision sensor;
when the collision sensor is triggered each time, the current position coordinates of the sweeping robot are recorded until three different position coordinates of the sweeping robot are obtained.
Further, the step of determining whether the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line includes:
calculating the first position coordinate, the second position coordinate and the third position coordinate to obtain a fitting straight line;
calculating the variance of the first, second and third position coordinates to the fitted straight line;
judging whether the variance is larger than a threshold value;
if the variance is greater than a threshold value, determining that the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line;
and if the variance is smaller than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line.
Further, after the step of calculating coordinates of an intersection of the first straight line and the second straight line and marking the coordinates of the intersection as coordinates of a corner position, the method includes:
acquiring the wall-following direction of the sweeping robot in the wall-following state and the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate;
judging whether the wall direction is the same as the rotating direction or not;
if the wall direction is the same as the rotating direction, marking the corner corresponding to the corner position coordinate as a convex angle;
and if the wall-following direction is inconsistent with the rotating direction, marking the corner corresponding to the corner position coordinate as a reentrant corner.
Further, after the step of marking the corner corresponding to the corner position coordinate as a reentrant corner, the method includes:
acquiring the current position coordinate of the sweeping robot;
calculating to obtain a relative position between the current sweeping robot and the corner according to the current position coordinate and the corner position coordinate, wherein the relative position comprises a relative direction and a relative distance;
judging whether the relative distance is greater than a preset distance;
if the relative distance is larger than a preset distance, moving to the corner according to the relative position;
and adjusting the cleaning device to be over against the corner according to the relative direction, and cleaning the corner.
Further, the step of moving to the corner according to the relative position includes:
setting the corner as a track end point according to the relative position;
and cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
The application also provides a device of discernment corner, is applied to the robot of sweeping the floor, the device includes:
the first acquisition module is used for sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition order;
the first judging module is used for judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line;
the first recording module is used for recording a straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line if the first position coordinate, the second position coordinate and the third position coordinate are located on the same straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly-added fourth position coordinate is not located on the first straight line;
the second judging module is used for sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
the second recording module is used for recording a straight line in which the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
and the first calculation module is used for calculating the intersection point coordinates of the first straight line and the second straight line and marking the intersection point coordinates as the corner position coordinates.
Further, the robot of sweeping the floor includes along wall sensor, first acquisition module includes:
the first judging unit is used for judging whether the wall-following sensor meets a preset normal state condition or not;
the first judging unit is used for entering a wall-following state through the wall-following sensor if the wall-following sensor meets a preset normal state condition;
the acquisition unit is used for acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until three different position coordinates of the sweeping robot are obtained.
Further, the robot of sweeping the floor still includes collision sensor, first acquisition module still includes:
the second judging unit is used for entering a wall-following state through the collision sensor if the wall-following sensor does not meet the preset normal state condition;
and the recording unit is used for recording the current position coordinates of the sweeping robot when the collision sensor is triggered each time until the three position coordinates of the sweeping robot are obtained.
Further, the first determining module includes:
the first calculation unit is used for calculating the first position coordinate, the second position coordinate and the third position coordinate to obtain a fitting straight line;
a second calculation unit configured to calculate a variance of the first position coordinate, the second position coordinate, and the third position coordinate to the fitted straight line;
a second judgment unit, configured to judge whether the variance is greater than a threshold;
a third determination unit configured to determine that the first position coordinate, the second position coordinate, and the third position coordinate are not on the same straight line if the variance is greater than a threshold;
a fourth determination unit configured to determine that the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line if the variance is smaller than a threshold.
Further, the apparatus further includes:
the second acquisition module is used for acquiring the wall-following direction of the sweeping robot in the wall-following state and the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate;
the third judging module is used for judging whether the wall direction is the same as the rotating direction;
the first marking module is used for marking the corner corresponding to the corner position coordinate as a convex angle if the wall direction is the same as the rotating direction;
and the second marking module is used for marking the corner corresponding to the corner position coordinate as a reentrant corner if the wall direction is inconsistent with the rotating direction.
Further, the apparatus further includes:
the third acquisition module is used for acquiring the current position coordinate of the sweeping robot;
the second calculation module is used for calculating to obtain the relative position between the current sweeping robot and the corner according to the current position coordinate and the corner position coordinate, wherein the relative position comprises a relative direction and a relative distance;
the fourth judging module is used for judging whether the relative distance is greater than a preset distance;
the movement module is used for moving to the corner according to the relative position if the relative distance is greater than a preset distance;
and the cleaning module is used for adjusting the cleaning device to just face the corner according to the relative direction and cleaning the corner.
Further, the motion module includes:
the setting unit is used for setting the corner as a track end point according to the relative position;
and the fifth judging unit is used for cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
The present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of any of the above.
According to the method, the device and the computer equipment for identifying the corner, the sweeping robot firstly obtains three position coordinates on the same straight line in sequence according to the motion track of the sweeping robot in a wall-following state, and determines a first straight line parallel to the current wall. And when the fourth position coordinate is not monitored to be on the first straight line, judging that the sweeping robot turns at the moment, subsequently acquiring fifth and sixth position coordinates on the same straight line with the fourth position coordinate, determining a second straight line parallel to the turned wall, and finally calculating to obtain an intersection point coordinate between the first straight line and the second straight line according to the first straight line and the second straight line, wherein the intersection point coordinate corresponds to the intersection of two walls, namely the corner position. According to the method, the first straight line and the second straight line expressed by the equation are obtained through three position coordinates, the intersection point coordinates of the first straight line and the second straight line are calculated through mathematics, the calculation is simple and fast, and the wall angle position is accurately positioned.
Drawings
FIG. 1 is a schematic diagram illustrating steps of a method for identifying a corner in an embodiment of the present application;
fig. 2 is a block diagram illustrating an overall structure of an apparatus for identifying a corner according to an embodiment of the present application;
fig. 3 is a block diagram schematically illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the object of the present application will be further explained with reference to the embodiments, and with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
Referring to fig. 1, in an embodiment of the present application, a method for identifying a corner is provided, where the method is applied to a sweeping robot, and the method includes:
s1: sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition sequence;
s2: judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line;
s3: if the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, recording the straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly added fourth position coordinate is not on the first straight line;
s4: sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot, and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
s5: if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, recording the straight line where the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line;
s6: and calculating the coordinates of the intersection point of the first straight line and the second straight line, and marking the coordinates of the intersection point as the coordinates of the corner position.
In this embodiment, when the sweeping robot starts to sweep, a coordinate system is built inside, and the starting point at the beginning of the sweeping robot is used as the origin of coordinates, so that the position of the sweeping robot in a room is monitored. Install along wall sensor and collision sensor on the robot of sweeping the floor, the robot of sweeping the floor when moving to being close to the wall, if along the wall sensor and satisfy predetermined normal condition, can normally send detecting signal, receive feedback signal along the wall sensor promptly and give the treater of robot of sweeping the floor with feedback signal transmission to make the robot of sweeping the floor calculate the real-time distance between self and the wall according to feedback signal, then the robot of sweeping the floorPeople enter a wall-following state through monitoring the distance between the wall-following sensor and the wall in real time, and keep a fixed distance from the wall for cleaning. In the cleaning process, the sweeping robot acquires the position coordinates of the sweeping robot according to a preset time interval sequence until the three position coordinates of the sweeping robot are acquired, and the position coordinates are marked as a first position coordinate, a second position coordinate and a third position coordinate according to the acquisition sequence. If the wall-following sensor cannot work normally, for example, the wall-following sensor cannot send a detection signal, or cannot receive a feedback signal, or cannot transmit the feedback signal to a processor of the sweeping robot, and the like, so that the sweeping robot cannot obtain a real-time distance between the sweeping robot and a wall through the wall-following sensor, the sweeping robot monitors the collision between the sweeping robot and the wall in real time through the collision sensor, and according to a path planning method of 'walking along the wall based on the collision sensor', the collision sensor is used for detecting very close-distance obstacles. If the sweeping robot hits the obstacle in the process of moving forwards towards the target, the sweeping robot walks along the edge of the obstacle, otherwise, the sweeping robot directly walks towards the target, and therefore the sweeping robot enters a wall-following state and is swept along the wall. The sweeping robot records the current position coordinates of the sweeping robot through the collision sensor when colliding with the wall every time until three position coordinates of the sweeping robot are obtained, and the position coordinates are respectively marked as a first position coordinate, a second position coordinate and a third position coordinate according to the obtaining sequence. The sweeping robot judges whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, if the three position coordinates are not on the same straight line, the sweeping robot possibly passes through a corner in the process of moving from the second position coordinate to the third position coordinate. Since any two points can determine a straight line, it is practically infeasible to locate the wall by the straight line determined by the first position coordinate and the second position coordinate. Therefore, the sweeper can only get points again, abandon the first position coordinate and the second position coordinate, take the third position coordinate as the initial position coordinate, namely the new first position coordinate, obtain the new three position coordinates again, and calculate whether the new three position coordinates are the same or notA straight line. And circularly executing the steps by the sweeper until three position coordinates on the same straight line are obtained. In practical use, a developer or a user can set the obtaining frequency of the position coordinates according to the length of the wall, for example, when the length of the wall is small, the obtaining frequency of the position coordinates is increased, so that the sweeper can obtain three position coordinates parallel to the same wall when sweeping along the wall, and the situation that the third position coordinate and the first and second position coordinates are not on the same straight line and the missed wall corner cannot be positioned due to the fact that the sweeper misses the wall corner due to the fact that the obtaining interval of each position coordinate is too long is avoided. Specifically, the method for judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line by the sweeping robot is as follows: the sweeping robot calculates the first position coordinate, the second position coordinate and the third position coordinate by using a least square method to obtain a fitting straight line of the first position coordinate, the second position coordinate and the third position coordinate. Then, the variances of the first, second, and third position coordinates to the fitted straight line are calculated. The sweeping robot calls a preset threshold value and judges whether the variance is larger than the threshold value. If the variance is larger than the threshold value, the sweeping robot judges that the fitted straight line is not a straight line, namely the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line. If the variance is smaller than the threshold value, the sweeping robot judges that the fitting straight line is a straight line, namely the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line. The sweeping robot marks the fitted straight line as a first straight line to obtain a first equation corresponding to the first straight line, and continuously obtains the position coordinate of the sweeping robot according to the method, and judges whether the newly added position coordinate is located on the first straight line. If the sweeping robot monitors that the newly acquired fourth position coordinate is not on the first straight line, it indicates that the sweeping robot turns when moving from the last position coordinate to the fourth position coordinate, that is, the sweeping robot may pass through a corner. At the moment, the sweeping robot sequentially obtains a fifth position coordinate and a sixth position coordinate after the fourth position coordinate according to the method, and calculates a fitting straight line, the variance from a calculation point to the fitting straight line and the threshold valueAnd (4) comparing the fourth position coordinate, the fifth position coordinate and the sixth position coordinate to judge whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line. If the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are not on the same straight line, the situation that the sweeper is likely to turn again at present and passes through a corner is shown. In order to identify the corner coordinate between the third position coordinate and the fourth position coordinate, the sweeper increases the acquiring frequency of the self-acquired position coordinate, shortens the acquiring interval of the position coordinate, and avoids the problem that enough position coordinate points cannot be acquired to fit a straight line due to the fact that the length of the wall is too small. And returning to the fourth position coordinate again, acquiring new fifth and sixth position coordinates again, forming new three position coordinates with the fourth position coordinate, and circulating the straight line judgment method until obtaining the three position coordinates of the sweeper which is turned and positioned on the same straight line. If the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, the sweeping robot records the same straight line of the fourth position coordinate, the fifth position coordinate and the sixth position coordinate as a second straight line, and a second equation corresponding to the second straight line is obtained. The sweeping robot obtains the intersection point coordinates of the first straight line and the second straight line through the first equation and the second equation according to a mathematical method. For example, assume that the first equation is: a. The 1 x+B 1 y+C 1 =0, second equation a 2 x+B 2 y+C 2 And =0, the two equations are combined, and the intersection point coordinates can be obtained by calculating the values of x and y. The first straight line and the second straight line respectively represent the wall along which the sweeping robot follows before turning and the wall along which the sweeping robot follows after turning, so that the coordinate of the intersection point of the first straight line and the second straight line is the coordinate of the intersection of the two walls and the position of a corner.
Further, the robot of sweeping the floor includes along the wall sensor, under the state of following the wall, the order acquireed sweep the position coordinate of robot, until obtaining sweep the step of three position coordinate of robot, include:
s101: judging whether the wall-following sensor meets a preset normal state condition or not;
s102: if the wall-following sensor meets the preset normal state condition, entering a wall-following state through the wall-following sensor;
s103: and acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until the three position coordinates of the sweeping robot are obtained.
In this embodiment, the robot of sweeping the floor includes along the wall sensor, judges when cleaning whether along the wall sensor satisfies predetermined normal condition at present, can normal operating, follows the wall sensor promptly and can normally send detecting signal, receive feedback signal and give the treater of robot of sweeping the floor with feedback signal transmission to make the robot of sweeping the floor calculate the real-time distance between self and the wall according to feedback signal. If the wall-following sensor can normally operate, the sweeping robot enters a wall-following state through the wall-following sensor, and the whole body is swept along the wall. Under the state of being along the wall, the motion trail of the sweeping robot is parallel to the edge of the wall. The sweeping robot acquires the position coordinates of the sweeping robot according to a preset time interval sequence, for example, if the preset time interval is 5s, the sweeping robot records the current position coordinates of the sweeping robot every 5s until three position coordinates are acquired. The follow-up sweeping robot can judge whether the robot turns or not in the process of moving from the first position coordinate to the third position coordinate according to whether the three position coordinates are on the same straight line or not, namely whether the robot passes through a corner or not.
Further, the robot of sweeping the floor still includes collision sensor, judge whether along after the step of wall sensor satisfies predetermined normal condition, include:
s104: if the wall-following sensor does not meet the preset normal state condition, entering a wall-following state through the collision sensor;
s105: when the collision sensor is triggered every time, recording the current position coordinates of the sweeping robot until three different position coordinates of the sweeping robot are obtained.
In this embodiment, the robot of sweeping the floor still includes collision sensor, and the robot of sweeping the floor discerns whether to satisfy predetermined normal condition along wall sensor at present. If the wall-following sensor fails, the sweeping robot recognizes the collision between the robot and the wall through the collision sensor, so that the robot enters a wall-following state and cleans along the wall. In the cleaning process, the cleaning robot collides with the wall. When the collision sensor is triggered every time and the collision between the sweeping robot and the wall is detected, the sweeping robot records the current position coordinate of the sweeping robot, and the position coordinate is the position coordinate of the collision between the sweeping robot and the wall until three position coordinates are obtained. The follow-up sweeping robot can judge whether the robot turns or not in the process of moving from the first position coordinate to the third position coordinate or not according to whether the three position coordinates are on the same straight line or not, namely whether the robot passes through a corner or not.
Further, the step of determining whether the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line includes:
s201: calculating the first position coordinate, the second position coordinate and the third position coordinate to obtain a fitting straight line;
s202: calculating the variance of the first, second and third position coordinates to the fitted straight line;
s203: judging whether the variance is larger than a threshold value;
s204: if the variance is larger than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line;
s205: and if the variance is smaller than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line.
In this embodiment, the three position coordinates acquired by the sweeping robot are the first position coordinate, the second position coordinate and the third position coordinate in sequence according to the acquisition order. The sweeping robot calculates the first position coordinate, the second position coordinate and the third position coordinate by using a least square method to obtain a fitting straight line of the first position coordinate, the second position coordinate and the third position coordinate. The specific calculation process is as follows: knowing N points
Figure 100002_DEST_PATH_IMAGE001
Let the equation of the fitted line be
Figure 208304DEST_PATH_IMAGE002
Then, then
Figure 100002_DEST_PATH_IMAGE003
And
Figure 300605DEST_PATH_IMAGE004
the calculating method comprises the following steps:
Figure 100002_DEST_PATH_IMAGE005
Figure 386373DEST_PATH_IMAGE006
. After the fitting straight line where the first position coordinate, the second position coordinate and the third position coordinate are located is obtained, the sweeping robot calculates the variance from the first position coordinate, the second position coordinate and the third position coordinate to the fitting straight line. The method for calculating the variance between the points and the fitted straight line is the same as that in the prior art, and is not described in detail here. The floor sweeping robot is internally and pre-provided with a threshold value input by a developer, calls the threshold value, compares the variance obtained by calculation with the threshold value, and judges the size between the variance and the threshold value. If the variance is larger than the threshold value, the sweeping robot can judge that the fitted straight line is a straight line according to the existing mathematical method, namely the first position coordinate, the second position coordinate and the third position coordinate are all on the same straight line. And if the variance is smaller than the threshold value, the sweeper judges that the fitted straight line is not a straight line, namely the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line.
Further, after the step of calculating coordinates of an intersection of the first straight line and the second straight line and marking the coordinates of the intersection as coordinates of a corner position, the method includes:
s7: acquiring the wall-following direction of the sweeping robot in the wall-following state and the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate;
s8: judging whether the wall-following direction is the same as the rotating direction;
s9: if the wall direction is the same as the rotating direction, marking the corner corresponding to the corner position coordinate as a convex angle;
s10: and if the wall direction is inconsistent with the rotating direction, marking the corner corresponding to the corner position coordinate as a concave angle.
In this embodiment, after the floor sweeping robot calculates the position coordinates of the corner, it needs to determine whether the corner corresponding to the position coordinates of the corner is a convex corner or a concave corner. Specifically, the sweeping robot obtains an along-wall direction of the sweeping robot when the sweeping robot is in an along-wall state, where the along-wall direction refers to a direction in which the sweeping robot is close to a wall, for example, a right side of the sweeping robot is close to the wall for sweeping, and the along-wall direction is the right side. And the sweeping robot acquires the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate, wherein the rotation direction is the rotation direction of the sweeping robot when the sweeping robot rotates through a corner. The sweeping robot judges whether the wall direction and the rotating direction are the same, and if the wall direction and the rotating direction are the same, the corner is marked as a convex angle; if the wall direction is not the same as the rotation direction, the corner is marked as a reentrant corner. For example, the sweeping robot is right along the wall, and the direction along the wall is right; when the sweeping robot rotates through the corner, the sweeping robot rotates to the right, the rotating direction is the right and is consistent with the wall-following direction, and the corner can be judged to be a convex corner; if the sweeping robot rotates leftwards, the corner of the wall is a concave corner. When the sweeping robot passes through the convex angle, the sweeping robot can sweep cleanly easily; when the concave angle passes through, the shape and the cleaning track of the concave angle are circular, the concave angle is a cleaning dead angle, and the concave angle cannot be cleaned in the preset cleaning track.
Further, after the step of marking the corner corresponding to the corner position coordinate as a reentrant corner, the method includes:
s11: acquiring the current position coordinate of the sweeping robot;
s12: calculating to obtain a relative position between the current sweeping robot and the corner according to the current position coordinate and the corner position coordinate, wherein the relative position comprises a relative direction and a relative distance;
s13: judging whether the relative distance is greater than a preset distance;
s14: if the relative distance is larger than a preset distance, moving to the corner according to the relative position;
s15: and adjusting the cleaning device to be over against the corner according to the relative direction, and cleaning the corner.
In this embodiment, after the robot that sweeps the floor judges that the corner is the reentrant corner, need adjust self position to the corner position, clean it. Specifically, the sweeping robot acquires the current position coordinates of the sweeping robot, and then calculates the relative position between the current sweeping robot and the corner according to the current position coordinates and the corner position coordinates. The relative position includes a relative direction and a relative distance, and the calculation method is the same as the relative direction and the relative distance between two points in the existing calculation coordinate system, which is not described in detail herein. The preset distance is input into the inside of the sweeping robot, and the preset distance is set by a developer according to the extending length of a sweeping device on the sweeping robot. The sweeping robot judges whether the current relative distance is greater than the preset distance or not, if the relative distance is not greater than the preset distance, the fact that the distance between the sweeping robot and a corner is within the extending length of the sweeping device is indicated, and at the moment, the sweeping robot only needs to adjust the sweeping device to the right behind the direction of the corner according to the relative direction, and the sweeping device can directly sweep the corner. If the relative distance is larger than the preset distance, the sweeping robot can sweep after moving to the corner. The sweeping robot can directly adjust the self steering according to the relative direction and then directly move to the corner position for sweeping according to the relative distance. The sweeping robot can sweep other areas firstly, gradually move to the position near a corner, and sweep the corner through the sweeping device after determining that the relative distance between the sweeping robot and the corner is not greater than the preset distance.
Further, the step of moving to the corner according to the relative position includes:
s1401: setting the corner as a track end point according to the relative position;
s1402: and cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
In this embodiment, the robot of sweeping the floor sets up the corner into the orbit terminal point according to relative position, then self cleans according to the bow font orbit to accomplish the coverage of other regions and clean, and real-time supervision self and the relative distance of corner, until moving to the relative distance and be not more than the preset distance, judge that self moves to the corner, clean the corner through cleaning device at last.
According to the method for identifying the corner, when the sweeping robot is in a state of being along the wall, the three position coordinates on the same straight line are sequentially acquired according to the motion track of the sweeping robot, and the first straight line parallel to the current wall is determined. And finally, calculating to obtain an intersection point coordinate between the first straight line and the fourth straight line, wherein the intersection point coordinate corresponds to the intersection of two walls, namely the corner position. According to the method, the first straight line and the second straight line expressed by the equation are obtained through three position coordinates, the intersection point coordinates of the first straight line and the second straight line are calculated through mathematics, the calculation is simple and fast, and the wall angle position is accurately positioned.
Referring to fig. 2, an embodiment of the present application further provides a device for identifying a corner, which is applied to a sweeping robot, and the device includes:
the first acquisition module 1 is used for sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition order;
the first judging module 2 is used for judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line;
the first recording module 3 is configured to record, if the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, that the straight line where the first position coordinate, the second position coordinate and the third position coordinate are located is a first straight line, and continue to obtain the position coordinate of the sweeping robot until a newly added fourth position coordinate is not on the first straight line;
the second judging module 4 is used for sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
a second recording module 5, configured to record, if the fourth position coordinate, the fifth position coordinate, and the sixth position coordinate are on the same straight line, that a straight line where the fourth position coordinate, the fifth position coordinate, and the sixth position coordinate are located is a second straight line;
and the first calculating module 6 is used for calculating the coordinates of the intersection point of the first straight line and the second straight line and marking the coordinates of the intersection point as the coordinates of the corner position.
In this embodiment, when the sweeping robot starts to sweep, a coordinate system is built inside, and the starting point at the beginning of the sweeping robot is used as the origin of coordinates, so that the position of the sweeping robot in a room is monitored. Install along wall sensor and collision sensor on the robot of sweeping the floor, the robot of sweeping the floor is when moving to being close to the wall, if satisfy predetermined normal condition along the wall sensor, can normally send detecting signal along the wall sensor promptly, receive feedback signal, and give the treater of the robot of sweeping the floor with feedback signal transmission, thereby make the robot of sweeping the floor can calculate the real-time distance between self and the wall according to feedback signal, then the robot of sweeping the floor is through the distance between along wall sensor real-time supervision and the wall, get into along the wall state, keep fixed distance with the wall and clean. In the cleaning process, the sweeping robot acquires the sweeping data according to a preset time interval sequenceAnd (4) marking the position coordinates of the sweeping robot as a first position coordinate, a second position coordinate and a third position coordinate respectively according to the acquisition sequence until the three position coordinates of the sweeping robot are obtained. If the wall-following sensor cannot work normally, for example, the wall-following sensor cannot send a detection signal, or cannot receive a feedback signal, or cannot transmit the feedback signal to a processor of the sweeping robot, and the like, so that the sweeping robot cannot obtain a real-time distance between the sweeping robot and a wall through the wall-following sensor, the sweeping robot monitors the collision between the sweeping robot and the wall in real time through the collision sensor, and according to a path planning method of 'walking along the wall based on the collision sensor', the collision sensor is used for detecting very close-distance obstacles. If the sweeping robot hits the obstacle in the process of moving forwards towards the target, the sweeping robot walks along the edge of the obstacle, otherwise, the sweeping robot directly walks towards the target, and therefore the sweeping robot enters a wall-following state and is swept along the wall. The sweeping robot records the current position coordinates of the sweeping robot through a collision sensor when colliding with a wall every time until three position coordinates of the sweeping robot are obtained, and the three position coordinates are respectively marked as a first position coordinate, a second position coordinate and a third position coordinate according to the obtaining sequence. The sweeping robot judges whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, if the three position coordinates are not on the same straight line, the sweeping robot possibly passes through a corner in the process of moving from the second position coordinate to the third position coordinate. Since any two points can determine a straight line, it is practically infeasible to locate the wall by the straight line determined by the first position coordinate and the second position coordinate. Therefore, the sweeper can only get points again, abandon the first position coordinate and the second position coordinate, take the third position coordinate as the initial position coordinate, namely the new first position coordinate, obtain the new three position coordinates again, and calculate whether the new three position coordinates are on the same straight line. And circularly executing the steps by the sweeper until three position coordinates on the same straight line are obtained. In actual use, a developer or a user can set acquisition of position coordinates according to the length of the wallThe frequency is taken, for example, when the length of the wall is small, the frequency for acquiring the position coordinates is increased, so that the sweeper is ensured to acquire three position coordinates parallel to the same wall when sweeping along the wall, and the situation that the third position coordinate and the first and second position coordinates are not on the same straight line and the missed wall corners cannot be positioned due to the fact that the sweeper misses the wall corners because the acquisition interval of each position coordinate is too long is avoided. Specifically, the method for judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line by the sweeping robot is as follows: the sweeping robot calculates the first position coordinate, the second position coordinate and the third position coordinate by using a least square method to obtain a fitting straight line of the first position coordinate, the second position coordinate and the third position coordinate. Then, the variances of the first, second, and third position coordinates to the fitted straight line are calculated. The sweeping robot calls a preset threshold value to judge whether the variance is larger than the threshold value. If the variance is larger than the threshold value, the sweeping robot judges that the fitted straight line is not a straight line, namely the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line. If the variance is smaller than the threshold value, the sweeping robot judges that the fitting straight line is a straight line, namely the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line. The sweeping robot marks the fitted straight line as a first straight line to obtain a first equation corresponding to the first straight line, and continuously obtains the position coordinate of the sweeping robot according to the method, and judges whether the newly added position coordinate is located on the first straight line. If the sweeping robot monitors that the newly acquired fourth position coordinate is not on the first straight line, it indicates that the sweeping robot turns when moving from the previous position coordinate to the fourth position coordinate, that is, the sweeping robot may pass through a corner. At the moment, the sweeping robot sequentially obtains a fifth position coordinate and a sixth position coordinate after the fourth position coordinate according to the method, and judges whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line according to the calculation of the fitting straight line, the variance from the calculation point to the fitting straight line and the comparison with the threshold value. If the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are not on the same straight lineThen, it indicates that the sweeper may turn again and pass through the corner. In order to identify the corner coordinate between the third position coordinate and the fourth position coordinate, the sweeper increases the acquiring frequency of the self-acquired position coordinate, shortens the acquiring interval of the position coordinate, and avoids the problem that enough position coordinate points cannot be acquired to fit a straight line due to the fact that the length of the wall is too small. And returning to the fourth position coordinate again, acquiring new fifth and sixth position coordinates again, forming new three position coordinates with the fourth position coordinate, and circulating the straight line judgment method until obtaining the three position coordinates of the sweeper on the same straight line after steering. If the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, the sweeping robot records the same straight line of the fourth position coordinate, the fifth position coordinate and the sixth position coordinate as a second straight line, and a second equation corresponding to the second straight line is obtained. The floor sweeping robot obtains the coordinates of the intersection point of the first straight line and the second straight line through the first equation and the second equation according to a mathematical method. For example, assume that the first equation is: a. The 1 x+B 1 y+C 1 =0, the second equation being A 2 x+B 2 y+C 2 And =0, the intersection coordinates can be obtained by solving the values of x and y by combining the two equations. The first straight line and the second straight line respectively represent the wall along which the sweeping robot follows before turning and the wall along which the sweeping robot follows after turning, so that the coordinate of the intersection point of the first straight line and the second straight line is the coordinate of the intersection of the two walls and the position of the corner of the wall.
Further, the robot of sweeping the floor includes along wall sensor, first acquisition module 1 includes:
the first judging unit is used for judging whether the wall-following sensor meets a preset normal state condition or not;
the first judging unit is used for entering a wall-following state through the wall-following sensor if the wall-following sensor meets a preset normal state condition;
the acquisition unit is used for acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until the three position coordinates of the sweeping robot are obtained.
In this embodiment, the robot of sweeping the floor includes along the wall sensor, judges when cleaning whether along the current predetermined normal condition that satisfies of wall sensor, can normal operating, can normally send the detected signal promptly along the wall sensor, receive feedback signal, and give the treater of robot of sweeping the floor with feedback signal transmission to make the robot of sweeping the floor calculate the real-time distance between self and the wall according to feedback signal. If the wall-following sensor can normally operate, the sweeping robot enters a wall-following state through the wall-following sensor, and the whole body is swept along the wall. Under the state of wall-following, the motion track of the sweeping robot is parallel to the edge of the wall. The sweeping robot obtains the position coordinates of the sweeping robot according to a preset time interval sequence, for example, if the preset time interval is 5s, the sweeping robot records the current position coordinates of the sweeping robot every 5s until three position coordinates are obtained. The follow-up sweeping robot can judge whether the robot turns or not in the process of moving from the first position coordinate to the third position coordinate according to whether the three position coordinates are on the same straight line or not, namely whether the robot passes through a corner or not.
Further, the robot of sweeping the floor still includes collision sensor, first acquisition module 1 still includes:
the second judgment unit is used for entering a wall-following state through the collision sensor if the wall-following sensor does not meet a preset normal state condition;
and the recording unit is used for recording the current position coordinates of the sweeping robot when the collision sensor is triggered every time until three different position coordinates of the sweeping robot are obtained.
In this embodiment, the robot that sweeps floor still includes collision sensor, and the robot that sweeps floor discerns whether to satisfy predetermined normal condition along the wall sensor at present. If the wall-following sensor fails, the sweeping robot recognizes the collision between the robot and the wall through the collision sensor, so that the robot enters a wall-following state and cleans along the wall. In the cleaning process, the cleaning robot collides with the wall. When the collision sensor is triggered every time and the collision between the sweeping robot and the wall is detected, the sweeping robot records the current position coordinate of the sweeping robot, and the position coordinate is the position coordinate of the collision between the sweeping robot and the wall until three position coordinates are obtained. The follow-up sweeping robot can judge whether the robot turns or not in the process of moving from the first position coordinate to the third position coordinate or not according to whether the three position coordinates are on the same straight line or not, namely whether the robot passes through a corner or not.
Further, the first determining module 2 includes:
the first calculation unit is used for calculating the first position coordinate, the second position coordinate and the third position coordinate to obtain a fitting straight line;
a second calculation unit configured to calculate a variance of the first position coordinate, the second position coordinate, and the third position coordinate to the fitted straight line;
a second judgment unit configured to judge whether the variance is greater than a threshold;
a third determination unit configured to determine that the first position coordinate, the second position coordinate, and the third position coordinate are not on the same straight line if the variance is greater than a threshold;
a fourth determination unit configured to determine that the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line if the variance is smaller than a threshold.
In this embodiment, the three position coordinates acquired by the sweeping robot are, in order of acquisition, the first position coordinate, the second position coordinate, and the third position coordinate. The sweeping robot calculates the first position coordinate, the second position coordinate and the third position coordinate by using a least square method to obtain a fitting straight line of the first position coordinate, the second position coordinate and the third position coordinate. The specific calculation process is as follows: knowing N points
Figure 332332DEST_PATH_IMAGE001
Let the equation of the fitted line be
Figure 743722DEST_PATH_IMAGE002
Then, then
Figure 525864DEST_PATH_IMAGE003
And
Figure 680902DEST_PATH_IMAGE004
the calculation method comprises the following steps:
Figure 481368DEST_PATH_IMAGE005
Figure 329238DEST_PATH_IMAGE006
. After the fitting straight line where the first position coordinate, the second position coordinate and the third position coordinate are located is obtained, the sweeping robot calculates the variance from the first position coordinate, the second position coordinate and the third position coordinate to the fitting straight line. The method for calculating the variance between the points and the fitted straight line is the same as that in the prior art, and is not described in detail here. The floor sweeping robot is internally preset with a threshold value input by a developer, calls the threshold value, compares the variance obtained by calculation with the threshold value, and judges the magnitude between the variance and the threshold value. If the variance is larger than the threshold value, the sweeping robot can judge that the fitted straight line is a straight line according to the existing mathematical method, namely the first position coordinate, the second position coordinate and the third position coordinate are all on the same straight line. And if the variance is smaller than the threshold value, the sweeper judges that the fitted straight line is not a straight line, namely the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line.
Further, the apparatus further includes:
a second obtaining module 7, configured to obtain a wall-following direction of the cleaning robot in the wall-following state, and a rotation direction of the cleaning robot moving from the third position coordinate to the fourth position coordinate;
a third judging module 8, configured to judge whether the wall-following direction is the same as the rotation direction;
the first marking module 9 is configured to mark a corner corresponding to the corner position coordinate as a convex corner if the wall-following direction is the same as the rotating direction;
and the second marking module 10 is configured to mark that the corner corresponding to the corner position coordinate is a reentrant corner if the wall-following direction is inconsistent with the rotation direction.
In this embodiment, after the floor sweeping robot calculates the position coordinates of the corner, it needs to determine whether the corner corresponding to the position coordinates of the corner is a convex corner or a concave corner. Specifically, the sweeping robot obtains an along-wall direction of the sweeping robot in an along-wall state, where the along-wall direction refers to a direction in which the sweeping robot is close to a wall, for example, a right side of the sweeping robot is close to the wall for sweeping, and the along-wall direction is the right side. And the sweeping robot acquires the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate, wherein the rotation direction is the rotation direction of the sweeping robot when the sweeping robot rotates through a corner. The sweeping robot judges whether the wall direction and the rotating direction are the same, and if the wall direction and the rotating direction are the same, the corner is marked as a convex corner; if the wall direction is different from the rotating direction, the corner is marked as a reentrant corner. For example, the sweeping robot is right along the wall, and the direction along the wall is right; when the sweeping robot rotates through the corner, the sweeping robot rotates to the right, the rotating direction is consistent with the wall-following direction, and the corner can be judged to be a convex angle; if the sweeping robot rotates leftwards, the corner is a concave corner. When the sweeping robot passes through the convex angle, the sweeping robot can easily sweep the floor; when the concave angle passes through, the shape and the cleaning track of the concave angle are circular, the concave angle is a cleaning dead angle, and the concave angle cannot be cleaned in the preset cleaning track.
Further, the apparatus further includes:
the third obtaining module 11 is configured to obtain a current position coordinate of the sweeping robot;
the second calculating module 12 is configured to calculate, according to the current position coordinate and the corner position coordinate, a relative position between the current sweeping robot and the corner, where the relative position includes a relative direction and a relative distance;
a fourth judging module 13, configured to judge whether the relative distance is greater than a preset distance;
the movement module 14 is configured to move to the corner according to the relative position if the relative distance is greater than a preset distance;
and the cleaning module 15 is used for adjusting the cleaning device to just face the corner according to the relative direction and cleaning the corner.
In this embodiment, after the robot that sweeps the floor judges that the corner is the reentrant corner, need adjust self position to the corner position, clean it. Specifically, the sweeping robot acquires the current position coordinates of the sweeping robot, and then calculates the relative position between the current sweeping robot and the corner according to the current position coordinates and the corner position coordinates. The relative position includes a relative direction and a relative distance, and the calculation method is the same as the relative direction and the relative distance between two points in the existing calculation coordinate system, which is not described in detail herein. The preset distance is input into the inside of the sweeping robot, and the preset distance is set by a developer according to the extending length of a sweeping device on the sweeping robot. The sweeping robot judges whether the current relative distance is greater than the preset distance or not, if the relative distance is not greater than the preset distance, the fact that the distance between the sweeping robot and a corner is within the extending length of the sweeping device is indicated, and at the moment, the sweeping robot only needs to adjust the sweeping device to the right behind the direction of the corner according to the relative direction, and the sweeping device can directly sweep the corner. If the relative distance is larger than the preset distance, the sweeping robot can sweep after moving to the corner. The sweeping robot can directly adjust the self steering according to the relative direction and then directly move to the corner position for sweeping according to the relative distance. The sweeping robot can sweep other areas firstly, gradually move to the position near a corner, and sweep the corner through the sweeping device after determining that the relative distance between the sweeping robot and the corner is not more than the preset distance.
Further, the motion module 14 includes:
the setting unit is used for setting the corner as a track end point according to the relative position;
and the fifth judging unit is used for cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
In this embodiment, the robot of sweeping the floor sets up the corner into the orbit terminal point according to relative position, then self cleans according to the bow font orbit to accomplish the coverage of other regions and clean, and real-time supervision self and the relative distance of corner, until moving to the relative distance and be not more than the preset distance, judge that self moves to the corner, clean the corner through cleaning device at last.
According to the device for identifying the corner provided by the embodiment, the sweeping robot firstly obtains three position coordinates on the same straight line in sequence according to the motion track of the sweeping robot in a wall-following state, and determines a first straight line parallel to the current wall. And finally, calculating to obtain an intersection point coordinate between the first straight line and the fourth straight line, wherein the intersection point coordinate corresponds to the intersection of two walls, namely the corner position. According to the method, the first straight line and the second straight line expressed by the equation are obtained through three position coordinates, the intersection point coordinates of the first straight line and the second straight line are calculated through mathematics, the calculation is simple and fast, and the wall angle position is accurately positioned.
Referring to fig. 3, a computer device, which may be a server and whose internal structure may be as shown in fig. 3, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data such as threshold values. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a method for identifying a corner, and is applied to a sweeping robot.
The processor executes the method for identifying the corner, and the method comprises the following steps:
s1: sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition sequence;
s2: judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line;
s3: if the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, recording the straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly added fourth position coordinate is not on the first straight line;
s4: sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot, and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
s5: if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, recording the straight line where the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line;
s6: and calculating the coordinates of the intersection point of the first straight line and the second straight line, and marking the coordinates of the intersection point as the coordinates of the corner position.
Further, the robot of sweeping the floor includes along the wall sensor, under the state of following the wall, the order acquireed sweep the position coordinate of robot, until obtaining sweep the step of three position coordinate of robot, include:
s101: judging whether the wall-following sensor meets a preset normal state condition or not;
s102: if the wall-following sensor meets the preset normal state condition, entering a wall-following state through the wall-following sensor;
s103: and acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until the three position coordinates of the sweeping robot are obtained.
Further, the robot of sweeping the floor still includes collision sensor, judge whether follow the step of wall sensor and satisfy preset normal condition after, include:
s104: if the wall-following sensor does not meet the preset normal state condition, entering a wall-following state through the collision sensor;
s105: when the collision sensor is triggered each time, the current position coordinates of the sweeping robot are recorded until three different position coordinates of the sweeping robot are obtained.
Further, the step of determining whether the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line includes:
s201: calculating the first position coordinate, the second position coordinate and the third position coordinate to obtain a fitting straight line;
s202: calculating the variance of the first, second and third position coordinates to the fitted straight line;
s203: judging whether the variance is larger than a threshold value;
s204: if the variance is larger than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line;
s205: and if the variance is smaller than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line.
Further, after the step of calculating coordinates of an intersection of the first straight line and the second straight line and marking the coordinates of the intersection as coordinates of a corner position, the method includes:
s7: acquiring the wall-following direction of the sweeping robot in the wall-following state and the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate;
s8: judging whether the wall-following direction is the same as the rotating direction;
s9: if the wall direction is the same as the rotating direction, marking the corner corresponding to the corner position coordinate as a convex angle;
s10: and if the wall-following direction is inconsistent with the rotating direction, marking the corner corresponding to the corner position coordinate as a reentrant corner.
Further, after the step of marking the corner corresponding to the corner position coordinate as the reentrant corner, the method includes:
s11: acquiring the current position coordinates of the sweeping robot;
s12: calculating to obtain a relative position between the current sweeping robot and the corner according to the current position coordinates and the corner position coordinates, wherein the relative position comprises a relative direction and a relative distance;
s13: judging whether the relative distance is greater than a preset distance;
s14: if the relative distance is larger than a preset distance, moving to the corner according to the relative position;
s15: and adjusting the cleaning device to be opposite to the corner according to the relative direction, and cleaning the corner.
Further, the step of moving to the corner according to the relative position includes:
s1401: setting the corner as a track end point according to the relative position;
s1402: and cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where when the computer program is executed by a processor, the computer program implements a method for identifying a corner, and is applied to a floor sweeping robot, and the method specifically includes:
s1: sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition sequence;
s2: judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line;
s3: if the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, recording the straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly added fourth position coordinate is not on the first straight line;
s4: sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot, and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
s5: if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, recording the straight line where the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line;
s6: and calculating the coordinates of the intersection point of the first straight line and the second straight line, and marking the coordinates of the intersection point as the coordinates of the corner position.
Further, the robot of sweeping the floor includes along the wall sensor, under the state of following the wall, the order acquireed sweep the position coordinate of robot, until obtaining sweep the step of three position coordinate of robot, include:
s101: judging whether the wall-following sensor meets a preset normal state condition or not;
s102: if the wall-following sensor meets the preset normal state condition, entering a wall-following state through the wall-following sensor;
s103: and acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until the three position coordinates of the sweeping robot are obtained.
Further, the robot of sweeping the floor still includes collision sensor, judge whether along after the step of wall sensor satisfies predetermined normal condition, include:
s104: if the wall-following sensor does not meet the preset normal state condition, entering a wall-following state through the collision sensor;
s105: when the collision sensor is triggered each time, the current position coordinates of the sweeping robot are recorded until three different position coordinates of the sweeping robot are obtained.
Further, the step of determining whether the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line includes:
s201: calculating the first position coordinate, the second position coordinate and the third position coordinate to obtain a fitting straight line;
s202: calculating the variance of the first, second and third position coordinates to the fitted straight line;
s203: judging whether the variance is larger than a threshold value;
s204: if the variance is greater than a threshold value, determining that the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line;
s205: and if the variance is smaller than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line.
Further, after the step of calculating coordinates of an intersection of the first straight line and the second straight line and marking the coordinates of the intersection as coordinates of a corner position, the method includes:
s7: acquiring the wall-following direction of the sweeping robot in the wall-following state and the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate;
s8: judging whether the wall direction is the same as the rotating direction or not;
s9: if the wall direction is the same as the rotating direction, marking the corner corresponding to the corner position coordinate as a convex angle;
s10: and if the wall direction is inconsistent with the rotating direction, marking the corner corresponding to the corner position coordinate as a concave angle.
Further, after the step of marking the corner corresponding to the corner position coordinate as a reentrant corner, the method includes:
s11: acquiring the current position coordinate of the sweeping robot;
s12: calculating to obtain a relative position between the current sweeping robot and the corner according to the current position coordinate and the corner position coordinate, wherein the relative position comprises a relative direction and a relative distance;
s13: judging whether the relative distance is greater than a preset distance;
s14: if the relative distance is larger than a preset distance, moving to the corner according to the relative position;
s15: and adjusting the cleaning device to be over against the corner according to the relative direction, and cleaning the corner.
Further, the step of moving to the corner according to the relative position includes:
s1401: setting the corner as a track end point according to the relative position;
s1402: and cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware related to instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and bused dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method 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, apparatus, article, or method. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of another identical element in a process, apparatus, article, or method comprising the element.
The above description is only for the preferred embodiment of the present application and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.

Claims (10)

1. A method for identifying a corner of a wall is applied to a sweeping robot, and comprises the following steps:
sequentially acquiring position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are obtained, wherein the three position coordinates are sequentially a first position coordinate, a second position coordinate and a third position coordinate according to the acquisition sequence;
calculating the first position coordinate, the second position coordinate and the third position coordinate according to the following formula to obtain a fitting straight line:
n points
Figure DEST_PATH_IMAGE001
The equation of the fitted straight line is
Figure 940607DEST_PATH_IMAGE002
Then, then
Figure DEST_PATH_IMAGE003
And
Figure 432768DEST_PATH_IMAGE004
the calculation method comprises the following steps:
Figure DEST_PATH_IMAGE005
Figure 251557DEST_PATH_IMAGE006
judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line or not according to the fitted straight line;
if the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line, recording the straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly added fourth position coordinate is not on the first straight line;
sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot, and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line, recording the straight line where the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line;
and calculating the coordinates of the intersection point of the first straight line and the second straight line, and marking the coordinates of the intersection point as the coordinates of the corner position.
2. The method for identifying the corner of the wall according to claim 1, wherein the sweeping robot comprises a wall-following sensor, and the step of sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are obtained comprises:
judging whether the wall-following sensor meets a preset normal state condition or not;
if the wall-following sensor meets the preset normal state condition, entering a wall-following state through the wall-following sensor;
and acquiring the position coordinates of the sweeping robot according to a preset time interval sequence until three position coordinates of the sweeping robot are obtained.
3. The method for identifying the corner of the wall as claimed in claim 2, wherein the sweeping robot further comprises a collision sensor, and the step of judging whether the along-the-wall sensor meets the preset normal state condition comprises the following steps:
if the wall-following sensor does not meet the preset normal state condition, entering a wall-following state through the collision sensor;
when the collision sensor is triggered each time, the current position coordinates of the sweeping robot are recorded until three different position coordinates of the sweeping robot are obtained.
4. The method of claim 1, wherein the step of determining whether the first position coordinate, the second position coordinate, and the third position coordinate are on the same straight line according to the fitted straight line comprises:
calculating the variance of the first, second and third position coordinates to the fitted straight line;
judging whether the variance is larger than a threshold value;
if the variance is larger than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are not on the same straight line;
and if the variance is smaller than a threshold value, judging that the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line.
5. The method of identifying a corner of a wall as claimed in claim 1, wherein the step of calculating coordinates of an intersection of the first line and the second line and marking the coordinates of the intersection as coordinates of a location of the corner is followed by the step of:
acquiring the wall-following direction of the sweeping robot in the wall-following state and the rotation direction of the sweeping robot moving from the third position coordinate to the fourth position coordinate;
judging whether the wall-following direction is the same as the rotating direction;
if the wall direction is the same as the rotating direction, marking the corner corresponding to the corner position coordinate as a convex angle;
and if the wall-following direction is inconsistent with the rotating direction, marking the corner corresponding to the corner position coordinate as a reentrant corner.
6. The method for identifying the corner of the wall as claimed in claim 5, wherein the step of marking the corner corresponding to the corner position coordinate as the reentrant corner comprises:
acquiring the current position coordinate of the sweeping robot;
calculating to obtain a relative position between the current sweeping robot and the corner according to the current position coordinate and the corner position coordinate, wherein the relative position comprises a relative direction and a relative distance;
judging whether the relative distance is greater than a preset distance;
if the relative distance is larger than a preset distance, moving to the corner according to the relative position;
and adjusting the cleaning device to be over against the corner according to the relative direction, and cleaning the corner.
7. The method of identifying a corner of a wall as claimed in claim 6, wherein the step of moving to the corner in dependence on the relative position comprises:
setting the corner as a track end point according to the relative position;
and cleaning according to the zigzag track until the relative distance is not greater than the preset distance, and judging that the sweeping robot moves to the corner.
8. The utility model provides a device of discernment corner which characterized in that is applied to the robot of sweeping the floor, the device includes:
the first acquisition module is used for sequentially acquiring the position coordinates of the sweeping robot in a wall-following state until three position coordinates of the sweeping robot are acquired, wherein the three position coordinates are a first position coordinate, a second position coordinate and a third position coordinate in sequence according to the acquisition order;
a first calculating unit, configured to calculate the first position coordinate, the second position coordinate, and the third position coordinate according to the following formula to obtain a fitting straight line:
n points
Figure 995522DEST_PATH_IMAGE001
The equation of the fitted straight line is
Figure 232469DEST_PATH_IMAGE002
Then, then
Figure 36477DEST_PATH_IMAGE003
And
Figure 109606DEST_PATH_IMAGE004
the calculating method comprises the following steps:
Figure 657262DEST_PATH_IMAGE005
Figure 14294DEST_PATH_IMAGE006
the first judging module is used for judging whether the first position coordinate, the second position coordinate and the third position coordinate are on the same straight line according to the fitted straight line;
the first recording module is used for recording a straight line where the first position coordinate, the second position coordinate and the third position coordinate are located as a first straight line if the first position coordinate, the second position coordinate and the third position coordinate are located on the same straight line, and continuously acquiring the position coordinate of the sweeping robot until a newly-added fourth position coordinate is not located on the first straight line;
the second judging module is used for sequentially acquiring a fifth position coordinate and a sixth position coordinate of the sweeping robot and judging whether the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are on the same straight line;
the second recording module is used for recording a straight line in which the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located as a second straight line if the fourth position coordinate, the fifth position coordinate and the sixth position coordinate are located on the same straight line;
and the first calculation module is used for calculating the intersection point coordinates of the first straight line and the second straight line and marking the intersection point coordinates as the corner position coordinates.
9. A computer arrangement comprising a memory and a processor, the memory having a computer program stored therein, characterized in that the processor, when executing the computer program, is adapted to carry out the steps of the method according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202010007032.XA 2020-01-03 2020-01-03 Method and device for identifying corner and computer equipment Active CN111178315B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010007032.XA CN111178315B (en) 2020-01-03 2020-01-03 Method and device for identifying corner and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010007032.XA CN111178315B (en) 2020-01-03 2020-01-03 Method and device for identifying corner and computer equipment

Publications (2)

Publication Number Publication Date
CN111178315A CN111178315A (en) 2020-05-19
CN111178315B true CN111178315B (en) 2023-03-14

Family

ID=70654446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010007032.XA Active CN111178315B (en) 2020-01-03 2020-01-03 Method and device for identifying corner and computer equipment

Country Status (1)

Country Link
CN (1) CN111178315B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111759231A (en) * 2020-06-28 2020-10-13 深圳拓邦股份有限公司 Control method of cleaning equipment and cleaning equipment
CN112948927B (en) * 2021-02-25 2022-07-22 晟通科技集团有限公司 Building corner judging method, computer device and storage medium
CN112947478B (en) * 2021-03-23 2024-02-06 深圳市云鼠科技开发有限公司 Method and device for getting rid of trapping around column of robot, computer equipment and storage medium
CN113344265B (en) * 2021-05-28 2023-04-04 深圳市无限动力发展有限公司 Track closure judging method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004251875A (en) * 2002-12-27 2004-09-09 Kyokuto Sanki Co Ltd Dimensional profiler of room and method therefor
CN109637339A (en) * 2018-11-19 2019-04-16 深圳市海柔创新科技有限公司 Ground drawing generating method, device, computer readable storage medium and computer equipment
CN110253579A (en) * 2019-06-24 2019-09-20 合肥工业大学 Robot localization method, apparatus, equipment and medium based on circular arc feature extraction

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004251875A (en) * 2002-12-27 2004-09-09 Kyokuto Sanki Co Ltd Dimensional profiler of room and method therefor
CN109637339A (en) * 2018-11-19 2019-04-16 深圳市海柔创新科技有限公司 Ground drawing generating method, device, computer readable storage medium and computer equipment
CN110253579A (en) * 2019-06-24 2019-09-20 合肥工业大学 Robot localization method, apparatus, equipment and medium based on circular arc feature extraction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
机器人局部环境特征提取方法的研究;黄明登等;《计算机测量与控制》;20070225;第15卷(第02期);第104-107页 *

Also Published As

Publication number Publication date
CN111178315A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN111178315B (en) Method and device for identifying corner and computer equipment
CN110448241B (en) Robot trapped detection and escaping method
CN108209741B (en) Cleaning robot control method and cleaning robot
CN110269550B (en) Door position identification method and mobile robot
CN108733061B (en) Path correction method for cleaning operation
CN113475977B (en) Robot path planning method and device and robot
CN102138769A (en) Cleaning robot and cleaning method thereby
CN107643750B (en) Method for identifying slope of intelligent walking equipment and intelligent walking equipment
US20210213619A1 (en) Robot and control method therefor
JP2014203145A (en) Autonomous mobile apparatus
KR101167627B1 (en) Apparatus and Method for Double-Updating in simultaneous localization and mapping for a mobile robot
CN114779777A (en) Sensor control method and device for self-moving robot, medium and robot
CN115167427A (en) Visual obstacle identification method and system and mowing robot
CN113261879B (en) Corner cleaning method, corner cleaning device, computer equipment and storage medium
CN113503877A (en) Robot partition map establishing method and device and robot
CN114153197A (en) Method and device for getting rid of difficulties of autonomous mobile equipment
CN116919247A (en) Welt identification method, device, computer equipment and medium
CN112748721A (en) Visual robot and cleaning control method, system and chip thereof
EP4390313A1 (en) Navigation method and self-propelled apparatus
CN114564022A (en) Robot collision processing method and device
CN114764252A (en) Dynamic obstacle avoidance method and device and mobile robot
CN114594758A (en) Boundary determination method and device for map for automatic walking equipment
CN115326078B (en) Path navigation method and device, intelligent sweeping and washing robot and storage medium
CN114794986B (en) Method and device for breaking continuous sweeping along wall of sweeper, computer equipment and storage medium
CN115444328B (en) Obstacle detection method, cleaning robot and storage medium

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