Method for identifying boundary type by self-moving equipment and self-moving equipment
By detecting the boundary and obtaining heading information, the mobile device can identify the outer boundary and the inner boundary, solving the problem of incorrect movement caused by the inability to identify the boundary type and improving the accuracy of movement.
Patent Information
- Application Number
- CN202310436477.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2023-04-21
- Publication Date
- 2024-10-18
AI Technical Summary
Since mobile devices cannot identify the outer and inner boundaries, they may move along the wrong boundaries, affecting the use effect.
By detecting the boundary and obtaining heading information, the surrounding direction is determined based on the heading information, and then the boundary type is identified to ensure that the mobile device moves along the desired boundary.
The accuracy of boundary type recognition is improved, boundary type recognition errors caused by in-situ rotation are avoided, and the mobile device is ensured to move along the correct boundary.
Smart Images

Figure CN118795875A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of automatic control technology, and specifically relates to a method for identifying boundary types of a self-moving device and a self-moving device. Background Art
[0002] A self-moving device refers to an electronic device that can move autonomously without the need for artificial power. When using a self-moving device to work on a target area, it is often necessary to set an outer boundary for the target area so that the self-moving device can work within the target area surrounded by the outer boundary. However, there may be some non-working areas in the target area where the self-moving device cannot move or does not need to work. In this case, it is also necessary to set an inner boundary in the target area to prevent the self-moving device from entering the non-working area surrounded by the inner boundary.
[0003] A boundary sensor is generally provided on the self-moving device to sense the boundary. When it needs to move along the outer boundary (such as returning to the charging station), the self-moving device can detect the boundary through the sensing results of the boundary sensor and move along the boundary when the boundary is detected.
[0004] However, for a target area that has both an outer boundary and an inner boundary, when the self-moving device detects the boundary through the boundary sensor, it is impossible to identify whether the currently detected boundary is an inner boundary or an outer boundary. Therefore, the self-moving device may move along the inner boundary and cannot return to the charging station, thereby affecting the use effect of the self-moving device. Summary of the invention
[0005] The present application provides a method for a self-moving device to identify a boundary type and a self-moving device, which can solve the problem that the self-moving device may move along a wrong boundary because the self-moving device cannot identify the boundary type.
[0006] This application provides the following technical solutions:
[0007] On the one hand, a method for identifying a boundary type of a self-moving device is provided, wherein the self-moving device is suitable for working in a target area surrounded by an outer boundary; the target area has a non-working area surrounded by an inner boundary; the self-moving device is provided with a sensor for collecting the heading of the self-moving device; the method comprises:
[0008] In response to the edge movement instruction, controlling the self-moving device to detect the boundary;
[0009] When a boundary is detected, the self-moving device is controlled to move along the boundary, and heading information collected by the sensor during the movement is obtained; the heading information includes multiple headings determined based on a preset reference direction;
[0010] In the case where it is determined based on the heading information that the self-moving device has circled along the border for at least a preset number of times, determining the circling direction of the self-moving device according to the angle difference between the headings; the circling direction is clockwise or counterclockwise;
[0011] A boundary type is determined according to the surrounding direction, and the boundary type is the inner boundary or the outer boundary.
[0012] Optionally, the method further comprises:
[0013] Acquire a first identification set; the first identification set includes a preset heading representing one rotation of the mobile device;
[0014] Determining the number of preset headings included in the heading information;
[0015] When the number of the included preset headings is greater than or equal to a threshold, determining that the mobile device circles along the border for at least a preset number of times;
[0016] When the heading information does not include a preset heading or the number of the included preset headings is less than a threshold, it is determined that the self-moving device has not circled along the border for at least a preset number of times.
[0017] Optionally, determining the circumferential direction of the self-moving device according to the angle difference between the heading information includes:
[0018] Calculate the angle difference between the heading information according to a preset period;
[0019] Based on all the angle differences, the circumferential direction of the self-moving device is determined.
[0020] Optionally, determining the circumferential direction of the self-moving device based on all the angle differences includes:
[0021] Obtain a second identification set and a third identification set; the second identification set includes an identification representing each possible heading in a clockwise rotation, and the second identification set corresponds to the first symbol; the third identification set includes an identification of each possible heading in a counterclockwise rotation, and the third identification set corresponds to the second symbol; initialize the attributes of each identification to be the first attribute;
[0022] When the sign of the angle difference is the first sign, updating the attribute of the heading in the second identification set that matches the angle difference to a second attribute;
[0023] When the sign of the angle difference is the second sign, updating the attribute of the heading in the third identification set that matches the angle difference to the second attribute;
[0024] The circling direction of the self-moving device is determined according to the proportion of the headings of the second attribute in the second identification set and the proportion of the headings of the second attribute in the third identification set.
[0025] Optionally, determining the circling direction of the mobile device according to the proportion of the heading of the second attribute in the second identification set and the proportion of the heading of the second attribute in the third identification set includes:
[0026] When the proportion of the heading of the second attribute in the second identification set is greater than the proportion of the heading of the second attribute in the third identification set, determining that the circling direction of the self-moving device is clockwise;
[0027] When the proportion of the heading of the second attribute in the third identification set is greater than the proportion of the heading of the second attribute in the second identification set, it is determined that the circling direction of the self-moving device is counterclockwise.
[0028] Optionally, determining the circumferential direction of the self-moving device based on all the angle differences includes:
[0029] Determine the sign of each angular difference; the sign includes a first sign and a second sign; the first sign indicates clockwise rotation, and the second sign indicates counterclockwise rotation;
[0030] Accumulate the angle difference of the first symbol to obtain the clockwise rotation angle;
[0031] Accumulate the angle difference of the second symbol to obtain the counterclockwise rotation angle;
[0032] The circumferential direction of the self-moving device is determined according to the clockwise rotation angle and the counterclockwise rotation angle.
[0033] Optionally, determining the circumferential direction of the self-moving device according to the clockwise rotation angle and the counterclockwise rotation angle includes:
[0034] When the absolute value of the clockwise rotation angle is greater than the absolute value of the counterclockwise rotation angle, determining that the circling direction is clockwise;
[0035] When the absolute value of the counterclockwise rotation angle is greater than the absolute value of the clockwise rotation angle, the circling direction is determined to be counterclockwise.
[0036] Optionally, determining the boundary type according to the surrounding direction includes:
[0037] Based on the right side of the moving direction of the self-moving device being the non-working area and the left side being the working area, if the circling direction is clockwise, the boundary type is determined to be an inner boundary; if the circling direction is counterclockwise, the boundary type is determined to be an outer boundary; or,
[0038] Based on the right side of the moving direction of the self-moving device as the working area and the left side as the non-working area, if the surrounding direction is clockwise, the boundary type is determined to be an outer boundary; if the surrounding direction is counterclockwise, the boundary type is determined to be an inner boundary.
[0039] Optionally, after determining the boundary type according to the surrounding direction, the method further includes:
[0040] In the case where the boundary type is the inner boundary, controlling the self-moving device to rotate by a preset angle in a direction away from the non-working area, and triggering the step of controlling the self-moving device to detect the boundary;
[0041] When the boundary type is the outer boundary, the self-moving device is controlled to continue moving along the boundary.
[0042] Optionally, determining the boundary type according to the surrounding direction includes:
[0043] Based on the right side of the moving direction of the self-moving device as the non-working area and the left side as the working area, if the circling direction is counterclockwise, the circling direction of the self-moving device is determined according to the angle difference between the headings when it is determined based on the heading information that the self-moving device has circled along the boundary for at least a preset number of times;
[0044] Determine whether the movement data of the self-moving device circling the boundary at least twice the preset number of times is less than the preset movement data;
[0045] If the circling direction of the self-moving device is counterclockwise and the movement data of the self-moving device circling at least twice the preset number of times along the boundary is less than the preset movement data, then the boundary type is determined to be the inner boundary of a narrow area; or,
[0046] Taking the right side of the moving direction of the self-moving device as the working area and the left side as the non-working area as a reference, if the circling direction is clockwise, then determining based on the heading information that the self-moving device has circled at least a preset number of times along the boundary, and determining the circling direction of the self-moving device according to the angle difference between the headings;
[0047] Determine whether the movement data of the self-moving device circling the boundary at least twice the preset number of times is less than the preset movement data;
[0048] If the circling direction of the self-moving device is clockwise and the movement data of the self-moving device circling along the boundary for at least twice the preset number of circles is less than the preset movement data, the boundary type is determined to be the inner boundary of a narrow area.
[0049] Optionally, determining the boundary type according to the surrounding direction includes:
[0050] Based on the right side of the moving direction of the self-moving device as the non-working area and the left side as the working area, if the circling direction is counterclockwise, determining whether the ratio of the moving data of the self-moving device along the magnetic strip to the collected data is greater than a preset ratio;
[0051] If the ratio of the moving data along the magnetic stripe to the collected data is greater than a preset ratio, it is determined that the boundary type is an inner boundary with a magnetic stripe set; or,
[0052] Taking the right side of the moving direction of the self-moving device as the working area and the left side as the non-working area as a reference, if the circling direction is clockwise, determining whether the ratio of the moving data of the self-moving device along the magnetic strip to the collected data is greater than a preset ratio;
[0053] If the ratio of the moving data along the magnetic stripe to the collected data is greater than a preset ratio, the boundary type is determined to be an inner boundary with a magnetic stripe. On the other hand, the present application also provides a self-moving device, which is suitable for working in a working area surrounded by an outer boundary; the working area has a non-working area surrounded by an inner boundary; the self-moving device includes:
[0054] A mobile component, adapted to drive the self-moving device to move;
[0055] A driving assembly, adapted to provide driving force for the moving assembly;
[0056] A sensor, adapted to collect the heading angle of the self-moving device;
[0057] a boundary sensor adapted to sense the outer boundary and the inner boundary;
[0058] A processor connected to the driving component, the sensor and the boundary sensor, the processor is also connected to a memory, the memory stores a program, and the processor is used to implement the above-mentioned method of identifying the boundary type of the mobile device when executing the program.
[0059] On the other hand, the present application also provides a computer-readable storage medium, in which a program is stored. When the program is executed by a processor, it is used to implement the method for identifying boundary types of a mobile device as provided in the above aspects.
[0060] In the present application, by first determining that the self-moving device has circled along the border for at least a preset number of times based on the heading, then determining the circling direction of the self-moving device based on the angular difference between the headings, and finally determining the boundary type based on the circling direction, the problem that the self-moving device may move along the wrong boundary due to the self-moving device's inability to identify the boundary type can be solved; since the self-moving device can determine the boundary type based on the circling direction, the self-moving device can determine whether the current boundary is a boundary that needs to be moved along, thereby ensuring that the self-moving device moves along the desired boundary.
[0061] In addition, since the self-moving device does not directly use the accumulation and difference of headings to determine the boundary type, but obtains the orbiting direction when the self-moving device orbits along the boundary for at least a preset number of times, and determines the boundary type based on the orbiting direction, the problem of incorrect boundary type recognition caused by the self-moving device rotating 360° on the spot can be avoided, thereby improving the accuracy of boundary type recognition.
[0062] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is a block diagram of a self-mobile device provided by an embodiment of the present application;
[0064] Figure 2 is a flow chart of a method for identifying boundary types from a mobile device provided by an embodiment of the present application;
[0065] Figure 3 is a schematic diagram of a self-moving device moving along a boundary in a preset posture provided by an embodiment of the present application;
[0066] Figure 4 is a schematic diagram of a self-moving device moving along a boundary in a preset posture provided by another embodiment of the present application;
[0067] Figure 5 is a flow chart of a method for identifying boundary types from a mobile device provided by another embodiment of the present application;
[0068] Figure 6 is a schematic diagram of a process of a mobile device escaping from an inner boundary provided by an embodiment of the present application;
[0069] Figure 7 is a schematic diagram of a process of a mobile device escaping from an inner boundary provided by another embodiment of the present application;
[0070] Figure 8It is a block diagram of an apparatus for a method of identifying boundary types from a mobile device provided by an embodiment of the present application;
[0071] Fig. 9 It is a schematic diagram of an embodiment of the present application providing that a self-mobile device identifies a boundary type as an inner boundary of a narrow area;
[0072] Fig.10 It is a schematic diagram of an embodiment of the present application providing a self-mobile device to identify a boundary type as an inner boundary with a magnetic stripe. DETAILED DESCRIPTION
[0073] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application but are not intended to limit the scope of the present application.
[0074] It should be noted that the detailed descriptions described in conjunction with the accompanying drawings are intended to be a description of various configurations, and are not intended to represent the only configuration in which the concepts described herein can be practiced. The device embodiments and method embodiments described herein will be described in the following detailed description and illustrated in the accompanying drawings by various boxes, modules, units, components, circuits, steps, processes, algorithms, etc. (collectively referred to as "elements"). These elements can be implemented using electronic hardware, computer software, or any combination thereof. Whether these elements are implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. If the terms in the specification and claims of this application and the accompanying drawings of the specification are described using "first", "second", etc., this description is used to distinguish different objects, rather than to describe a specific order.
[0075] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprise" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. It should also be understood that the terms used in this specification of the application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification of the application and the appended claims, unless the context clearly indicates otherwise, the singular forms of "one", "an" and "the" are intended to include plural forms. It should also be further understood that the term "and / or" used in the specification of the application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0076] It should be noted that, in the absence of explicit special instructions, the various technical features in the embodiments of the present application can be regarded as being able to be combined or combined with each other, as long as the combination or combination cannot be implemented due to technical reasons. In order to more fully illustrate the present application, some exemplary, optional, or preferred features are described in combination with other technical features in the embodiments of the present application, but this combination is not necessary, and it should be understood that the exemplary, optional, or preferred features and other technical features are separable or independent from each other, as long as the separability or independence cannot be implemented due to technical reasons. Some functional descriptions of the technical features in the method embodiment can be understood as performing the function, method or step, and some functional descriptions of the technical features in the device embodiment can be understood as using the device to perform the function, method or step.
[0077] A self-moving device refers to an electronic device that can move autonomously without artificial power. Optionally, the self-moving device includes but is not limited to: a lawn mowing robot, a cleaning robot, etc. This embodiment does not limit the type of the self-moving device.
[0078] Optionally, the self-moving device may have other functions besides autonomous movement to perform work tasks. The work tasks vary depending on the self-moving device, for example, the work tasks of the mowing robot include mowing, and the work tasks of the cleaning robot include cleaning the surface to be cleaned.
[0079] Figure 1 FIG. 1 is a block diagram of a mobile device 10 provided by an embodiment of the present application. Figure 1 As shown, the mobile device 10 at least includes: a moving component 110 , a driving component 120 , a sensor 130 , a boundary sensor 140 , a processor 150 and a memory 160 .
[0080] The mobile component 110 is a component of the self-moving device 10 for driving the self-moving device 10 to move. The mobile component 110 includes but is not limited to: track wheels, drive wheels, etc. Different mobile components 110 are suitable for different or the same scenarios. This embodiment does not limit the implementation method of the mobile component 110.
[0081] The moving component 110 is connected to the driving component 120 , and the driving component 120 is suitable for providing driving force for the moving component 110 to drive the moving component 110 to operate, thereby realizing that the moving component drives the self-moving device 10 to move.
[0082] The driving component 120 includes but is not limited to a driving motor. In other embodiments, the driving component 120 may also be an engine, etc. This embodiment does not limit the implementation method of the driving component 120.
[0083] Sensor 130 can be used to collect the heading of the mobile device. The heading of the mobile device refers to the angle at which the direction of travel of the mobile device is deviated relative to a preset reference direction on a plane parallel to the plane where the mobile device is located. Specifically, taking the plane parallel to the plane where the mobile device is located as an example, the preset reference direction can be the direction of travel of the mobile device when the heading collection starts, that is, the heading of the direction of travel of the mobile device when the heading collection starts is defined as 0°; or, the preset reference direction can also be a preset direction, such as: defining the due north direction or due south direction in the geographical location as 0°. This embodiment does not limit the preset reference direction.
[0084] Illustratively, the sensor 130 may be an inertial measurement unit (IMU) or a gyroscope, etc. This embodiment does not limit the implementation method of the sensor 130.
[0085] For example, when the sensor 130 is an IMU, the sensor 130 has an algorithm module built in, which uses the acceleration collected by the accelerometer in the IMU and the angular velocity collected by the gyroscope in the IMU to calculate the Euler angle with the gravity vector as a reference. The algorithm module includes, but is not limited to, an attitude solution algorithm module implemented by algorithms such as Kalman or complementary filtering, and this embodiment does not limit the implementation method of the algorithm module. The Euler angle includes the pitch angle Pitch, the roll angle Roll, and the heading angle Yaw, wherein the pitch angle Pitch is used to characterize the angle of the front end of the mobile device to tilt forward or forward, the roll angle Roll is used to characterize the angle of the mobile device to tilt left or right, and the heading angle Yaw refers to the angle of rotation of the mobile device around an axis perpendicular to the plane where the device body is located. In this embodiment, the heading angle Yaw output by the sensor 130 can be used as the heading collected by the sensor 130.
[0086] The boundary sensor 140 can be used to detect the boundary. The boundary is used to define the edge of the area, that is, the boundary is the periphery of an area, usually connected end to end, and the area is closed. The boundary can be physical or electronic, that is, it can be formed by walls, fences, railings, etc., and can be formed by electromagnetic signals or light signals emitted by a boundary signal generating device, etc. It can be a passive magnetic device that can generate a magnetic field, or it can be an absolute coordinate or relative coordinate learned or recorded by a self-moving device, or other environmental information that can determine the position. The boundary can be a general term for the outer boundary and inner boundary of the target area. The inner boundary includes obstacles within the working range or other areas that the self-moving device should not enter. The obstacle is a part or area within the working range that cannot be walked on, such as a sofa, bed cabinet indoors, or a pond, flower bed, etc. outdoors. In this embodiment, the boundary includes an outer boundary and an inner boundary. Among them, the outer boundary is used to define the edge of the target area. The target area refers to the area where the self-moving device needs to perform a task, for example: the target area is the area where the mowing robot needs to mow the lawn. The target area includes a working area where the self-moving device can move and a non-working area where the self-moving device cannot move. The inner boundary is used to define the edge of the non-working area in the target area, such as the edge of an island or an obstacle. In this embodiment, the self-moving device can move in the working area, but is not allowed to move in the non-working area.
[0087] The boundary sensor 140 may be a magnetic induction sensor, and accordingly, the self-moving device may detect the boundary based on the magnetic signal received by the magnetic induction sensor; or, the boundary sensor 140 may be an image sensor, and accordingly, the self-moving device may detect the boundary based on the image information collected by the image sensor; or, the boundary sensor 140 may be a positioning module, and accordingly, the self-moving device may detect the boundary based on the positioning information collected by the positioning module. In other embodiments, the boundary sensor 140 may detect the boundary in other ways, which are not listed one by one in this embodiment.
[0088] To facilitate charging of the self-mobile device, the charging station is generally set based on the outer boundary of the target area. For example, it can be set on the outer boundary, or it can be set outside the area surrounded by the outer boundary, etc., which is not limited in this embodiment. When the self-mobile device is low on power or needs to return to the charging station for other reasons, the self-mobile device generally moves along the outer boundary in order to return to the charging station as soon as possible. Of course, the self-mobile device may also move along the outer boundary based on other needs. This embodiment does not list the scenarios in which the self-mobile device moves along the outer boundary. For the target area that includes both the outer boundary and the inner boundary, since the self-mobile device may only need to move along one of the outer boundary and the inner boundary (for example, it only needs to move along the outer boundary), therefore, after the boundary is detected by the boundary sensor 140, it is also necessary to identify the boundary type of the boundary to determine whether the currently detected boundary is a boundary that needs to be moved along the edge.
[0089] Traditional ways to identify boundary types include the following:
[0090] The first type: the outer boundary and the inner boundary emit different boundary signals. Accordingly, after the boundary sensor 140 detects the boundary, it sends the boundary signal to the self-moving device, and the self-moving device can determine the boundary type according to the boundary signal. For example, the outer boundary emits an N-pole magnetic signal, and the inner boundary emits an S-pole magnetic signal to identify the boundary type.
[0091] However, in this case, different signal types need to be set for the outer boundary and the inner boundary, which increases the complexity of boundary setting and reduces the efficiency of boundary arrangement.
[0092] The second method: when the mobile device moves along the edge, the current heading of the mobile device and the historical headings adjacent to the current heading are obtained according to preset rules to obtain the angle difference between the current heading and the historical headings; based on the accumulation and sum of the angle differences, it is determined whether the mobile device is currently in the inner circle or the outer circle.
[0093] However, the heading of the self-moving device is generally determined by sensor 130, and the accuracy of the cumulative sum of the heading angle difference is relatively dependent on the accuracy of sensor 130. If the accuracy of sensor 130 is not high, as the angle difference accumulates, the error of the cumulative sum of the angle difference will also accumulate, which will lead to the low accuracy of the boundary type determined based on the cumulative sum of the angle difference. In addition, when the self-moving device moves along the edge, it may rotate 360° in place (such as when sensor 130 fails, or is lifted and rotated by external force). In this case, the cumulative sum of the angle difference can also reach 360°. In this way, according to the above-mentioned boundary recognition method, the situation where the self-moving device rotates 360° in place will be determined as moving around the inner circle or the outer circle, which will lead to the problem of inaccurate boundary type recognition.
[0094] Based on the above technical problems, in this embodiment, the self-moving device further includes a processor 150 connected to the driving component, the sensor 130 and the boundary sensor. The processor 150 is also connected to the memory 160. The memory 160 stores a program. When the processor 150 executes the program, it at least performs the following steps:
[0095] In response to the edge movement instruction, controlling the self-moving device to detect the boundary;
[0096] When a boundary is detected, the self-mobile device is controlled to move along the boundary and obtains heading information collected by the sensor during the movement; the heading information includes multiple headings determined based on a preset reference direction;
[0097] When it is determined based on the heading information that the self-moving device has circled along the border for at least a preset number of times, the circling direction of the self-moving device is determined according to the angle difference between the headings; the circling direction is clockwise or counterclockwise;
[0098] The boundary type is determined by the wrapping direction, which can be either inner or outer.
[0099] Optionally, the processor 150 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 150 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array).
[0100] The processor 150 may also include a main processor and a coprocessor. The main processor is the processor 150 used to process data in the awake state, also called a CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state.
[0101] The memory 160 may include one or more computer-readable storage media, which may be non-transitory. The memory 160 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash memory storage devices.
[0102] In some embodiments, the mobile device 10 may also optionally include: a peripheral device interface and at least one peripheral device. The processor 150, the memory 160 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.
[0103] Of course, the mobile device 10 may also include fewer or more components, which is not limited in this embodiment.
[0104] In this embodiment, it is possible to first determine that the mobile device has orbited the border for at least a preset number of times based on the heading, then determine the orbiting direction of the mobile device based on the angular difference between the headings, and finally determine the boundary type based on the orbiting direction; this can solve the problem that the mobile device may move along the wrong boundary due to the inability of the mobile device to identify the boundary type; since the mobile device can determine the boundary type based on the orbiting direction, the mobile device can determine whether the current boundary is a boundary that needs to be moved along, thereby ensuring that the mobile device moves along the desired boundary.
[0105] In addition, since the self-moving device does not directly use the accumulation and difference of headings to determine the boundary type, but obtains the circling direction when the self-moving device circles along the boundary for at least a preset number of times, such as one week or three quarters of a week, and determines the boundary type based on the circling direction, the problem of incorrect boundary type identification caused by the self-moving device rotating 360° on the spot can be avoided, thereby improving the accuracy of boundary type identification.
[0106] The following is a detailed description of the method for identifying boundary types from a mobile device provided by the present application. Figure 1 In the self-mobile device shown, the processor used in the self-mobile device is specifically used as an example for explanation. In actual implementation, the method can also be used in other devices that are communicatively connected to the self-mobile device, such as: for user terminals, or servers, etc., wherein user terminals include but are not limited to: mobile phones, computers, tablet computers, remote control devices, wearable devices, etc. This embodiment does not limit the implementation methods of other devices and user terminals.
[0107] The communication connection method may be wired communication or wireless communication, and the wireless communication method may be short-distance communication or wireless communication, etc. This embodiment does not limit the communication method between the mobile device and other devices.
[0108] Figure 2 This is a flow chart of a method for identifying boundary types from a mobile device provided by an embodiment of the present application. The method includes at least the following steps:
[0109] Step 201, in response to an edge movement instruction, controlling the self-moving device to detect the edge.
[0110] The move-along-edge instruction is used to instruct the self-moving device to move along the desired boundary. Generally, the desired boundary is the outer boundary. The generation scenarios of the move-along-edge instruction include but are not limited to the following:
[0111] The first one: when it is detected that the remaining power of the mobile device is less than or equal to the power threshold, the processor automatically generates an edge movement instruction or the processor displays the power information to generate an edge movement instruction based on the user operation.
[0112] The second method: when receiving a charging station return signal sent by other devices, an edge movement instruction is generated.
[0113] In one example, controlling the mobile device to detect a boundary includes: controlling the mobile device to move and acquiring information collected by a boundary sensor; and determining whether a boundary is detected according to the collected information. The boundary sensor may include one or more.
[0114] Specifically, for example, the boundary sensor is a magnetic induction sensor. When detecting the boundary, the boundary signal collected by the magnetic induction sensor can be obtained and the strength of the boundary signal can be determined. Then, the strength of the boundary signal can be compared with a preset strength value. When the strength of the boundary signal is greater than or equal to the preset strength value, it can be considered that the boundary is detected, otherwise, it is considered that the boundary is not detected. Among them, wires can be laid along the boundary in advance and powered on so that the boundary generates a boundary signal. For another example, the boundary sensor is an image sensor. When detecting the boundary, the image information collected by the image sensor can be obtained, and then the image information is compared with a preset boundary image. When the similarity is greater than or equal to a preset value, it can be considered that the boundary is detected, otherwise, it is considered that the boundary is not detected. For another example, the boundary sensor is a positioning module. When detecting the boundary, the positioning information collected by the positioning module can be obtained, and then the positioning information is compared with the position information of the boundary. If the distance between the two is within a preset range, it can be considered that the boundary is detected, otherwise, it is considered that the boundary is not detected.
[0115] The above-mentioned preset strength value, preset value, and preset range can be set according to the actual scene, and this application does not limit this. In other embodiments, the self-equipped device can also detect the boundary in other ways, which are not listed one by one in this embodiment.
[0116] During the boundary detection process, the moving path of the self-moving device can be a straight line or a curve, and the moving direction can be a preset detection direction or a randomly generated direction. This embodiment does not limit the movement mode of the self-moving device when detecting the boundary.
[0117] Step 202, when a boundary is detected, control the mobile device to move along the boundary, and obtain heading information collected by the sensor during the movement; the heading information includes multiple headings determined based on a preset reference direction.
[0118] In one example, when a boundary is detected, the posture of the self-moving device moving along the boundary can be a first posture or a second posture. Wherein, based on the moving direction of the self-moving device, the first posture can indicate that the right side of the moving direction of the self-moving device is a non-working area and the left side is a working area; the second posture indicates that the right side of the moving direction of the self-moving device is a working area and the left side is a non-working area.
[0119] Optionally, the boundary sensor of the self-moving device includes a first sensor and a second sensor, the first sensor is located on the left side of the longitudinal axis of the fuselage, and the second sensor is located on the right side of the longitudinal axis of the fuselage. If the sensing signal collected by the first sensor and the sensing signal collected by the second sensor indicate that one of the two sensors is located within the boundary and the other is located outside the boundary, it is considered that the boundary is detected. At this time, based on the direction of travel of the self-moving device, the posture of the self-moving device is defined according to which sensor is located within the boundary and which sensor is located outside the boundary. Specifically, for example, based on the direction of travel of the self-moving device, if the sensing signal of the first sensor indicates that the first sensor is located within the boundary and the sensing signal of the second sensor indicates that the second sensor is located outside the boundary, the current posture is considered to be the first posture.
[0120] If the sensing signal of the first sensor indicates that the first sensor is located outside the boundary and the sensing signal of the second sensor indicates that the second sensor is located inside the boundary, the current posture is considered to be the second posture.
[0121] Furthermore, in the process of controlling the movement of the self-moving device along the boundary, the heading information collected by the sensor 130 during the movement can be obtained. Specifically, for example, the self-moving device obtains the heading collected by the sensor at every preset sampling period to obtain the heading information; or, the self-moving device obtains the heading collected by the sensor in real time to obtain the heading information. This embodiment does not limit the way in which the self-moving device obtains the heading information. The heading information includes multiple headings determined based on a preset reference direction. For example, taking the plane parallel to the self-moving device as an example, the preset reference direction can be the direction of travel of the self-moving device when the heading is started to be collected, that is, the heading of the direction of travel of the self-moving device when the heading is started to be collected is defined as 0°; or, the preset reference direction can also be a preset direction, such as: defining the due north direction or due south direction in the geographical location as 0°. This embodiment does not limit the setting method of the preset reference direction.
[0122] Step 203, when it is determined based on the heading information that the mobile device has circled along the border for at least a preset number of times, such as one circle or three quarters of a circle, the circling direction of the mobile device is determined according to the angle difference between the headings; the circling direction is clockwise or counterclockwise.
[0123] Before this step, the self-moving device also needs to determine whether the self-moving device has circled along the border for at least a preset number of times based on the heading information.
[0124] In one example, determining whether the mobile device has circled along the border for at least a preset number of times based on the heading includes:
[0125] Acquire a first identification set, the first identification set including a preset heading that should be collected when the mobile device rotates a preset number of times;
[0126] The self-moving device is controlled to move along the border. During the movement, the sensor 130 collects multiple heading information and determines the number of preset headings included in the heading information; when the number of preset headings included in the heading information is greater than or equal to a threshold, it is determined that the self-moving device has circled along the border for at least a preset number of times; if the heading information set does not include a preset heading or the number of preset headings included is less than a threshold, it is determined that the self-moving device has not circled along the border for at least a preset number of times.
[0127] The threshold may be the total number of preset headings in the first identification set, or the threshold may be smaller than the total number.
[0128] Optionally, determining the number of preset headings included in the heading information includes: comparing the acquired heading information with the preset headings in the first identification set; if the heading information is the same as the preset headings, marking the preset heading in the first identification set; if the number of preset headings marked in the first identification set is greater than or equal to a threshold, then it means that the number of preset headings included in the heading information is greater than or equal to the threshold, i.e., it is determined that the self-mobile device has moved along the border for at least a preset number of times; if the number of preset headings marked in the first identification set is less than the threshold, then it means that the number of preset headings included in the heading information is less than the threshold, i.e., it is determined that the self-mobile device has not moved along the border for at least a preset number of times, and at this time, execute step 202 again.
[0129] Among them, the number and value of the preset headings in the first identification set can be fixedly stored in the mobile device, or set by the user according to needs. This embodiment does not limit the setting method of the preset headings in the first identification set.
[0130] In one example, the heading range of the preset heading indication in the first identification set is consistent with the collection range when the sensor collects the heading. In this case, after the heading information is obtained, it can be directly compared with the first identification set. Among them, the heading range of the preset heading indication refers to the value range when setting the preset heading. For example: the sensor is IMU, and the collection range of the heading collected by the IMU is [-180°, 180°]. Then the preset heading in the first identification set is set from the value range [-180°, 180°]. For example: the preset headings in the first preset heading set include: ±180°, -90°, 0° and 90°. At this time, the heading range is consistent with the collection range.
[0131] In another example, the heading range of the preset heading indication in the first identification set is inconsistent with the collection range when the sensor collects the heading. At this time, the heading range of the preset heading indication and the collection range need to be converted to be consistent and then compared.
[0132] Specifically, the heading range of the preset heading indication can be converted to be consistent with the collection range, for example: the collection range of the IMU collected heading is [-180°, 180°], and the heading range of the preset heading indication is [0, 360°]. For example: the preset headings in the first identification set include: 0°, 90°, 180°, 270°; during conversion, subtract 180° from each preset heading to obtain the converted preset headings: -180°, -90°, 0°, 90°, and the heading range of the converted preset heading indication is [-180°, 180°]. For another example: the collection range of the IMU collected heading is [-180°, 180°], and the heading range of the preset heading indication is [-360°, 0]. For example: the preset headings in the first identification set include: 0°, -30°, -60°, -90°, -120°, -150°, -180°, -210°, -240°, -270°, -300° and -330°. During conversion, it is necessary to add 180° to each preset heading to obtain the converted preset headings: 180°, 150°, 120°, 90°, 60°, 30°, 0°, -30°, -60°, -90°, -120°, -150°. The heading range of the converted preset heading indication [-180°, 180°] is consistent with the collection range.
[0133] Alternatively, the heading information can also be converted to be consistent with the heading range. For example, the collection range of the IMU collected heading is [-180°, 180°], and the heading range of the preset heading indication is [0, 360°]. It is necessary to add 180° to each collected heading to obtain the converted heading, so that the collection range corresponding to the converted heading is consistent with the heading range of the preset heading indication.
[0134] Optionally, when setting a preset heading from the heading range, the difference between two adjacent preset headings can be set equal. In other embodiments, the difference between two adjacent preset headings can also be set unequal, and the number of preset headings in the first identification set is at least two. This embodiment does not limit the setting method of the preset heading.
[0135] The self-moving device generally circles clockwise or counterclockwise. In this embodiment, the self-moving device determines the more inclined circle direction by recording the change track of the heading of the self-moving device.
[0136] Schematically, determining the circling direction of the self-moving device according to the angular difference between the headings includes: calculating the angular difference between the headings in the heading information according to a preset period; and determining the circling direction of the self-moving device based on all the angular differences.
[0137] Calculating the angle difference between the headings in the heading information according to a preset period includes: calculating the angle difference between the headings collected at intervals of a preset period. The preset period may be an interval period for the sensor to collect headings, in which case the angle difference is the angle difference between two adjacent headings collected by the sensor; or the preset period may be n times the interval period, where n is an integer greater than 1, in which case the angle difference is the angle difference between each heading and the nth heading before the heading.
[0138] Methods for determining the circling direction of the self-moving device based on all angle differences include but are not limited to the following:
[0139] The first method: obtaining a second identification set and a third identification set; the second identification set includes a set of all heading angles required for the self-mobile device to rotate clockwise for one circle, the second identification set corresponds to the first symbol, and the first symbol is used to represent the self-mobile device's clockwise rotation; the third identification set includes a set of all heading angles required for the self-mobile device to rotate counterclockwise for one circle, the third identification set corresponds to the second symbol, and the second symbol is used to represent the self-mobile device's counterclockwise rotation; initialize the attribute of each heading in the second identification set and the third identification set to be the first attribute; when the self-mobile device moves along the boundary, calculate the angular difference between the headings in the heading information according to a preset period, and when the symbol of the angular difference is the first symbol, initialize the second identification set with the current heading of the self-mobile device. The attribute of the corresponding heading is updated to the second attribute; when the sign of the angle difference is the second sign, the attribute of the heading angle corresponding to the current heading angle of the self-mobile device in the third identification set is updated to the second attribute; it is determined that the number of headings with the second attribute in the second identification set accounts for the second proportion of the total number of headings in the second identification set; it is determined that the number of headings with the second attribute in the third identification set accounts for the third proportion of the total number of headings in the third identification set; the second proportion is compared with the third proportion to determine the direction in which the self-mobile device moves along the boundary, for example, if the second proportion is greater than the third proportion, the direction in which the self-mobile device moves around the boundary is clockwise, and if the second proportion is less than the third proportion, the direction in which the self-mobile device moves around the boundary is counterclockwise.
[0140] Optionally, the number of headings in the second identification set is the same as or different from the number of headings in the third identification set. When the number of headings in the second identification set is the same as the number of headings in the third identification set, the headings in the second identification set may correspond to the headings in the third identification set one-to-one; or, the headings in the second identification set may not correspond to the headings in the third identification set one-to-one. This embodiment does not limit the implementation method of the second identification set and the third identification set.
[0141] Among them, the sign (positive or negative) of the angle difference is used to indicate the identification set corresponding to the angle difference. The first sign is one of the positive sign and the negative sign, and the second sign is the other. For example: if clockwise rotation is positive, the first sign is positive and the second sign is negative; at this time, if the angle difference is a positive number, the identification set corresponding to the angle difference is the second identification set, and if the angle difference is a negative number, the identification set corresponding to the angle difference is the third identification set. For another example: if counterclockwise rotation is positive, the first sign is negative and the second sign is positive; at this time, if the angle difference is negative, the identification set corresponding to the angle difference is the second identification set, and if the angle difference is positive, the identification set corresponding to the angle difference is the third identification set.
[0142] The identifier of each heading may be a specific value of the heading, or an absolute value of the heading, or a coded value of the heading. This embodiment does not limit the setting method of the heading identifier.
[0143] The attributes of the heading in the second identification set and the third identification set include a first attribute and a second attribute. The first attribute is used to indicate that the self-moving device is not moving around the boundary at the heading; the second attribute is used to indicate that the self-moving device is moving around the boundary at the heading. Schematically, the first attribute is 0 and the second attribute is 1; or, the first attribute is 1 and the second attribute is 0. This embodiment does not limit the implementation of the first attribute and the second attribute. Among them, the direction of movement along the boundary corresponding to the heading angle refers to the direction of movement around the boundary corresponding to the identification set to which the heading belongs. For example: if the identification set to which the heading belongs is the second identification set, then the direction of movement around the boundary corresponding to the heading is clockwise; for another example: if the identification set to which the heading belongs is the third identification set, then the direction of movement around the boundary corresponding to the heading is counterclockwise.
[0144] For each angle difference, if the angle difference is the difference between the target heading and the previous heading or the nth previous heading, then the heading that matches the angle difference is the same heading as the target heading.
[0145] For example, if the heading collected at time t2 is 30°, and the heading collected at time t1 is 20°, the angle difference is 30°-20°=10°. Since the angle difference is a positive number, the corresponding identification set is the second identification set, and the attribute of the heading 30° in the second identification set is changed from 0 to 1 (at this time, the first identification is 0 and the second identification is 1). Time t2 is after time t1.
[0146] For another example, if the heading collected at time t2 is 10°, and the heading collected at time t1 is 20°, the angle difference is 10°-20°=-10°. Since the angle difference is a negative number, the corresponding identification set is the third identification set, and the attribute of the heading 10° in the third identification set is changed from 0 to 1 (at this time, the first identification is 0 and the second identification is 1). Time t2 is after time t1.
[0147] After the first attribute of the heading is changed to the second attribute, the attribute will not change during the boundary type identification process, that is, it will always be the second attribute. When the boundary type is identified next time, the attribute will be initialized to the first attribute again.
[0148] When comparing the current heading with the headings in the second identification set or the third identification set, it is necessary to ensure that the collection range corresponding to the current heading is consistent with the heading range indicated by the headings in the second identification set or the third identification set.
[0149] In one example, the heading range indicated by the headings in the second identification set and the third identification set is consistent with the collection range when the sensor collects the heading. At this time, after obtaining the current heading corresponding to the angle difference, the current heading can be directly compared with the heading in the second identification set or the third identification set.
[0150] In another example, if the heading range of the heading indication in the second identification set and the third identification set is inconsistent with the collection range when the sensor collects the heading, it is necessary to convert the heading range of the heading indication in the second identification set and the third identification set to be consistent with the collection range and then compare them. For the specific conversion method, refer to the conversion method of the preset heading in the first identification set or the conversion method of the heading information, which will not be repeated in this embodiment.
[0151] The orbiting direction of the self-mobile device is determined based on the proportion of the heading of the second attribute in the second identification set and the proportion of the heading of the second attribute in the third identification set, including: when the proportion of the heading of the second attribute in the second identification set is greater than the proportion of the heading of the second attribute in the third identification set, the orbiting direction of the self-mobile device is determined to be clockwise; when the proportion of the heading of the second attribute in the third identification set is greater than the proportion of the heading of the second attribute in the second identification set, the orbiting direction of the self-mobile device is determined to be counterclockwise.
[0152] The proportion of the headings of the second attribute represents the ratio of the number of headings of the second attribute to the total number of headings in the second identification set.
[0153] For example, taking the clockwise direction as the positive direction, the second identification set is preset as: +[0 degrees, 1 degree, 2 degrees, ..., 360 degrees], that is, the corresponding first symbol is positive; the third identification set is: -[0 degrees, 1 degree, 2 degrees, ..., 360 degrees], that is, the corresponding second symbol is negative; the attribute of each heading in the second identification set and the third identification set is initialized to 0, to indicate that the mobile device has not moved around the boundary in any heading in the second identification set and the third identification set.
[0154] Afterwards, as the self-mobile device moves around the border, the angle difference between the current heading and the heading obtained in the previous cycle is periodically calculated, thereby refreshing the attributes of the corresponding headings in the second identification set and / or the third identification set. For example, if the current heading is 30° and the heading obtained in the previous cycle is 60°, then 30°-60°=-30° can be used to determine that the attribute of 30° in the third identification set is updated to 1 (indicating that the self-mobile device is currently moving along the border at a heading of 30 degrees relative to the reference direction, and the current heading is the heading obtained by rotating the self-mobile device counterclockwise by 30 degrees based on the heading obtained in the previous cycle). After one cycle, the current heading obtained from the mobile device is 20° again. Since the heading obtained in the previous cycle was 30°, 20°-30°=-10° can be used to determine that the attribute of the heading angle 20° in the third identification set is updated to 1 (indicating that the mobile device is currently moving along the border at a heading of 20 degrees relative to the reference direction, and the current heading is the heading obtained by rotating the mobile device counterclockwise by 20 degrees based on the heading obtained in the previous cycle). After one cycle, the current heading obtained from the mobile device is 25° again. Since the heading obtained in the previous cycle was 20°, 25°-20°=5° can be used to determine that the attribute of the heading 25° in the second identification set is updated to 1 (indicating that the mobile device is currently moving along the border at a heading of 25° relative to the reference direction, and the current heading angle is the heading obtained by rotating the mobile device clockwise by 20° based on the heading 20° obtained in the previous cycle). Thus, through the above method, for all the headings of the self-moving device obtained in the process of the self-moving device moving along the border for a preset number of cycles, the angle difference between the headings is calculated according to the preset period, and the attributes of the corresponding headings in the second identification set and / or the third identification set are refreshed based on the relevant information of the angle difference. Further, the proportion of the number of headings with the attribute 1 in the second identification set and the proportion of the number of headings with the attribute 1 in the third identification set are counted. When the proportion of the number of headings with the attribute 1 in the second identification set is greater than the proportion of the number of headings with the attribute 1 in the third identification set, it is determined that the direction of movement of the self-moving device along the border is a clockwise detour direction; when the proportion of the number of headings with the attribute 1 in the third identification set is greater than the proportion of the number of headings with the attribute 1 in the second identification set, it is determined that the direction of movement of the self-moving device around the border is a counterclockwise detour direction.
[0155] The second method: determine the sign of each angle difference; the symbol includes a first symbol and a second symbol; the first symbol represents clockwise rotation, and the second symbol represents counterclockwise rotation; accumulate the angle differences of the first symbols to obtain the clockwise rotation angle; accumulate the angle differences of the second symbols to obtain the counterclockwise rotation angle; determine the rotation direction of the self-moving device based on the clockwise rotation angle and the counterclockwise rotation angle.
[0156] Among them, the rotation direction of the self-moving device is determined according to the clockwise rotation angle and the counterclockwise rotation angle, including: when the absolute value of the clockwise rotation angle is greater than the absolute value of the counterclockwise rotation angle, the rotation direction is determined to be clockwise; when the absolute value of the counterclockwise rotation angle is greater than the absolute value of the clockwise rotation angle, the rotation direction is determined to be counterclockwise.
[0157] Step 204: determine the boundary type according to the surrounding direction, and the boundary type is an inner boundary or an outer boundary.
[0158] Since the posture of the self-moving device moving along the boundary can be the first posture or the second posture when the boundary is detected. Therefore, before determining the boundary type according to the surrounding direction, the posture of the self-moving device moving along the boundary can be determined first. Further, based on the posture of the self-moving device moving along the boundary, the boundary type is determined according to the surrounding direction. Among them, based on the moving direction of the self-moving device, the first posture indicates that the right side of the moving direction of the self-moving device is the non-working area and the left side is the working area; the second posture indicates that the right side of the moving direction of the self-moving device is the working area and the left side is the non-working area.
[0159] In one example, if the mobile device is controlled to move along the boundary in a preset posture when a boundary is detected, the boundary type can be determined according to the circling direction based on the preset posture. The preset posture can be the first posture or the second posture.
[0160] If the mobile device moves along the boundary in the first posture, if the circling direction is clockwise, the boundary type is determined to be an inner boundary; if the circling direction is counterclockwise, the boundary type is determined to be an outer boundary.
[0161] refer to Figure 3 , taking the first posture moving along the boundary as an example, Figure 3 In the figure, the white area indicates the working area, and the black area indicates the non-working area. If the direction of the self-moving device is clockwise, according to Figure 3 , since when moving along the boundary in the first posture, the non-working area needs to be located on the right side of the self-moving device and the working area needs to be located on the left side of the self-moving device, and this feature is met when circling clockwise along the inner boundary, it can be determined that the boundary type where the self-moving device is located is an inner boundary.
[0162] If the direction of the self-moving device is counterclockwise, according to Figure 3 , since when moving along the boundary in the first posture, the non-working area needs to be located on the right side of the self-moving device and the working area needs to be located on the left side of the self-moving device, and this feature is met when circling counterclockwise along the outer boundary, it can be determined that the boundary type where the self-moving device is located is an outer boundary.
[0163] If the mobile device moves along the boundary in the second posture, if the circling direction is clockwise, the boundary type is determined to be an outer boundary; if the circling direction is counterclockwise, the boundary type is determined to be an inner boundary.
[0164] refer to Figure 4 , taking the second posture moving along the boundary as an example, Figure 4 In the figure, the white area indicates the working area, and the black area indicates the non-working area. If the direction of the self-moving device is clockwise, according to Figure 4 , because when moving along the boundary in the second posture, the working area needs to be located on the right side of the self-moving device and the non-working area needs to be located on the left side of the self-moving device, and this feature is met when circling clockwise along the outer boundary, therefore, it can be determined that the boundary type where the self-moving device is located is an outer boundary.
[0165] If the direction of the self-moving device is counterclockwise, according to Figure 4 , because when moving along the boundary in the second posture, the working area needs to be located on the right side of the self-moving device and the non-working area needs to be located on the left side of the self-moving device, and this feature is met when circling counterclockwise along the inner boundary, therefore, it can be determined that the boundary type where the self-moving device is located is an inner boundary.
[0166] Optionally, after this step, the method further includes: when it is determined that the boundary type is an inner boundary, controlling the self-moving device to rotate by a preset angle in a direction away from the non-working area, and triggering the step of controlling the self-moving device to detect the boundary. At this time, the self-moving device can be made to leave the inner boundary to detect the outer boundary, thereby improving the efficiency of detecting the outer boundary.
[0167] Among them, the preset angle can be pre-stored in the mobile device, and the value of the preset angle can be a fixed value, or it can be a value set by the user, for example: the preset angle can be 45° or 135°. This embodiment does not limit the value and setting method of the preset angle.
[0168] Alternatively, when it is determined that the boundary type is an outer boundary, the mobile device is controlled to continue moving along the boundary.
[0169] In order to more clearly understand the process of the self-moving device moving along the edge, the following takes the above-mentioned first method of determining the circling direction as an example to introduce the process of the self-moving device identifying the boundary type provided by this embodiment. When the boundary is detected, the self-moving device moves along the boundary in the first posture as an example. Figure 5 , the process includes at least the following steps:
[0170] Step 51, obtaining heading information collected in the current mobile control cycle from the mobile device;
[0171] Each time the mobile device detects the boundary type, it includes multiple movement control cycles, and the movement control cycle is the cycle for the mobile device to detect the boundary type. For the first movement control cycle, the mobile device determines the boundary type based on the heading information collected in the first movement control cycle; for the i-th movement control cycle after the first movement control cycle, the mobile device determines the boundary type based on the heading information collected in the movement control cycle and the heading information collected in each movement control cycle before the i-th movement control cycle.
[0172] Step 52, comparing the heading information with the first identification set, and if the heading information includes a heading that is the same as a preset heading in the first identification set, marking the preset heading that matches the heading;
[0173] Step 53, determine whether the first identification set is all marked; if so, execute step 57; if not, execute step 54;
[0174] Step 54, determining the angle difference between the current heading and the previous heading in the heading information to determine the sign of the angle difference; if it is positive, executing step 55; if it is negative, executing step 56;
[0175] Step 55, updating the attribute of the heading identifier in the second identifier set that matches the current heading to 1; executing step 591;
[0176] Step 56, updating the attribute of the identifier of the heading matching the current heading in the third identifier set to 1; executing step 591;
[0177] Step 57, determining whether the proportion of the attribute being 1 in the second identification set is greater than the proportion of the attribute being 1 in the third identification set; if so, determining that the circling direction is clockwise, and executing step 58; if not, determining that the circling direction is counterclockwise, and executing step 59;
[0178] Step 58, determine that the circling direction is clockwise, and then determine that the boundary type is an inner boundary, control the mobile device to turn left 135 degrees and then move in a straight line, reset all the marks in the first mark set, the second mark set, and the third mark set; the process ends;
[0179] Step 59, determine that the circling direction is counterclockwise, and then determine that the boundary type is an outer boundary, reset all the marks in the first mark set, the second mark set, and the third mark set, and the process ends;
[0180] Step 591, execute the next movement control cycle.
[0181] refer to Figure 6, assuming that the right side of the moving direction of the self-moving device is the non-working area and the left side is the working area, the non-working area defined by the inner boundary 61 is a rectangle. At this time, the self-moving device detects the boundary in response to the edge movement instruction. If the self-moving device is determined to have circled at least one time during the edge movement, and the circling direction is clockwise, indicating that the current circling boundary type is the inner boundary, then it rotates 45° to the left (i.e., away from the non-working area) and moves in a straight line, and the step of detecting the boundary is performed again, and then the outer boundary 62 will be detected.
[0182] refer to Figure 7 , assuming that the right side of the moving direction of the self-moving device is the non-working area and the left side is the working area, the non-working area defined by the inner boundary 71 is a circle. At this time, the self-moving device detects the boundary in response to the edge movement instruction. If the self-moving device is determined to have circled at least one time during the edge movement, and the circle direction is clockwise, indicating that the current circled boundary type is the inner boundary, then it rotates 45° to the left and moves along a straight line, and executes the step of detecting the boundary again, and then the outer boundary 72 is detected.
[0183] according to Figure 6 and Figure 7 It can be seen that the mobile control method provided in this embodiment can identify non-working areas of any size and shape inside the target area. At the same time, the mobile device can identify that the currently detected boundary is the inner boundary by circling no more than two circles. In this way, the problem of the robot moving around the non-working area inside the target area during the edge process can be solved, thereby improving the efficiency of boundary recognition.
[0184] In another example, Fig. 9 If there is a partial working area surrounded by a non-working area in the target area, the partial working area surrounded by the non-working area forms a narrow area, and the narrow area is an area closed on three sides, and the exit is slightly larger than the width of the self-moving device. After the self-moving device enters the narrow area from the exit, it may move along the inner boundary 91 of the narrow area in the narrow area. When it moves to the exit, the boundary sensor senses the inner boundary 91 of the narrow area again, causing the self-moving device to continue to move along the inner boundary 91 of the narrow area. In this way, the self-moving device always moves along the inner boundary 91 of the narrow area in the narrow area and cannot escape from the narrow area.
[0185] When the processor 150 executes the program, it can also Figure 2 Based on the method for identifying the boundary type, when it is determined based on the heading information set that the mobile device has circled along the boundary 91 for at least a preset number of times and the boundary type is determined to be an outer boundary according to the circling direction of the mobile device, at least the following steps are performed to identify the boundary type as an outer boundary or an inner boundary of a narrow area:
[0186] Step 204 , based on the heading information set, it is determined that the mobile device has circled along the boundary 91 for at least a preset number of times, and that the movement data of the mobile device circling along the boundary for at least twice the preset number of times is less than the preset movement data.
[0187] In one example, when a mobile device moves along an inner boundary 91 of a narrow area, its circling direction is consistent with the circling direction of the mobile device when the boundary type is an outer boundary 92. Based solely on the circling direction, the processor may mistakenly determine that the mobile device is moving along the outer boundary.
[0188] Therefore, for example, if the preset number of circles is three quarters, then when the mobile device has moved three quarters along the boundary 91 and the processor mistakenly determines that the boundary type is on the outer boundary based on the circling direction, in order to avoid misjudgment, the processor controls the mobile device to continue to move three quarters along the boundary 91 after recognizing the boundary 91 again. If the processor again determines that the circling direction of these three quarters is consistent with the circling direction of the mobile device when the boundary type is the outer boundary, then the movement data of the mobile device moving two three quarters along the boundary 91 is less than the preset movement data. For example, the movement time of the mobile device moving two three quarters along the boundary is less than the preset movement time, or the movement distance of the mobile device moving two three quarters along the boundary is less than the preset movement distance, then the boundary type is judged to be the inner boundary of a narrow area.
[0189] In another example, if there is a non-working area 101 whose boundary is difficult to identify in the target area, such as a flower bed, a deep ditch or a pond, the boundary sensor of the self-moving device may not be able to accurately identify the inner boundary, that is, the boundary of the non-working area, which may cause the self-moving device to mistakenly enter the non-working area.
[0190] In order to prevent the self-moving device from mistakenly entering a non-working area whose border is difficult to identify, a magnetic stripe may be set in the non-working area whose border is difficult to identify, and a magnetic field sensing device may be set on the self-moving device. If the self-moving device moves along the magnetic stripe according to the sensing result of the magnetic field sensing device, the posture of moving along the magnetic stripe may be opposite to the posture of moving along the border. At this time, in order to prevent the processor from misjudging the boundary type according to the circling direction of the self-moving device, the inner boundary where the magnetic stripe is set is judged as the outer boundary. When the outer boundary processor 150 executes the program, it may also be as follows Figure 2 On the basis of the method for identifying the boundary type, when it is determined based on the heading information set that the self-moving device has circled along the boundary for at least a preset number of times and the boundary type is determined to be an outer boundary according to the circle direction of the self-moving device, at least the following steps are performed to identify that the boundary type is an inner boundary with a magnetic strip set:
[0191] Step 205, based on the heading information set, determine the movement data of the mobile device along the magnetic stripe, compare the movement data with the collected data of the heading information set, and if the ratio of the movement data to the collected data is greater than a preset ratio, determine that the boundary type is the inner boundary of the magnetic stripe.
[0192] For example, the movement data includes the movement time or the movement distance, and the collection data includes the collection time or the collection distance of the collection of the heading set information. If it is determined based on the heading information set that the self-moving device has circled along the boundary for at least a preset number of times, such as three quarters of a circle, and the boundary type is determined to be an outer boundary based on the circling direction of the self-moving device, it is determined that the ratio of the movement time or the movement distance of the self-moving device along the magnetic stripe to the collection time or the collection distance of the collection of the heading set information is greater than a preset ratio, such as three quarters, then the boundary type is determined to be an inner boundary with a magnetic stripe set. In summary, the method for identifying the boundary type of the self-moving device provided in this embodiment first determines that the self-moving device has circled along the boundary for at least a preset number of times based on the heading, then determines the circling direction of the self-moving device based on the angular difference between the headings, and finally determines the boundary type based on the circling direction; it can solve the problem that the self-moving device may move along the wrong boundary due to the inability of the self-moving device to identify the boundary type; because the self-moving device can determine the boundary type based on the circling direction, it can enable the self-moving device to determine whether the current boundary is a boundary that needs to be moved along the edge, thereby ensuring that the self-moving device moves along the desired boundary.
[0193] In addition, since the self-moving device does not directly use the accumulated sum of the heading differences to determine the boundary type, but instead obtains the orbiting direction when the self-moving device orbits along the boundary for at least a preset number of times, and determines the boundary type based on the orbiting direction, the problem of incorrect boundary type identification caused by the self-moving device rotating 360° on the spot can be avoided, thereby improving the accuracy of boundary type identification.
[0194] In addition, by judging the number of preset headings in the first identification set included in the heading information, it is determined whether the self-moving device has circled along the border for at least a preset number of times. Since only the heading is compared with the preset heading during the determination process, no cumulative error is introduced, thereby improving the accuracy of determining whether the self-moving device has circled along the border for at least a preset number of times.
[0195] In addition, by obtaining the second identification set corresponding to the clockwise circling direction and the third identification set corresponding to the counterclockwise circling direction; updating the attributes of the heading identification in the second identification set and the third identification set based on the angle difference, so as to determine the circling direction based on each attribute; the self-moving device does not need to accumulate the angle difference when determining the circling trend. In this way, the acquisition error of the sensor will not be accumulated with the accumulation of the angle difference, which can improve the accuracy of determining the circling trend, thereby improving the accuracy of determining the circling direction.
[0196] In addition, by rotating the preset angle away from the non-working area and then moving when the boundary type is an inner boundary, the self-moving device can be separated from the non-working area currently surrounded, thereby improving the efficiency of the self-moving device leaving the non-working area.
[0197] Figure 8 This is a block diagram of a device for identifying boundary types of a self-moving device provided by an embodiment of the present application. The self-moving device is suitable for working in a target area surrounded by an outer boundary; the target area has a non-working area surrounded by an inner boundary; the self-moving device is provided with a sensor for collecting the heading of the self-moving device; the device includes at least the following modules: a boundary detection module 810, a heading acquisition module 820, a direction determination module 830, and a type determination module 840.
[0198] The boundary detection module 810 is used to control the self-moving device to detect the boundary in response to the edge movement instruction;
[0199] A heading acquisition module 820 is used to control the self-moving device to move along the boundary when a boundary is detected, and to acquire heading information collected by the sensor during the movement; the heading information includes multiple headings determined based on a preset reference direction;
[0200] A direction determination module 830 is used to determine the circling direction of the self-moving device according to the angle difference between the headings when it is determined based on the heading information that the self-moving device has circled along the border for at least a preset number of times; the circling direction is clockwise or counterclockwise;
[0201] The type determination module 840 is configured to determine a boundary type according to the surrounding direction, wherein the boundary type is the inner boundary or the outer boundary.
[0202] For relevant details, refer to the above embodiments.
[0203] It should be noted that: the device for identifying the boundary type of a self-mobile device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing the identification of the boundary type of the self-mobile device. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device for identifying the boundary type of a self-mobile device is divided into different functional modules to complete all or part of the functions described above.
[0204] In addition, the apparatus for identifying boundary types of a mobile device provided in the above embodiment and the method embodiment for identifying boundary types of a mobile device provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0205] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the method for identifying boundary types from a mobile device in the above method embodiment.
[0206] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the method of identifying boundary types of a mobile device in the above method embodiment.
[0207] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0208] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for identifying boundary types from a mobile device, characterized in that: The self-moving device is suitable for working in a target area surrounded by an outer boundary; the target area has a non-working area surrounded by an inner boundary; the self-moving device is provided with a sensor for collecting the heading of the self-moving device; the method comprises: In response to the edge movement instruction, controlling the self-moving device to detect the boundary; When a boundary is detected, the self-moving device is controlled to move along the boundary, and heading information collected by the sensor during the movement is obtained; the heading information includes multiple headings determined based on a preset reference direction; In the case where it is determined based on the heading information that the self-moving device has circled along the border for at least a preset number of times, determining the circling direction of the self-moving device according to the angle difference between the headings; the circling direction is clockwise or counterclockwise; A boundary type is determined according to the surrounding direction, and the boundary type is the inner boundary or the outer boundary.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a first identification set; the first identification set includes a preset heading representing a preset number of rotations of the mobile device; Determining the number of preset headings included in the heading information; When the number of the included preset headings is greater than or equal to a threshold, determining that the mobile device circles along the border for at least a preset number of times; When the heading information does not include a preset heading or the number of the included preset headings is less than a threshold, it is determined that the self-moving device has not circled along the border for at least a preset number of times.
3. The method according to claim 1, characterized in that The step of determining the circumferential direction of the self-moving device according to the angle difference between the heading information includes: Calculate the angle difference between the heading information according to a preset period; Based on all the angle differences, the circumferential direction of the self-moving device is determined.
4. The method according to claim 3, characterized in that: The determining the circumferential direction of the self-moving device based on all the angle differences includes: Acquire a second identification set and a third identification set; the second identification set includes an identification representing each heading that may be passed through a preset number of clockwise rotations, and the second identification set corresponds to the first symbol; the third identification set includes an identification of each heading that may be passed through a counterclockwise rotation, and the third identification set corresponds to the second symbol; initialize the attributes of each identification to be the first attribute; When the sign of the angle difference is the first sign, updating the attribute of the heading in the second identification set that matches the angle difference to a second attribute; When the sign of the angle difference is the second sign, updating the attribute of the heading in the third identification set that matches the angle difference to the second attribute; The circling direction of the self-moving device is determined according to the proportion of the headings of the second attribute in the second identification set and the proportion of the headings of the second attribute in the third identification set.
5. The method according to claim 4, characterized in that The determining the circling direction of the self-moving device according to the proportion of the headings of the second attribute in the second identification set and the proportion of the headings of the second attribute in the third identification set includes: When the proportion of the heading of the second attribute in the second identification set is greater than the proportion of the heading of the second attribute in the third identification set, determining that the circling direction of the self-moving device is clockwise; When the proportion of the heading of the second attribute in the third identification set is greater than the proportion of the heading of the second attribute in the second identification set, it is determined that the circling direction of the self-moving device is counterclockwise.
6. The method according to claim 3, characterized in that The determining the circumferential direction of the self-moving device based on all the angle differences includes: Determine the sign of each angular difference; the sign includes a first sign and a second sign; the first sign indicates clockwise rotation, and the second sign indicates counterclockwise rotation; Accumulate the angle difference of the first symbol to obtain the clockwise rotation angle; Accumulate the angle difference of the second symbol to obtain the counterclockwise rotation angle; The circumferential direction of the self-moving device is determined according to the clockwise rotation angle and the counterclockwise rotation angle.
7. The method according to claim 6, characterized in that The determining the circumferential direction of the self-moving device according to the clockwise rotation angle and the counterclockwise rotation angle includes: When the absolute value of the clockwise rotation angle is greater than the absolute value of the counterclockwise rotation angle, determining that the circling direction is clockwise; When the absolute value of the counterclockwise rotation angle is greater than the absolute value of the clockwise rotation angle, the circling direction is determined to be counterclockwise.
8. The method according to claim 1, characterized in that The determining of the boundary type according to the surrounding direction includes: Based on the right side of the moving direction of the self-moving device being the non-working area and the left side being the working area, if the circling direction is clockwise, the boundary type is determined to be an inner boundary; if the circling direction is counterclockwise, the boundary type is determined to be an outer boundary; or, Based on the right side of the moving direction of the self-moving device as the working area and the left side as the non-working area, if the surrounding direction is clockwise, the boundary type is determined to be an outer boundary; if the surrounding direction is counterclockwise, the boundary type is determined to be an inner boundary.
9. The method according to claim 1, characterized in that: After determining the boundary type according to the surrounding direction, the method further includes: In the case where the boundary type is the inner boundary, controlling the self-moving device to rotate by a preset angle in a direction away from the non-working area, and triggering the step of controlling the self-moving device to detect the boundary; When the boundary type is the outer boundary, the self-moving device is controlled to continue moving along the boundary.
10. The method according to claim 5, wherein determining the boundary type according to the surrounding direction comprises: Based on the right side of the moving direction of the self-moving device as the non-working area and the left side as the working area, if the circling direction is counterclockwise, the circling direction of the self-moving device is determined according to the angle difference between the headings when it is determined based on the heading information that the self-moving device has circled along the boundary for at least a preset number of times; Determine whether the movement data of the self-moving device around the boundary for at least twice the preset number of times is less than the preset movement data.
