Height adjustment method, height adjustment device, self-contained equipment and storage medium
By dynamically adjusting the height of the operating device of the self-moving equipment and adapting to different terrains according to terrain characteristics, the problem of equipment loss when working on uneven ground is solved and the work effect is improved.
Patent Information
- Application Number
- CN202211253210.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-10-13
AI Technical Summary
Automobile equipment cannot accurately adjust its working status when the ground is not flat or there are obstacles, resulting in equipment loss and poor working results.
By obtaining the initial angle between the swing arm and the vertical direction, terrain features in the forward direction of the mobile device, calculating the target height and target angle, and using the drive shaft to drive the swing arm to rotate and adjust the work device to the target height, dynamic adaptation to terrain features is achieved. .
It reduces the loss caused by the collision between the mobile equipment and the ground protrusions or obstacles, and improves the working effect and reliability of the equipment.
Smart Images

Figure CN115402046B
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of self-moving equipment, and in particular, relates to a height adjustment method, a height adjustment device, a self-moving equipment and a storage medium. Background Art
[0002] At present, during the operation of the self-moving device, the working scene is not necessarily on a flat ground. There are often hillocks or other obstacles on the ground. When the self-moving device is working on a ground with variable terrain, it is necessary to accurately adjust the working state of the self-moving device according to different terrain characteristics to avoid damage to the self-moving device.
[0003] However, in the related art, when the self-moving device transitions from flat ground to a hill or encounters an obstacle, it is impossible to accurately adjust the working state of the self-moving device, which easily causes the self-moving device to be damaged and the working effect of the self-moving device cannot be guaranteed. Summary of the invention
[0004] The embodiments of the present application provide a height adjustment method, a height adjustment device, a self-moving device and a storage medium to solve the problem that the self-moving device is damaged due to the inability to accurately adjust the working state.
[0005] In a first aspect, an embodiment of the present application provides a height adjustment method, which is applied to a self-moving device, wherein the self-moving device includes a lifting device and an operating device, wherein the lifting device includes a driving motor and a swing arm, wherein a driving shaft of the driving motor is used to drive the swing arm to rotate around the driving shaft, and the swing arm is used to connect the operating device, and the height adjustment method includes:
[0006] Get the initial angle between the swing arm and the vertical direction;
[0007] Obtain terrain features in the direction of movement of the mobile device;
[0008] Determine the target height of the operating device based on terrain features;
[0009] Calculate the target angle between the swing arm and the vertical direction according to the target height;
[0010] Calculate the rotation angle based on the target angle and the initial angle;
[0011] The swing arm is driven by a drive shaft to rotate a certain angle so as to adjust the working device to a target height.
[0012] A second aspect of the embodiment of the present application further provides a height adjustment device, which is applied to a self-moving device. The self-moving device includes a lifting device and an operating device. The lifting device includes a driving motor and a swing arm. The driving shaft of the driving motor is used to drive the swing arm to rotate around the driving shaft. The swing arm is used to connect the operating device. The height adjustment device includes:
[0013] The initial angle module is used to obtain the initial angle between the swing arm and the vertical direction;
[0014] A terrain recognition module is used to obtain terrain features in the direction of the mobile device;
[0015] A height calculation module, used to determine the target height of the working device according to the terrain characteristics;
[0016] An angle calculation module, used to calculate the target angle between the swing arm and the vertical direction according to the target height;
[0017] A rotation angle module is used to calculate the rotation angle according to the target angle and the initial angle;
[0018] The height adjustment module is used to drive the swing arm to rotate a certain angle through a drive shaft so as to adjust the working device to a target height.
[0019] The third aspect of the embodiment of the present application also provides a self-moving device, which includes a processor, a memory, a lifting device and an operating device. The lifting device includes a drive motor and a swing arm. The drive shaft of the drive motor is used to drive the swing arm to rotate around the drive shaft. The swing arm is used to connect the operating device. The processor is used to implement the above-mentioned height adjustment method when executing the computer program stored in the memory.
[0020] A fourth aspect of the embodiments of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned height adjustment method is implemented.
[0021] The above-mentioned height adjustment method, height adjustment device, self-moving device and storage medium provided in the embodiments of the present application detect the terrain features in the forward direction of the self-moving device to determine whether it is necessary to adjust the height state of the working device in the self-moving device, and adjust the working device of the self-moving device to the target height according to the terrain features, thereby reducing the loss caused by the collision between the working device of the self-moving device and ground protrusions or obstacles. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 It is a schematic diagram of the process of the height adjustment method provided in the embodiment of the present application;
[0024] Figure 2It is a schematic diagram of the structure of a self-moving device provided in an embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of the process of obtaining the initial angle provided in an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of a process for determining target height provided in an embodiment of the present application;
[0027] Figure 5 is a schematic diagram of the structure of a height adjustment device provided in an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of the structure of a self-moving device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present application. The described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0032] During the operation of the self-moving device, the working scene is not necessarily on a flat ground. There are often small hills or other obstacles on the ground. When the self-moving device transitions from a flat ground to a hill or encounters an obstacle, it is usually unable to accurately adjust the working state of the self-moving device, resulting in damage to the self-moving device and failure to ensure the working effect of the self-moving device.
[0033] The autonomous mobile device may be a device including an autonomous mobile assistance function, or may be a semi-autonomous mobile device or a fully autonomous mobile device.
[0034] Take a lawn mower robot as an example. When the lawn mower robot moves on a lawn with a grass slope to mow, since the lawn is not flat, there may be raised hillocks or obstacles such as stones, trees, fences, etc. When the lawn mower robot works on a ground with a changeable terrain, if it cannot accurately adjust its working state in time according to different terrain features, the blade of the lawn mower robot may collide, resulting in the wear of the blade of the lawn mower robot.
[0035] It can be seen that there is an urgent need for a height adjustment method so that the self-moving device can accurately adjust the working state of the self-moving device under different terrain features, so as to reduce the loss of the self-moving device and ensure the working effect of the self-moving device.
[0036] The height adjustment method provided in the embodiment of the present invention may be executed by a self-moving device, and accordingly, the height adjustment device may be arranged in the self-moving device. Figure 1 Schematic diagram of the height adjustment method provided in the embodiment of the present application. Figure 1 As shown, the height adjustment method may include the following steps. According to different requirements, the order of the steps in the flowchart may be changed, and some may be omitted.
[0037] S11, obtaining the initial angle between the swing arm and the vertical direction.
[0038] In the embodiment of the present application, the vertical direction refers to the direction perpendicular to the ground, and the initial angle may be the angle formed by the swing arm of the self-moving device and the vertical direction before the working device is adjusted to the target height. Figure 2 The following describes a partial structure of a self-moving device provided by an embodiment of the present application. In actual applications, the self-moving device 30 includes more or fewer parts. The self-moving device 30 includes a lifting device 22 and an operating device 21. The lifting device 22 includes a driving motor 222 and a swing arm 221. The driving shaft (not shown) of the driving motor 222 is used to drive the swing arm 221 to rotate around the driving shaft. The swing arm 221 is used to connect the operating device 21. The swing arm 221 is driven by the driving shaft to rotate a certain angle to achieve height adjustment of the operating device 21. For example, the self-moving device 30 is a lawn mower robot. The operating device 21 in the lawn mower robot can be a cutter disc, and the lawn mower robot completes the lawn mowing operation through the cutter disc.
[0039] In one embodiment, the swing arm 221 includes a first end and a second end, the first end is connected to the driving shaft of the driving motor 222, and the second end is connected to the working device 21. The initial angle can be the angle between the first end of the swing arm 221 and the vertical direction when the self-moving device 30 performs the operation, such as Figure 2 The angle θ shown. Taking the self-moving device 30 as a lawn mower robot as an example, when the lawn mower robot performs a lawn mowing operation, the working device 21 maintains a certain distance from the ground to ensure that the height of the grass on the lawn is consistent. At this time, the angle between the first end of the swing arm 221 and the vertical direction is the initial angle. When the lawn mower robot needs to be adjusted to the target height when going uphill or encountering other obstacles, the initial angle is adjusted to avoid collision of the blade of the lawn mower robot and equipment loss.
[0040] Combined with the following Figure 3The process of obtaining the initial angle provided in the embodiment of the present application is described. Optionally, obtaining the initial angle between the swing arm and the vertical direction includes:
[0041] S110, obtaining an initial height of the working device, a swing arm length of the swing arm, and a height of the driving shaft from the ground.
[0042] The initial height of the working device 21 refers to the height of the working device 21 from the ground before the working device is adjusted to the target height, which can be recorded as h 0 .like Figure 2 As shown, the working device 21 includes a connecting member and a working member, wherein the connecting member is used to connect the swing arm 221 and the working member, and the working member is used to perform related operations. The length of the connecting member is denoted as b.
[0043] In one embodiment, regardless of the length of the connecting member, the initial height of the working device 21 can be understood as the height of the second end of the swing arm 221 from the ground. In other embodiments, considering the length of the connecting member, the initial height of the working device 21 can be understood as the height of the top of the working piece from the ground. The length of the swing arm 221 refers to the distance from the first end to the second end of the swing arm 221, which is recorded as L. The height of the drive shaft from the ground is recorded as H.
[0044] S111, calculating the height difference between the height above the ground and the initial height.
[0045] In one embodiment, the initial height of the working device 21 is taken as the height of the second end of the swing arm 221 from the ground. The height H of the driving shaft from the ground and the initial height h are calculated. 0 The height difference is denoted as Hh 0 .
[0046] In other embodiments, taking the initial height of the working device 21 as the height of the top of the workpiece from the ground as an example, the height of the second end of the swing arm 221 from the ground is first calculated and recorded as h 0 +b, and then calculate the height difference between the driving shaft and the second end of the swing arm 221 from the ground, recorded as H-(h 0 +b).
[0047] S112, calling a preset inverse trigonometric function to calculate the height difference and the length of the swing arm to obtain an initial angle between the swing arm and the vertical direction.
[0048] In one embodiment, the initial height of the working device 21 is taken as the height of the second end of the swing arm 221 from the ground. The height difference between the height of the driving shaft from the ground and the initial height is calculated and recorded as Hh. 0 The initial angle between the swing arm 221 and the vertical direction is denoted as θ 0In one embodiment, the preset inverse trigonometric function is a preset inverse cosine function, and the following formula 1 is called to calculate the height difference and the length of the swing arm 221 to obtain the initial angle between the swing arm 221 and the vertical direction.
[0049] θ 0 =arcos((Hh 0 ) / L)Formula 1
[0050] In other embodiments, taking the initial height of the working device 21 as the height of the top of the workpiece from the ground as an example, the height of the second end of the swing arm 221 from the ground is first calculated and recorded as h 0 +b, and then calculate the height difference between the driving shaft and the second end of the swing arm 221 from the ground, recorded as H-(h 0 + b). The initial angle between the swing arm 221 and the vertical direction is denoted as θ 0 In one embodiment, the preset inverse trigonometric function is a preset inverse cosine function, and the following formula 2 is called to calculate the height difference and the length of the swing arm 221 to obtain the initial angle between the swing arm 221 and the vertical direction.
[0051] θ 0 =arcos((H-(h 0 +b)) / L)) Formula 2
[0052] In some embodiments, the present application further comprises:
[0053] S113, after the mobile device is powered on, obtaining the actual measured encoder value of the encoder.
[0054] In at least one embodiment of the present application, the drive shaft is provided with an encoder, and the encoder corresponds to an encoder value, and the encoder value is used to reflect the angle information between the swing arm 221 and the vertical direction. Exemplarily, the current angle between the swing arm 221 and the vertical direction corresponds to the measured encoder value. In one embodiment, the measured encoder value may refer to the encoder value corresponding to the current angle between the first end of the swing arm 221 and the vertical direction after the mobile device 30 is powered on.
[0055] S114, obtaining an initial encoder value corresponding to the initial angle.
[0056] In one embodiment, the initial angle between the swing arm 221 and the vertical direction corresponds to the initial encoder value, and the initial encoder value may refer to the encoder value corresponding to the angle between the first end of the swing arm 221 and the vertical direction when the self-moving device 30 is performing work. The self-moving device 30 can obtain the initial encoder value of the self-moving device 30 when performing work, and store the initial encoder value and the initial angle in a preset database. Subsequently, if a power outage occurs during the operation of the self-moving device 30, the method of the present application can read the initial encoder value and the measured encoder value when the power outage occurs after the self-moving device 30 is powered on. The current height of the working device 21 can be obtained by calculating the measured encoder value and the initial encoder value, thereby realizing the height memory and height feedback of the self-moving device 30 after power outage, and the current height of the working device 21 can be obtained in time, thereby improving the speed and reliability of height adjustment.
[0057] S115, calculating the encoder difference between the measured encoder value and the initial encoder value.
[0058] The initial encoder value is recorded as encode_zero, the measured encoder value is recorded as encode_new, and the encoder difference is recorded as ΔEncode. The encoder difference ΔEncode can be calculated by the following formula 3:
[0059] ΔEncode=encode_new-encode_zero formula 3
[0060] S116, determining the adjustment angle value according to the encoder difference.
[0061] There is a corresponding relationship between the encoder difference and the adjustment angle value. The adjustment angle value Δθ can be determined according to the encoder difference through the following formula 4:
[0062] Δθ=ΔEncode / Encode_max*360 Formula 4
[0063] Among them, Encode_max refers to the maximum value of the encoder output.
[0064] S117, determining the measured angle according to the initial angle and the adjusted angle value.
[0065] The measured angle can be determined based on the initial angle and the adjusted angle value by the following formula 5:
[0066] θ=Δθ+θ 0 Formula 5
[0067] S118, determining the current height of the working device according to the measured angle.
[0068] The current height of the working device 21 can be determined according to the measured angle by the following formula 6:
[0069] h=HL*cos(θ) Formula 6
[0070] Among them, the initial encoder value and the measured encoder value may be the same or different. When the initial encoder value is the same as the measured encoder value, the current height of the working device 21 is the initial height; when the initial encoder value is different from the measured encoder value, the measured encoder value may be greater than the initial encoder value or less than the initial encoder value, and there is no restriction here. When the measured encoder value is greater than the initial encoder value, it indicates that the current height of the working device 21 is higher than the initial height of the working device 21; when the measured encoder value is less than the initial encoder value, it indicates that the current height of the working device 21 is lower than the initial height of the working device 21.
[0071] S12, obtaining terrain features in the direction in which the mobile device moves.
[0072] In at least one embodiment of the present application, since the working scene of the self-moving device 30 is not a flat ground, there may be protruding hills or other obstacles such as trees, stones, fences, etc. In order to reduce the equipment loss caused by the self-moving device 30 encountering such obstacles, it is necessary to detect the terrain features in the forward direction of the self-moving device 30.
[0073] In one embodiment, the self-mobile device 30 is equipped with an image acquisition device, which is used to acquire an image of the environment in the direction of the self-mobile device 30. In one embodiment, the image acquisition device can be a depth camera, a laser scanner, or a laser radar, etc., which is not limited here.
[0074] The terrain features include flat features and non-flat features. The flat features are used to identify the ground in the direction of the moving device 30 as flat ground, and the non-flat features are used to identify the ground in the direction of the moving device 30 as non-flat ground. There may be protruding hills or other obstacles such as trees, stones, fences, etc. on the non-flat ground.
[0075] It is understandable that when the slope of the protruding hillock is sufficient for the self-moving device 30 to climb up the slope, the hillock has no effect on the normal operation of the self-moving device 30; when the slope of the protruding hillock is too high and the self-moving device 30 cannot climb up the slope, the hillock affects the normal operation of the self-moving device 30, and the self-moving device 30 can be controlled to detour along the non-flat features. When the estimated height of the highest point of other obstacles (such as fences, stones, and trees) from the ground is less than or equal to the maximum height that the working device 21 can adjust (also called the preset height threshold), the working device 21 can be adjusted in height without changing the forward direction of the self-moving device 30; when the estimated height of the highest point of other obstacles (such as fences, stones, and trees) from the ground is greater than the maximum height that the working device 21 can adjust (also called the preset height threshold), the working device 21 cannot be adjusted in height to meet the effect of avoiding collision, and the self-moving device 30 is controlled to detour along the non-flat features.
[0076] In the embodiment of the present application, the terrain features in the direction of the mobile device are obtained, including:
[0077] S120, obtaining an environment image in the direction in which the mobile device is moving.
[0078] The environment image refers to an image of the physical environment in the direction of the mobile device 30. The environment image may be an RGB image and a depth image. The environment image includes images of the ground area and images of areas outside the ground area.
[0079] S121, performing image recognition on the environment image to obtain terrain features corresponding to the environment image.
[0080] When the environment image is a depth image, clustering processing can be performed on the point cloud data of the depth image to obtain point cloud data of objects corresponding to the moving direction of the self-mobile device 30. Taking the self-mobile device 30 as a lawn mowing robot as an example, the point cloud data in the environment image may include point cloud data corresponding to the ground, point cloud data corresponding to the grass slope, point cloud data corresponding to the stone, and point cloud data corresponding to the tree. When the environment image is an RGB image, color recognition can be performed on each image area of the environment image to segment the terrain features corresponding to different colors. Continuing with the lawn mowing robot as an example, the terrain features corresponding to different colors can be grass features and non-grass features, and the non-grass features can be fences, stones, trees, etc.
[0081] In one embodiment, performing image recognition on an environment image to obtain terrain features corresponding to the environment image includes:
[0082] S1210, determining original point cloud data corresponding to the environment image.
[0083] The terrain features corresponding to the environment image include flat features and non-flat features. When the environment image is composed of point cloud data, the point cloud data corresponding to all terrain features in the environment image are original point cloud data. The original point cloud data may include point cloud data corresponding to flat features and point cloud data corresponding to non-flat features.
[0084] S1211, when there are other point cloud data in the original point cloud data besides the ground point cloud data, the ground point cloud data is removed from the original point cloud data to obtain target point cloud data.
[0085] In one embodiment, the point cloud data corresponding to the flat ground feature may refer to the point cloud data corresponding to the ground (also referred to as ground point cloud data), and the point cloud data corresponding to the non-flat ground feature may include point cloud data corresponding to the slope (also referred to as the first point cloud data) and point cloud data corresponding to the obstacle (also referred to as the second point cloud data). The point cloud data corresponding to the slope may be the point cloud data corresponding to the grass slope, and the point cloud data corresponding to the obstacle may include the point cloud data corresponding to the stone, the point cloud data corresponding to the tree, etc. Since the ground is not an obstacle, and the ground point cloud data will interfere with the fitting clustering process in the subsequent fitting clustering process. Therefore, when performing image recognition on the environmental image, it is not necessary to perform clustering processing on the ground point cloud data. In this case, the self-mobile device 30 can perform plane fitting from the original point cloud data, use the fitted plane as the ground, and remove the point cloud data on the plane, that is, remove the ground point cloud data, to obtain the target point cloud data.
[0086] S1212, performing plane fitting on the target point cloud data.
[0087] In one embodiment, when plane fitting is performed on the target point cloud data, the target point cloud data may be plane fitted by a Random Sample Consensus (Ransac) algorithm. It should be understood that the present application embodiment uses the Ransac algorithm as an example to fit the target point cloud data. In actual use, the plane fitting algorithm is not limited. For example, the least squares method may be used to fit the target point cloud data, or the gray value interpolation algorithm may be used to fit the target point cloud data.
[0088] S1213: When the target point cloud data is fitted to obtain a fitting plane, it is determined that the terrain features include a slope terrain and first point cloud data corresponding to the slope terrain.
[0089] In one embodiment, since the slope terrain has a larger volume in the environmental image, the number of point cloud data corresponding to the slope terrain is large, and most of the point cloud data of the slope are located in the same plane. In the process of fitting the point cloud data, the principle of fitting is to make the fitting plane have as many internal points as possible. Therefore, after plane fitting of the target point cloud data, the obtained fitting plane can be considered as the plane of the slope, and the first point cloud data on the fitting plane can be considered as the point cloud data of the slope.
[0090] S1214: When the target point cloud data contains second point cloud data in addition to the first point cloud data, it is determined that the terrain features contain obstacle features.
[0091] Specifically, the first point cloud data is removed from the target point cloud data to obtain the second point cloud data, and the second point cloud data is used as the point cloud data corresponding to the obstacle. In other embodiments, when a plane is not fitted, it means that the environment image does not include a slope terrain, so there is no situation where the slope point cloud data interferes with the clustering process. In this case, the target point cloud data can be directly used as the second point cloud data, and the second point cloud data can be used as the point cloud data corresponding to the obstacle.
[0092] S13, determining a target height of the working device according to the terrain characteristics.
[0093] In at least one embodiment of the present application, the target height refers to the lowest height at which the terrain features in the advancing direction of the mobile device 30 will not cause a collision with the working device 21 .
[0094] See also Figure 4 , combined with Figure 4 The target height determination process provided in the embodiment of the present application is described. In the embodiment of the present application, the target height of the working device 21 is determined according to the terrain features, including:
[0095] S130: When the terrain features include non-flat features, point cloud data corresponding to the non-flat features are determined by clustering.
[0096] Among them, non-flat features may include obstacle features and slope features, and obstacle features may include obstacle stones, obstacle trees, obstacle fences, and the like.
[0097] In one embodiment, when there are non-flat features in the environment image and the non-flat features include slope features, determining the point cloud data corresponding to the non-flat features by clustering includes: determining the original point cloud data corresponding to the environment image; when there are other point cloud data in the original point cloud data in addition to the ground point cloud data, removing the ground point cloud data from the original point cloud data to obtain the target point cloud data; performing fitting clustering processing on the target point cloud data; when the target point cloud data is fitted to obtain a fitting plane, the point cloud data in the fitting plane is used as the point cloud data corresponding to the slope feature. It should be understood that when the self-moving device 30 encounters a slope, it should be fully considered whether the slope of the slope is sufficient for the self-moving device 30 to climb, and the relationship between the estimated height from the highest point of the slope to the ground where the self-moving device is located and the preset height threshold does not affect the movement of the self-moving device on the slope. When the slope of the slope is sufficient for the self-moving device 30 to climb, the slope does not affect the normal operation of the self-moving device 30, and there is no need to detour the slope; when the slope of the slope is insufficient for the self-moving device 30 to climb, the self-moving device 30 is promptly controlled to detour along the non-flat features. After determining the point cloud data corresponding to the non-flat features by clustering, it also includes: determining the angle of the fitting plane relative to the ground; when the angle is greater than the preset angle threshold, the slope will affect the normal operation of the self-moving device 30, and the self-moving device 30 is controlled to detour along the non-flat features; when the angle is less than the preset angle threshold, the slope does not affect the normal operation of the self-moving device 30, and there is no need to detour the slope. Among them, the angle of the fitting plane relative to the ground can be understood as the slope of the slope, and the preset angle threshold is a preset maximum angle for evaluating the ability to climb. The embodiment of the present application determines the slope of the slope, and when the slope of the slope is greater than the preset angle threshold, promptly controls the self-moving device 30 to detour along the non-flat ground features, thereby reducing equipment damage caused by collision between the operating device of the self-moving device 30 and obstacles or slopes, thereby ensuring the working effect of the self-moving device 30.
[0098] In another embodiment, when the non-flat ground feature includes an obstacle feature, since the heights of one or more obstacles are generally different and the distribution of one or more obstacles has no fixed pattern, the distribution of the second point cloud data is relatively scattered. At this time, the second point cloud data is clustered, and the obtained obstacle point cloud data includes all obstacle point cloud data, and there will be no phenomenon of missed recognition, which effectively improves the accuracy of identifying obstacles. After the second point cloud data is clustered, one or more different cluster groups will be obtained, wherein the cluster group is a plurality of point cloud data obtained by clustering according to a preset obstacle category, and the number of points of the point cloud data included in different cluster groups is different. The number of points of the point cloud data corresponding to the cluster group of obstacle features will exceed a certain threshold, so the cluster group whose number of points of the corresponding point cloud data in the cluster group exceeds the threshold is determined as the obstacle feature cluster group. The algorithm for clustering is not limited. For example, the second point cloud data can be clustered using algorithms such as the k-means clustering algorithm, the Gaussian mixture model algorithm, and the expectation maximization algorithm. The embodiment of the present application uses the k-means clustering algorithm as an example, sets the termination condition of the extraction, the maximum number of iterations, and the method of selecting the cluster center in advance, and uses the k-means clustering algorithm to process the second point cloud data to obtain multiple cluster groups. Among them, the termination condition can be that the number of point cloud data reallocated to different cluster groups is less than three at the next clustering, or that the cluster centers of less than two cluster groups change at the next clustering. In one embodiment, point cloud data refers to a set of vectors in a three-dimensional coordinate system.
[0099] S131, determining the highest point of the non-flat land feature according to the point cloud data corresponding to the non-flat land feature.
[0100] Specifically, the highest point of the non-flat ground feature is determined according to the point cloud data corresponding to the non-flat ground feature, including:
[0101] Determine the non-flat feature cluster group corresponding to the non-flat feature;
[0102] Determine the target dimension data corresponding to the point cloud data in the non-flat feature cluster group;
[0103] The maximum value of the target dimension data is selected as the highest point of the non-flat feature.
[0104] Among them, the non-flat feature cluster group is also an obstacle feature cluster group. The target dimension data may refer to the dimension data of the identification height. For example, when the non-flat feature cluster group includes 10 point cloud data, the coordinates of the 10 point cloud data are (13, 54, 23), (15, 56, 44), (13, 51, 37), (16, 53, 22), (14, 54, 34), (16, 52, 71), (17, 53, 41), (19, 55, 35), (12, 49, 29), (18, 53, 49).
[0105] S132, determining an estimated height from the highest point to the level where the mobile device is located.
[0106] Continuing with the example of step S131 above, in the point cloud data, the coordinates corresponding to the point cloud data to which the point with the highest height belongs are (16, 52, 71), where the length corresponding to one coordinate unit is 1 cm, and the highest point of the non-flat feature is 71 cm from the ground.
[0107] S133: When the estimated height is less than or equal to the preset height threshold, the estimated height is determined to be the target height.
[0108] Among them, the preset height threshold can be used to identify the maximum height that the working device 21 of the self-moving device 30 can adjust. In one embodiment, the preset height threshold can be determined by the maximum angle that the swing arm 221 can adjust in the vertical direction away from the ground, and the height of the working device 21 corresponding to the maximum angle that the swing arm 221 can adjust in the vertical direction away from the ground is used as the preset height threshold. The height of the working device 21 from the ground determined according to the angle between the swing arm 221 and the vertical direction has been described in the previous text (see the description in S113-S118 for details), and will not be repeated here. When the estimated height is less than or equal to the preset height threshold, at this time, the height of the working device 21 can be adjusted to meet the effect of avoiding collision, and the estimated height is the target height. When the estimated height is greater than the preset height threshold, it is impossible to adjust the height of the working device 21 to meet the effect of avoiding collision, and the self-moving device 30 is controlled to bypass along the non-flat features.
[0109] It should be noted that when the estimated height is greater than the preset height threshold, the self-moving device 30 is controlled to detour along the non-flat ground feature.
[0110] S14, calculating a target angle between the swing arm and the vertical direction according to the target height.
[0111] The target angle is the angle between the swing arm and the vertical direction. The target angle can be calculated by combining the known target height of the working device, the length of the swing arm and the height of the drive shaft from the ground with the inverse trigonometric function. Specifically, the target angle between the swing arm and the vertical direction is calculated according to the target height, including:
[0112] S141, obtaining a target height of the working device, a swing arm length of the swing arm, and a height of the driving shaft from the ground.
[0113] In at least one embodiment of the present application, the target height of the working device 21 may refer to the lowest height of the working device 21 from the ground when the terrain features in the forward direction of the self-moving device 30 will not collide with the working device 21, which is denoted as h. In one embodiment, the working device 21 is connected to the second end of the swing arm 221, so the target height of the working position may also be understood as the height of the second end of the swing arm 221 from the ground. The length of the swing arm 221 may refer to the distance from the first end to the second end of the swing arm 221, which is denoted as L. The height of the drive shaft from the ground is denoted as H.
[0114] S142, calculating a target height difference between the height above the ground and the target height.
[0115] For example, the height difference between the target height H of the working device and the height h from the ground can be recorded as Hh. The target angle between the swing arm 221 and the vertical direction is recorded as θ.
[0116] S143, calling a preset inverse trigonometric function to process the target height difference and the swing arm length to obtain a target angle between the swing arm and the vertical direction.
[0117] Continuing with the example of step S142, the preset inverse trigonometric function may be a preset inverse cosine function, and the following formula 7 may be called to process the target height difference and the length of the swing arm 221 to obtain the target angle between the swing arm 221 and the vertical direction.
[0118] θ=arcos((Hh) / L) Formula 7
[0119] S15, calculating the rotation angle according to the target angle and the initial angle.
[0120] In at least one embodiment of the present application, the angle difference between the target angle and the initial angle is used as the rotation angle. It should be understood that the target angle may be greater than the initial angle or less than the initial angle. When the target angle is less than or equal to the initial angle, there is no need to calculate the rotation angle. When the target angle is greater than the initial angle, it indicates that at the initial angle, the operating device 21 of the self-moving device 30 will collide with an obstacle in the forward direction and cause loss, and it is necessary to obtain the rotation angle according to the angle difference between the target angle and the initial angle, and then adjust the operating device 21 of the self-moving device 30 according to the rotation angle. When the target angle is less than the initial angle, it indicates that at the initial angle, the operating device 21 of the self-moving device 30 will not collide with an obstacle in the forward direction, and there is no need to obtain the rotation angle according to the angle difference between the target angle and the initial angle to adjust the operating device 21 of the self-moving device 30.
[0121] S16, driving the swing arm to rotate by a rotation angle through the driving shaft to adjust the working device to a target height.
[0122] In at least one embodiment of the present application, the drive shaft drives the swing arm 221 to rotate by a rotation angle in a direction away from the ground, so as to adjust the working device 21 to a target height.
[0123] In the above-mentioned height adjustment method provided in the embodiment of the present application, by monitoring the terrain features in the forward direction of the self-moving equipment to determine whether it is necessary to adjust the height state of the working device in the self-moving equipment, and adjusting the working device of the self-moving equipment to the target height according to the terrain features, it is possible to reduce the loss caused by collision of the self-moving equipment; and when adjusting the height state of the working device in the self-moving equipment, the present application controls the drive shaft to drive the swing arm to rotate a certain angle to adjust the working device of the self-moving equipment to the target height, thereby avoiding directly adjusting the height state of the working device, reducing the difficulty of height adjustment of the working device, and further ensuring the working effect of the self-moving equipment.
[0124] See also Figure 5 , Figure 5 2 is a schematic diagram of the structure of the height adjustment device provided in the embodiment of the present application. In some embodiments, the height adjustment device 20 may include a plurality of functional modules composed of computer program segments. The computer program of each program segment in the height adjustment device 20 may be stored in the memory of the mobile device and executed by at least one processor to execute (see Figure 1 Description) Height adjustment function.
[0125] In this embodiment, the height adjustment device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an initial angle module 201, a terrain recognition module 202, a height calculation module 203, an angle calculation module 204, a rotation angle module 205, and a height adjustment module 206. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0126] The initial angle module 201 can be used to obtain the initial angle between the swing arm and the vertical direction.
[0127] The terrain recognition module 202 may be used to obtain terrain features in the direction in which the mobile device is moving.
[0128] The altitude calculation module 203 may be used to determine the target altitude of the working device according to the terrain features.
[0129] The angle calculation module 204 may be used to calculate a target angle between the swing arm and the vertical direction according to a target height.
[0130] The rotation angle module 205 may be used to calculate a rotation angle according to a target angle and an initial angle.
[0131] The height adjustment module 206 can be used to drive the swing arm to rotate a certain angle through the drive shaft to adjust the working device to a target height.
[0132] In some embodiments, the initial angle module 201 may also be used to obtain the initial height of the working device, the swing arm length of the swing arm, and the height of the driving shaft from the ground;
[0133] In some embodiments, the initial angle module 201 may also be used to calculate the height difference between the height above the ground and the initial height;
[0134] In some implementations, the initial angle module 201 may also be used to call a preset inverse trigonometric function to process the height difference and the swing arm length to obtain an initial angle between the swing arm and the vertical direction.
[0135] In some implementations, the rotation angle module 205 may also be used to calculate the angle difference between the target angle and the initial angle to obtain the rotation angle.
[0136] In some embodiments, the terrain recognition module 202 may also be used to obtain an image of the environment in the direction in which the mobile device is moving;
[0137] In some implementations, the terrain recognition module 202 may also be used to perform image recognition on the environment image to obtain terrain features corresponding to the environment image.
[0138] In some embodiments, the height calculation module 203 may also be used to determine point cloud data corresponding to the non-flat features by clustering when the terrain features include non-flat features;
[0139] In some embodiments, the height calculation module 203 may also be used to determine the highest point of the non-flat feature according to the point cloud data corresponding to the non-flat feature;
[0140] In some implementations, the altitude calculation module 203 may also be used to determine an estimated altitude of the highest point from the horizontal plane where the mobile device is located;
[0141] In some implementations, the altitude calculation module 203 may also determine the estimated altitude as the target altitude when the estimated altitude is less than or equal to a preset altitude threshold.
[0142] In some implementations, the terrain identification module 202 may also be used to control the mobile device to detour along non-flat features when the estimated altitude is greater than a preset altitude threshold.
[0143] In some implementations, the height calculation module 203 may also obtain the measured encoder value of the encoder after the mobile device is powered on;
[0144] In some implementations, the height calculation module 203 may also obtain an initial encoder value corresponding to the initial angle;
[0145] In some implementations, the height calculation module 203 may also calculate an encoder difference between the measured encoder value and the initial encoder value;
[0146] In some implementations, the height calculation module 203 may also determine the adjustment angle value according to the encoder difference;
[0147] In some implementations, the angle calculation module 204 may also determine the measured angle based on the initial angle and the adjusted angle value;
[0148] In some implementations, the height calculation module 203 may also determine the current height of the working device based on the measured angle.
[0149] See also Figure 6 , Figure 6: is a schematic diagram of the structure of the self-moving device provided in the embodiment of the present application. In a preferred embodiment of the present application, the self-moving device 30 includes a memory 31, at least one processor 32, at least one communication bus 33, a transceiver 34, an operating device 21 and a lifting device 22. The lifting device 22 includes a drive motor 222 and a swing arm 221, the drive shaft of the drive motor 222 is used to drive the swing arm 221 to rotate around the drive shaft, the swing arm 221 is used to connect the operating device 21, and the processor 32 is used to implement the height adjustment method when executing the computer program stored in the memory 31.
[0150] Those skilled in the art should understand that Figure 6 The structure of the self-moving device shown does not constitute a limitation of the embodiments of the present application, and can be either a bus structure or a star structure. The self-moving device 30 can also include more or less other hardware or software than shown in the figure, or a different component arrangement.
[0151] In some embodiments, the self-mobile device 30 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The self-mobile device 30 may also include client devices, which include but are not limited to any electronic product that can interact with the client through a keyboard, mouse, remote control, touchpad, or voice-controlled device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0152] It should be noted that the mobile device 30 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0153] In some embodiments, a computer program is stored in the memory 31, and when the computer program is executed by at least one processor 32, all or part of the steps in the height adjustment method are implemented. The memory 31 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0154] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created based on the use of the self-mobile device 30, etc.
[0155] In some embodiments, at least one processor 32 is the control core (ControlUnit) of the self-moving device 30, and uses various interfaces and lines to connect various components of the entire self-moving device 30, and executes various functions and processes data of the self-moving device 30 by running or executing programs or modules stored in the memory 31, and calling data stored in the memory 31. For example, when at least one processor 32 executes the computer program stored in the memory, it implements all or part of the steps of the height adjustment method in the embodiment of the present application; or implements all or part of the functions of the height adjustment device. At least one processor 32 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central processing units (CPU), microprocessors, digital processing chips, graphics processors, and various control chips. Combination, etc.
[0156] In some embodiments, at least one communication bus 33 is configured to implement connection and communication between the memory 31 and at least one processor 32, etc.
[0157] Although not shown, the self-mobile device 30 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to at least one processor 32 through a power management device, so that the power management device can manage charging, discharging, and power consumption. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The self-mobile device 30 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0158] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a self-mobile device (which can be a personal computer, a self-mobile device, or a network device, etc.) or a processor to execute parts of the methods of various embodiments of the present application.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.
[0160] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0162] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A height adjustment method, applied to a self-moving device, characterized in that: The self-moving device comprises a lifting device and an operating device, the lifting device comprises a driving motor and a swing arm, the driving shaft of the driving motor is used to drive the swing arm to rotate around the driving shaft, and the swing arm is used to connect the operating device, and the height adjustment method comprises: Obtaining an initial angle between the swing arm and the vertical direction; Acquire terrain features in the direction in which the mobile device moves; determining a target height of the working device according to the terrain features; Calculating a target angle between the swing arm and the vertical direction according to the target height; Calculating a rotation angle according to the target angle and the initial angle; The swing arm is driven to rotate by the rotation angle through the drive shaft to adjust the working device to the target height.
2. The method according to claim 1, characterized in that The obtaining of the initial angle between the swing arm and the vertical direction comprises: Obtaining an initial height of the working device, a swing arm length of the swing arm, and a height of the driving shaft from the ground; Calculating the height difference between the height above the ground and the initial height; A preset inverse trigonometric function is called to process the height difference and the length of the swing arm to obtain an initial angle between the swing arm and the vertical direction.
3. The method according to claim 1, characterized in that The calculating the rotation angle according to the target angle and the initial angle comprises: The angle difference between the target angle and the initial angle is calculated to obtain the rotation angle.
4. The method according to claim 1, characterized in that The obtaining of the terrain features in the advancing direction of the self-moving device includes: Acquire an image of the environment in the direction in which the mobile device is moving; Perform image recognition on the environment image to obtain terrain features corresponding to the environment image.
5. The method according to claim 4, characterized in that Determining the target height of the working device according to the terrain features includes: When the terrain features include non-flat features, determining point cloud data corresponding to the non-flat features by clustering; Determine the highest point of the non-flat land feature according to the point cloud data corresponding to the non-flat land feature; Determining an estimated height of the highest point to the plane where the self-mobile device is located; When the estimated height is less than or equal to a preset height threshold, the estimated height is determined to be a target height.
6. The method according to claim 5, characterized in that After determining the estimated height of the highest point to the horizontal plane where the self-moving device is located, the method further includes: When the estimated height is greater than the preset height threshold, the self-moving device is controlled to detour along the non-flat ground feature.
7. The method according to any one of claims 1 to 6, characterized in that: The drive shaft is provided with an encoder; the method further comprises: After the self-mobile device is powered on, obtaining a measured encoder value of the encoder; Obtaining an initial encoder value corresponding to the initial angle; Calculating an encoder difference between the measured encoder value and the initial encoder value; Determine the adjustment angle value according to the encoder difference; Determine the measured angle according to the initial angle and the adjusted angle value; The current height of the working device is determined according to the measured angle.
8. A height adjustment device, applied to a self-moving device, characterized in that: The self-moving device comprises a lifting device and an operating device, the lifting device comprises a driving motor and a swing arm, the driving shaft of the driving motor is used to drive the swing arm to rotate around the driving shaft, the swing arm is used to connect the operating device, and the height adjustment device comprises: An initial angle module, used to obtain an initial angle between the swing arm and the vertical direction; A terrain recognition module, used to obtain terrain features in the direction of movement of the mobile device; A height calculation module, used to determine a target height of the working device according to the terrain features; An angle calculation module, used to calculate the target angle between the swing arm and the vertical direction according to the target height; A rotation angle module, used for calculating the rotation angle according to the target angle and the initial angle; The height adjustment module is used to drive the swing arm to rotate the rotation angle through the drive shaft to adjust the working device to the target height.
9. A self-propelled device, characterized in that: The self-moving device includes a processor, a memory, a lifting device and an operating device. The lifting device includes a drive motor and a swing arm. The drive shaft of the drive motor is used to drive the swing arm to rotate around the drive shaft. The swing arm is used to connect the operating device. The processor is used to execute the computer program stored in the memory to implement the height adjustment method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the height adjustment method according to any one of claims 1 to 7 is implemented.
