Terrain detection method and device, robot and storage medium
By generating an elevation map and sampling point clouds, the terrain is identified as a plane, an upper step, or a lower step, which solves the problem of low accuracy in terrain recognition for robots and improves the accuracy and real-time performance of motion control.
Patent Information
- Application Number
- CN202310289164.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-10-01
AI Technical Summary
When the robot is walking automatically, the accuracy of terrain recognition is low and it is easy to make errors in motion control.
By obtaining the pose information of the robot and the detection image collected by the image acquisition component, an elevation map is generated, and the elevation map is sampled to obtain a sampling point cloud. Based on the coordinate values of multiple three-dimensional coordinate points in the sampling point cloud, the terrain is determined to be a plane , go up or down the steps, and then perform motion control.
It improves the accuracy of terrain recognition, avoids errors in motion control, reduces hardware resource consumption and computing power requirements, and achieves real-time and lightweight terrain detection.
Smart Images

Figure CN118730071A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of robot technology, and in particular to a terrain detection method, device, robot and storage medium. Background Art
[0002] In recent years, the technology of robotics has been developing continuously, becoming more and more intelligent and automated, and the richness, stability and flexibility of actions have been improved to varying degrees. When robots walk automatically, they need to use computer vision navigation technology to identify environmental information and perform motion control based on environmental information. However, in related technologies, the robot's accuracy in identifying the terrain in the environment is low, and it is easy to make mistakes in motion control. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide a terrain detection method, device, robot and storage medium to solve the defects in the related art.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a terrain detection method, which is applied to a robot having an image acquisition element, and the method comprises:
[0005] Acquire the posture information of the robot and the detection image acquired by the image acquisition component, and generate an elevation map according to the posture information and the detection image;
[0006] Sampling the elevation map to obtain a sampling point cloud;
[0007] The terrain of the real area corresponding to the sampling point cloud is determined according to the coordinate values of the plurality of three-dimensional coordinate points in the sampling point cloud, wherein the terrain includes a plane, an upward step or a downward step.
[0008] In one embodiment of the present disclosure, generating an elevation map according to the posture information and the detected image includes:
[0009] Converting the position information from the coordinate system of the robot to the coordinate system of the image acquisition element;
[0010] An elevation map is generated based on the posture information in the coordinate system of the image acquisition element and the detected image.
[0011] In one embodiment of the present disclosure, sampling the elevation map to obtain a sampling point cloud includes:
[0012] Determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element;
[0013] Sampling is performed in the sampling area to obtain the sampling point cloud.
[0014] In one embodiment of the present disclosure, the preset sampling range is characterized by a plurality of sampling rays;
[0015] The step of determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element comprises:
[0016] Determine the intersection point of each sampling ray in the preset sampling range and the elevation map;
[0017] The area formed by connecting multiple intersection points is determined as the sampling area.
[0018] In one embodiment of the present disclosure, determining the intersection of each sampling ray in the preset sampling range and the elevation map includes:
[0019] For each sampling light, determining a sampling point corresponding to the sampling light according to the field angle of the sampling light in the coordinate system of the image acquisition element;
[0020] For each sampling light, according to the posture information of the robot, the sampling point corresponding to the sampling light is converted from the coordinate system of the image acquisition element to the map coordinate system, and the equation of the straight line from the image acquisition element to the sampling point is generated in the map coordinate system;
[0021] The intersection point of each sampling ray in the preset sampling range and the elevation map is determined according to the equation of a straight line from the image acquisition element to the sampling point corresponding to each sampling ray.
[0022] In one embodiment of the present disclosure, determining the intersection of each sampling ray in the preset sampling range and the elevation map according to the straight line equation from the image acquisition element to the sampling point corresponding to each sampling ray includes:
[0023] Generate a plane equation of the ground where the robot is located according to the posture information of the robot and the body size of the robot;
[0024] Determine the intersection of each sampling ray in the preset sampling range and the ground where the robot is located according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling ray and the plane equation of the ground where the robot is located;
[0025] The point on the elevation map corresponding to the intersection of each sampling light ray in the preset sampling range and the ground where the robot is located is determined as the intersection of each sampling light ray in the preset sampling range and the elevation map.
[0026] In one embodiment of the present disclosure, determining the terrain of the real area corresponding to the sampling point cloud according to the coordinate values of the plurality of three-dimensional coordinate points in the sampling point cloud includes:
[0027] Determine the height information of the ground where the robot is located according to the posture information of the robot and the body size of the robot;
[0028] According to the difference between the coordinate value of each three-dimensional coordinate point in the height direction of the sampling point cloud and the height information of the ground where the robot is located, the category of each three-dimensional coordinate point is correspondingly determined, wherein the categories include plane points, upper step points and lower step points;
[0029] The terrain of the real area corresponding to the sampling point cloud is determined according to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category and the number of three-dimensional coordinate points of the lower step point category.
[0030] In one embodiment of the present disclosure, determining the terrain of the real area corresponding to the sampled point cloud according to the number of three-dimensional points classified as plane points, the number of three-dimensional points classified as upper step points, and the number of three-dimensional points classified as lower step points includes:
[0031] According to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category, and the number of three-dimensional coordinate points of the lower step point category, respectively determine the proportion of the three-dimensional coordinate points of the plane point category, the three-dimensional coordinate points of the upper step point category, and the three-dimensional coordinate points of the lower step point category in all the three-dimensional coordinate points;
[0032] In response to the fact that the proportion of the three-dimensional coordinate points of the category of upper step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of lower step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is an upper step;
[0033] In response to the fact that the proportion of the three-dimensional coordinate points of the category of down-step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of up-step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is a down-step;
[0034] In response to the fact that the proportion of three-dimensional coordinate points classified as upper step points among all three-dimensional points is less than the first proportion threshold, and the proportion of three-dimensional coordinate points classified as lower step points among all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a plane.
[0035] In one embodiment of the present disclosure, the category of the three-dimensional coordinate points also includes invalid points;
[0036] The determining of the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category, and the number of three-dimensional points of the lower step point category includes:
[0037] When the proportion of three-dimensional coordinate points classified as invalid points in all three-dimensional coordinate points is not greater than a second proportion threshold, the terrain of the real area corresponding to the sampling point cloud is determined based on the number of three-dimensional points classified as plane points, the number of three-dimensional points classified as upper step points, and the number of three-dimensional points classified as lower step points.
[0038] In one embodiment of the present disclosure, it also includes:
[0039] According to the terrain of the real area corresponding to the sampling point cloud, the robot is controlled to move in the real area corresponding to the sampling point cloud.
[0040] In one embodiment of the present disclosure, controlling the robot to move in the real area corresponding to the sampling point cloud according to the terrain of the real area corresponding to the sampling point cloud includes:
[0041] When the terrain of the real area corresponding to the sampling point cloud is an upward step or a downward step, plane detection is performed on multiple three-dimensional coordinate points in the sampling point cloud, and the robot is controlled to move according to the plane detection result.
[0042] According to a second aspect of an embodiment of the present disclosure, there is provided a terrain detection device, which is applied to a robot having an image acquisition element, and the device comprises:
[0043] A mapping module, used to obtain the posture information of the robot and the detection image collected by the image acquisition element, and generate an elevation map according to the posture information and the detection image;
[0044] A sampling module, used for sampling the elevation map to obtain a sampling point cloud;
[0045] The detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the coordinate values of multiple three-dimensional coordinate points in the sampling point cloud, wherein the terrain includes a plane, an upward step or a downward step.
[0046] In one embodiment of the present disclosure, the composition module is specifically used for:
[0047] Converting the position information from the coordinate system of the robot to the coordinate system of the image acquisition element;
[0048] An elevation map is generated based on the posture information in the coordinate system of the image acquisition element and the detected image.
[0049] In one embodiment of the present disclosure, the sampling module is specifically used to:
[0050] Determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element;
[0051] Sampling is performed in the sampling area to obtain the sampling point cloud.
[0052] In one embodiment of the present disclosure, the preset sampling range is characterized by a plurality of sampling rays;
[0053] The sampling module is used to determine the sampling area on the elevation map according to the preset sampling range within the field of view of the image acquisition element, specifically to:
[0054] Determine the intersection point of each sampling ray in the preset sampling range and the elevation map;
[0055] The area formed by connecting multiple intersection points is determined as the sampling area.
[0056] In one embodiment of the present disclosure, when the sampling module is used to determine the intersection point of each sampling ray in the preset sampling range and the elevation map, it is specifically used to:
[0057] For each sampling light, determining a sampling point corresponding to the sampling light according to the field angle of the sampling light in the coordinate system of the image acquisition element;
[0058] For each sampling light, according to the posture information of the robot, the sampling point corresponding to the sampling light is converted from the coordinate system of the image acquisition element to the map coordinate system, and the equation of the straight line from the image acquisition element to the sampling point is generated in the map coordinate system;
[0059] The intersection point of each sampling ray in the preset sampling range and the elevation map is determined according to the equation of a straight line from the image acquisition element to the sampling point corresponding to each sampling ray.
[0060] In one embodiment of the present disclosure, the sampling module is used to determine the intersection of each sampling ray in the preset sampling range and the elevation map according to the straight line equation from the image acquisition element to the sampling point corresponding to each sampling ray, specifically for:
[0061] Generate a plane equation of the ground where the robot is located according to the posture information of the robot and the body size of the robot;
[0062] Determine the intersection of each sampling ray in the preset sampling range and the ground where the robot is located according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling ray and the plane equation of the ground where the robot is located;
[0063] The point on the elevation map corresponding to the intersection of each sampling light ray in the preset sampling range and the ground where the robot is located is determined as the intersection of each sampling light ray in the preset sampling range and the elevation map.
[0064] In one embodiment of the present disclosure, the detection module is specifically used to:
[0065] Determine the height information of the ground where the robot is located according to the posture information of the robot and the body size of the robot;
[0066] According to the difference between the coordinate value of each three-dimensional coordinate point in the height direction of the sampling point cloud and the height information of the ground where the robot is located, the category of each three-dimensional coordinate point is correspondingly determined, wherein the categories include plane points, upper step points and lower step points;
[0067] The terrain of the real area corresponding to the sampling point cloud is determined according to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category and the number of three-dimensional coordinate points of the lower step point category.
[0068] In one embodiment of the present disclosure, the detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category, and the number of three-dimensional points of the lower step point category, and is specifically used to:
[0069] According to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category, and the number of three-dimensional coordinate points of the lower step point category, respectively determine the proportion of the three-dimensional coordinate points of the plane point category, the three-dimensional coordinate points of the upper step point category, and the three-dimensional coordinate points of the lower step point category in all the three-dimensional coordinate points;
[0070] In response to the fact that the proportion of the three-dimensional coordinate points of the category of upper step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of lower step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is an upper step;
[0071] In response to the fact that the proportion of the three-dimensional coordinate points of the category of down-step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of up-step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is a down-step;
[0072] In response to the fact that the proportion of three-dimensional coordinate points classified as upper step points among all three-dimensional points is less than the first proportion threshold, and the proportion of three-dimensional coordinate points classified as lower step points among all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a plane.
[0073] In one embodiment of the present disclosure, the category of the three-dimensional coordinate points also includes invalid points;
[0074] The detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category and the number of three-dimensional points of the lower step point category, specifically for:
[0075] When the proportion of three-dimensional coordinate points classified as invalid points in all three-dimensional coordinate points is not greater than a second proportion threshold, the terrain of the real area corresponding to the sampling point cloud is determined based on the number of three-dimensional points classified as plane points, the number of three-dimensional points classified as upper step points, and the number of three-dimensional points classified as lower step points.
[0076] In one embodiment of the present disclosure, a motion module is further included, which is used to:
[0077] According to the terrain of the real area corresponding to the sampling point cloud, the robot is controlled to move in the real area corresponding to the sampling point cloud.
[0078] In one embodiment of the present disclosure, the motion module is specifically used for:
[0079] When the terrain of the real area corresponding to the sampling point cloud is an upward step or a downward step, plane detection is performed on multiple three-dimensional coordinate points in the sampling point cloud, and the robot is controlled to move according to the plane detection result.
[0080] According to a third aspect of an embodiment of the present disclosure, a robot is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the terrain detection method described in the first aspect when executing the computer instructions.
[0081] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described in the first aspect is implemented.
[0082] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0083] The terrain detection method provided by the embodiment of the present disclosure can generate an elevation map based on the posture information and the detection image by acquiring the posture information of the robot and the detection image acquired by the image acquisition element; then the elevation map can be sampled to obtain a sampling point cloud, and the terrain of the real area corresponding to the sampling point cloud can be determined based on the coordinate values of multiple three-dimensional coordinate points in the sampling point cloud. Since this method performs map detection by sampling the constructed elevation map, it can accurately distinguish whether the terrain is a plane, an upward step or a downward step, thereby providing a basis for the robot's motion control, so that the robot can make corresponding actions when the terrain changes (for example, when going up or down stairs) to avoid mistakes in motion control; and this method does not run a more complex detection algorithm in real time, so it can improve real-time performance, avoid waste of computing power and resource consumption, and reduce hardware requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0085] Figure 1 is a flow chart of a terrain detection method shown in an exemplary embodiment of the present disclosure;
[0086] Figure 2 is a flow chart of a method for sampling an elevation map shown in an exemplary embodiment of the present disclosure;
[0087] Figure 3 is a flow chart showing a method of determining the terrain of a real area corresponding to a sampling point cloud according to an exemplary embodiment of the present disclosure;
[0088] Figure 4 is a structural schematic diagram of a terrain detection device shown in an exemplary embodiment of the present disclosure;
[0089] Figure 5 It is a structural block diagram of a robot shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0090] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0091] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0092] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0093] In recent years, the technology of robotics has been developing continuously, becoming more and more intelligent and automated, and the richness, stability and flexibility of actions have been improved to varying degrees. When robots walk automatically, they need to use computer vision navigation technology to identify environmental information and perform motion control based on environmental information. However, in related technologies, the robot's accuracy in identifying the terrain in the environment is low, and it is easy to make mistakes in motion control.
[0094] Based on this, in the first aspect, at least one embodiment of the present disclosure provides a terrain detection method, please refer to the attached Figure 1 , which shows the process of the method, including steps S101 to S103.
[0095] The method can be applied to a robot, for example, a legged robot; the legged robot has multiple legs and can walk by alternating steps of the multiple legs. The robot can have an image acquisition element, such as a depth camera; the image acquisition element can acquire images for its field of view, for example, the depth camera can acquire depth images for its field of view. The robot can also have an odometer, such as a foot-type odometer integrated with an IMU (Inertial measurement unit), which can obtain the robot's position information.
[0096] In step S101, the position and posture information of the robot and the detection image acquired by the image acquisition component are acquired, and an elevation map is generated according to the position and posture information and the detection image.
[0097] Optionally, a foot odometer integrated with an IMU is used to obtain the robot's position and posture information.
[0098] Among them, the elevation map can be a map that can reflect the height information of the ground, for example, the elevation map can include multiple three-dimensional coordinate points in the map area; the elevation map in this step can be a map of the real area within the field of view of the image acquisition element, that is, a local map.
[0099] In one possible embodiment, the elevation map may be generated in the following manner:
[0100] First, the position information is converted from the coordinate system of the robot to the coordinate system of the image acquisition element. For example, the position information T of the robot b It can include the displacement t and the rotation quaternion q, that is, T b :{t=(x t ,y t , z t ) T ; q=(w q , x q ,y q , z q )}, and then the external reference θ that represents the conversion relationship between the robot's coordinate system (i.e., the world coordinate system with the robot's initial position as the origin) and the image acquisition element's coordinate system (e.g., the camera coordinate system) can be used. The position information T in the robot's coordinate system b Transformed into the position information T in the coordinate system of the image acquisition element c :
[0101] Next, an elevation map is generated based on the position information in the coordinate system of the image acquisition component and the detection image, for example, using an algorithm such as elevation_map.
[0102] In step S102, the elevation map is sampled to obtain a sampling point cloud.
[0103] In this step, the whole or part of the elevation map can be sampled to obtain a sampled point cloud. It is understandable that the three-dimensional coordinate points in the elevation map can be sampled according to a specific area and a specific interval, and the three-dimensional coordinate points obtained by sampling constitute a point cloud, i.e., a sampled point cloud. Among them, the specific area can be a specific area within the field of view of the image acquisition element, i.e., the specific area moves with the movement of the robot, or in other words, this step always samples the special area in a specific direction of the robot.
[0104] In a possible embodiment, the following Figure 2 The elevation map is sampled in the manner shown to obtain a sampling point cloud, including sub-steps S1021 and S1022.
[0105] In sub-step S1021, a sampling area is determined on the elevation map according to a preset sampling range within the field of view of the image acquisition element.
[0106] The preset sampling range can be represented by multiple sampling rays, each sampling ray is defined by a field of view angle (i.e., the angle of the light emitted by the optical center of the image acquisition element), and the field of view angle can include two dimensions: a horizontal field of view angle and a vertical field of view angle. Based on this, in this sub-step, the intersection of each sampling ray in the preset sampling range and the elevation map can be determined, and the area formed by connecting multiple intersections (in sequence) is determined as the sampling area, such as a triangular sampling area formed by connecting three intersections, a quadrilateral sampling area formed by connecting four intersections, etc.
[0107] First, for each sampling light, the sampling point corresponding to the sampling light is determined in the coordinate system of the image acquisition element according to the field of view of the sampling light. Exemplarily, the sampling point P corresponding to the sampling light in the coordinate system of the image acquisition element is calculated according to the following formula: c :
[0108] X p = cos(v rad )s in(h rad )
[0109] Y p =s in(v rad )
[0110] Z p = cos(v rad )cos(h rad )
[0111] P c =(X p ,Y p ,Z p )
[0112] In the formula, h rad is the horizontal field angle of the sampling light, v rad is the vertical field angle of the sampling light.
[0113] Next, for each sampling light, according to the posture information of the robot, the sampling point corresponding to the sampling light is converted from the coordinate system of the image acquisition element to the map coordinate system, and the equation of the straight line from the image acquisition element to the sampling point is generated in the map coordinate system. Exemplarily, the sampling point corresponding to the sampling light in the map coordinate system is calculated according to the following formula:
[0114]
[0115] Where P m is the sampling point corresponding to the sampling light in the map coordinate system, P c is the sampling point corresponding to the sampling light in the coordinate system of the image acquisition element (for example, the camera coordinate system), It is the pose information in the coordinate system of the image acquisition component.
[0116] The equation L of the straight line from the (optical center of) the image acquisition element to the sampling point in the map coordinate system is calculated according to the following formula:
[0117]
[0118] Finally, according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling light, the intersection point of each sampling light in the preset sampling range and the elevation map is determined.
[0119] First, according to the posture information of the robot and the body size of the robot, generate the plane equation of the ground where the robot is located; for example, the plane equation is π = (a, b, c, d) T .
[0120] Second, according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling light and the plane equation of the ground where the robot is located, the intersection point of each sampling light in the preset sampling range and the ground where the robot is located is determined. For example, the intersection point of the sampling light and the ground where the robot is located is X=Lπ.
[0121] Third, the point on the elevation map corresponding to the intersection of each sampling ray in the preset sampling range and the ground where the robot is located is determined as the intersection of each sampling ray in the preset sampling range and the elevation map. For example, the intersection of the sampling ray and the ground where the robot is located is projected onto the elevation map, and the projection point is determined as the intersection of the sampling ray and the elevation map.
[0122] In sub-step S1022, sampling is performed in the sampling area to obtain the sampling point cloud.
[0123] Exemplarily, a grid of multiple rows and columns is formed in the sampling area at preset intervals, and the three-dimensional coordinate point of each grid point in the grid is obtained to complete the sampling.
[0124] In step S103, the terrain of the real area corresponding to the sampling point cloud is determined according to the coordinate values of the multiple three-dimensional coordinate points in the sampling point cloud, wherein the terrain includes a plane, an upward step or a downward step.
[0125] In a possible embodiment, the following Figure 3The method shown in the figure determines the terrain of the real area corresponding to the sampling point cloud, including sub-steps S1031 to S1033.
[0126] In sub-step S1031, the height information of the ground where the robot is located is determined according to the posture information of the robot and the body size of the robot.
[0127] In sub-step S1032, the category of each three-dimensional coordinate point is determined according to the difference between the coordinate value of each three-dimensional coordinate point in the sampling point cloud in the height direction and the height information of the ground where the robot is located, wherein the categories include plane points, upper step points and lower step points.
[0128] Exemplarily, the height interval of the steps can be set in advance; if the coordinate value of a certain three-dimensional key point in the height direction is greater than the height information of the ground where the robot is located, and the difference between the two belongs to the height interval of the above steps, then the category of the three-dimensional coordinate point is determined to be an upper step point; if the coordinate value of a certain three-dimensional key point in the height direction is less than the height information of the ground where the robot is located, and the difference between the two belongs to the height interval of the above steps, then the category of the three-dimensional coordinate point is determined to be a lower step point; if the difference between the coordinate value of a certain three-dimensional key point in the height direction and the height information of the ground where the robot is located is not greater than the variance of the elevation map, then the category of the three-dimensional coordinate point is determined to be a plane point.
[0129] In addition, the category of the three-dimensional coordinate point may also include an invalid point; if when judging the category of a certain three-dimensional coordinate point in the above manner, the three-dimensional coordinate point is neither an upper step point, a lower step point, nor a plane point, then it can be determined that the three-dimensional coordinate point is an invalid point.
[0130] In sub-step S1033, the terrain of the real area corresponding to the sampling point cloud is determined according to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category and the number of three-dimensional coordinate points of the lower step point category.
[0131] It is understandable that if the category of the three-dimensional coordinate points includes invalid points, this sub-step can determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the category of plane points, the number of three-dimensional points of the category of upper step points, and the number of three-dimensional points of the category of lower step points, when the proportion of three-dimensional coordinate points of the category of invalid points in all three-dimensional coordinate points is not greater than the second proportion threshold value (for example, 0.5). When the proportion of three-dimensional coordinate points of the category of invalid points in all three-dimensional coordinate points is greater than the second proportion threshold value (for example, 0.5), it is determined that the terrain of the real area corresponding to the sampling point cloud cannot be determined, that is, the terrain corresponding to the next frame of detection image is continued to be determined.
[0132] For example, the terrain of the real area corresponding to the sampling point cloud is determined in the following manner:
[0133] First, according to the number of three-dimensional coordinate points of the category of plane points, the number of three-dimensional coordinate points of the category of upper step points and the number of three-dimensional coordinate points of the category of lower step points, the proportions of three-dimensional coordinate points of the category of plane points, the category of upper step points and the category of lower step points in all three-dimensional coordinate points are determined respectively; wherein all three-dimensional coordinate points refer to all three-dimensional coordinate points after removing invalid points, that is, all three-dimensional coordinate points include three-dimensional coordinate points of the category of plane points, the category of upper step points and the category of lower step points. If the number of three-dimensional coordinate points of the category of plane points is A, the number of three-dimensional coordinate points of the category of upper step points is B, and the number of three-dimensional coordinate points of the category of lower step points is C, then the proportion of three-dimensional coordinate points of the category of plane points in all three-dimensional coordinate points is A / (A+B+C), the proportion of three-dimensional coordinate points of the category of upper step points in all three-dimensional coordinate points is B / (A+B+C), and the proportion of three-dimensional coordinate points of the category of lower step points in all three-dimensional coordinate points is C / (A+B+C). When the proportion of three-dimensional coordinate points classified as invalid points in all three-dimensional coordinate points is greater than a second proportion threshold (for example, 0.5), it is impossible to determine the terrain of the real area corresponding to the sampling point cloud, that is, continue to determine the terrain corresponding to the next frame of detection image.
[0134] Next, in response to the fact that the proportion of three-dimensional coordinate points of the category of upper step points in all three-dimensional points is not less than the first proportion threshold (for example, 0.25), and the proportion of three-dimensional coordinate points of the category of lower step points in all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is an upper step; in response to the fact that the proportion of three-dimensional coordinate points of the category of lower step points in all three-dimensional points is not less than the first proportion threshold, and the proportion of three-dimensional coordinate points of the category of upper step points in all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a lower step; in response to the fact that the proportion of three-dimensional coordinate points of the category of upper step points in all three-dimensional points is less than the first proportion threshold, and the proportion of three-dimensional coordinate points of the category of lower step points in all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a plane.
[0135] If the terrain of the real area corresponding to the sampling point cloud is determined in the above manner, and the terrain is neither a plane nor an upward or downward step, then the terrain of the real area corresponding to the sampling point cloud cannot be determined, that is, the terrain corresponding to the next frame of detection image must be determined.
[0136] It is understandable that after determining the topography of the real area corresponding to the sampling point cloud, the robot can also be controlled to move in the real area corresponding to the sampling point cloud according to the topography of the real area corresponding to the sampling point cloud.
[0137] When the terrain of the real area corresponding to the sampling point cloud is a plane, the robot can be controlled to continue walking along the planned route.
[0138] In the case where the terrain of the real area corresponding to the sampling point cloud is an upward step or a downward step, a plane detection can be performed on multiple three-dimensional coordinate points in the sampling point cloud, and the robot can be controlled to move according to the plane detection result. For example, a RANSAC algorithm is used to perform plane detection on multiple three-dimensional coordinate points in the sampling point cloud to determine whether the real area corresponding to the sampling point cloud meets the robot's jumping condition (i.e., whether the robot can jump). If the real area corresponding to the sampling point cloud meets the robot's jumping condition, the robot is controlled to perform a step jumping action. If the real area corresponding to the sampling point cloud does not meet the robot's jumping condition, the robot is controlled to bypass obstacles.
[0139] In one possible scenario, there is a downhill scene in front of the robot. The robot can use this method to determine the terrain in front as a downstairs scene, and then further use the RANSAC algorithm to perform plane detection on the terrain in front. When it is determined that the robot can pass through the downhill scene, the robot is controlled to move through the downhill scene in front. In another possible scenario, there is an irregular obstacle in front of the robot. The robot can use this method to determine the terrain in front as a mountain step scene, and then further use the RANSAC algorithm to perform plane detection on the terrain in front. When it is determined that the obstacle does not meet the robot's jumping conditions (that is, the robot cannot jump over the obstacle), the robot can be controlled to bypass the obstacle.
[0140] That is to say, the robot does not run plane detection algorithms such as the RANSAC algorithm in real time during the movement. Instead, it only uses the plane detection algorithm to determine whether the robot can pass when it detects that the terrain is an upstep or a downstep using this method. Since the terrain detection method is simple to run, with low computing power requirements and resource consumption, while the plane detection algorithm is complex to run, with high computing power requirements and resource consumption, the terrain detection method can be used as a coarse detection, and the plane detection algorithm can be used as a fine detection. When complex terrain appears in the coarse detection results, fine detection is used for detailed judgment, thereby achieving both lightweight and real-time terrain detection, and accurate and stable terrain detection and robot control.
[0141] The terrain detection method provided by the embodiment of the present disclosure can generate an elevation map based on the posture information and the detection image by acquiring the posture information of the robot and the detection image acquired by the image acquisition element; then the elevation map can be sampled to obtain a sampling point cloud, and the terrain of the real area corresponding to the sampling point cloud can be determined based on the coordinate values of multiple three-dimensional coordinate points in the sampling point cloud. Since this method performs map detection by sampling the constructed elevation map, it can accurately distinguish whether the terrain is a plane, an upward step or a downward step, thereby providing a basis for the robot's motion control, so that the robot can make corresponding actions when the terrain changes (for example, when going up or down stairs) to avoid mistakes in motion control; and this method does not run a more complex detection algorithm in real time, so it can improve real-time performance, avoid waste of computing power and resource consumption, and reduce hardware requirements.
[0142] In the test, the method was able to achieve a high terrain detection accuracy in different test scenarios such as indoors and outdoors, in different lighting conditions such as strong light and dim light, and in different step types and heights.
[0143] According to a second aspect of the present disclosure, a terrain detection device is provided, which is applied to a robot having an image acquisition element. Figure 4 , the device comprises:
[0144] A mapping module 401 is used to obtain the posture information of the robot and the detection image collected by the image acquisition component, and generate an elevation map according to the posture information and the detection image;
[0145] A sampling module 402 is used to sample the elevation map to obtain a sampling point cloud;
[0146] The detection module 403 is used to determine the terrain of the real area corresponding to the sampling point cloud according to the coordinate values of multiple three-dimensional coordinate points in the sampling point cloud, wherein the terrain includes a plane, an upward step or a downward step.
[0147] In one embodiment of the present disclosure, the composition module is specifically used for:
[0148] Converting the position information from the coordinate system of the robot to the coordinate system of the image acquisition element;
[0149] An elevation map is generated based on the posture information in the coordinate system of the image acquisition element and the detected image.
[0150] In one embodiment of the present disclosure, the sampling module is specifically used to:
[0151] Determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element;
[0152] Sampling is performed in the sampling area to obtain the sampling point cloud.
[0153] In one embodiment of the present disclosure, the preset sampling range is characterized by a plurality of sampling rays;
[0154] The sampling module is used to determine the sampling area on the elevation map according to the preset sampling range within the field of view of the image acquisition element, specifically to:
[0155] Determine the intersection point of each sampling ray in the preset sampling range and the elevation map;
[0156] The area formed by connecting multiple intersection points is determined as the sampling area.
[0157] In one embodiment of the present disclosure, when the sampling module is used to determine the intersection point of each sampling ray in the preset sampling range and the elevation map, it is specifically used to:
[0158] For each sampling light, determining a sampling point corresponding to the sampling light according to the field angle of the sampling light in the coordinate system of the image acquisition element;
[0159] For each sampling light, according to the posture information of the robot, the sampling point corresponding to the sampling light is converted from the coordinate system of the image acquisition element to the map coordinate system, and the equation of the straight line from the image acquisition element to the sampling point is generated in the map coordinate system;
[0160] The intersection point of each sampling ray in the preset sampling range and the elevation map is determined according to the equation of a straight line from the image acquisition element to the sampling point corresponding to each sampling ray.
[0161] In one embodiment of the present disclosure, the sampling module is used to determine the intersection of each sampling ray in the preset sampling range and the elevation map according to the straight line equation from the image acquisition element to the sampling point corresponding to each sampling ray, specifically for:
[0162] Generate a plane equation of the ground where the robot is located according to the posture information of the robot and the body size of the robot;
[0163] Determine the intersection of each sampling ray in the preset sampling range and the ground where the robot is located according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling ray and the plane equation of the ground where the robot is located;
[0164] The point on the elevation map corresponding to the intersection of each sampling light ray in the preset sampling range and the ground where the robot is located is determined as the intersection of each sampling light ray in the preset sampling range and the elevation map.
[0165] In one embodiment of the present disclosure, the detection module is specifically used to:
[0166] Determine the height information of the ground where the robot is located according to the posture information of the robot and the body size of the robot;
[0167] According to the difference between the coordinate value of each three-dimensional coordinate point in the height direction of the sampling point cloud and the height information of the ground where the robot is located, the category of each three-dimensional coordinate point is correspondingly determined, wherein the categories include plane points, upper step points and lower step points;
[0168] The terrain of the real area corresponding to the sampling point cloud is determined according to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category and the number of three-dimensional coordinate points of the lower step point category.
[0169] In one embodiment of the present disclosure, the detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category, and the number of three-dimensional points of the lower step point category, and is specifically used to:
[0170] According to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category, and the number of three-dimensional coordinate points of the lower step point category, respectively determine the proportion of the three-dimensional coordinate points of the plane point category, the three-dimensional coordinate points of the upper step point category, and the three-dimensional coordinate points of the lower step point category in all the three-dimensional coordinate points;
[0171] In response to the fact that the proportion of the three-dimensional coordinate points of the category of upper step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of lower step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is an upper step;
[0172] In response to the fact that the proportion of the three-dimensional coordinate points of the category of down-step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of up-step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is a down-step;
[0173] In response to the fact that the proportion of three-dimensional coordinate points classified as upper step points among all three-dimensional points is less than the first proportion threshold, and the proportion of three-dimensional coordinate points classified as lower step points among all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a plane.
[0174] In one embodiment of the present disclosure, the category of the three-dimensional coordinate points also includes invalid points;
[0175] The detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category and the number of three-dimensional points of the lower step point category, specifically for:
[0176] When the proportion of three-dimensional coordinate points classified as invalid points in all three-dimensional coordinate points is not greater than a second proportion threshold, the terrain of the real area corresponding to the sampling point cloud is determined based on the number of three-dimensional points classified as plane points, the number of three-dimensional points classified as upper step points, and the number of three-dimensional points classified as lower step points.
[0177] In one embodiment of the present disclosure, a motion module is further included, which is used to:
[0178] According to the terrain of the real area corresponding to the sampling point cloud, the robot is controlled to move in the real area corresponding to the sampling point cloud.
[0179] In one embodiment of the present disclosure, the motion module is specifically used for:
[0180] When the terrain of the real area corresponding to the sampling point cloud is an upward step or a downward step, plane detection is performed on multiple three-dimensional coordinate points in the sampling point cloud, and the robot is controlled to move according to the plane detection result.
[0181] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the first aspect related to the method, and will not be elaborated here.
[0182] In a third aspect, at least one embodiment of the present disclosure provides a robot, please refer to the attached Figure 5 , which shows the structure of the robot, the robot includes a memory and a processor, the memory is used to store computer instructions that can be executed on the processor, and the processor is used to detect the terrain based on the method described in any one of the first aspects when executing the computer instructions.
[0183] In a fourth aspect, at least one embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements any of the methods described in the first aspect.
[0184] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0185] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A terrain detection method, characterized in that: Applied to a robot having an image acquisition element, the method comprises: Acquire the posture information of the robot and the detection image acquired by the image acquisition component, and generate an elevation map according to the posture information and the detection image; Sampling the elevation map to obtain a sampling point cloud; The terrain of the real area corresponding to the sampling point cloud is determined according to the coordinate values of the plurality of three-dimensional coordinate points in the sampling point cloud, wherein the terrain includes a plane, an upward step or a downward step.
2. The terrain detection method according to claim 1, characterized in that: The step of generating an elevation map according to the posture information and the detected image comprises: Converting the position information from the coordinate system of the robot to the coordinate system of the image acquisition element; An elevation map is generated based on the posture information in the coordinate system of the image acquisition element and the detected image.
3. The terrain detection method according to claim 1, characterized in that: The step of sampling the elevation map to obtain a sampling point cloud includes: Determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element; Sampling is performed in the sampling area to obtain the sampling point cloud.
4. The terrain detection method according to claim 3, characterized in that: The preset sampling range is represented by a plurality of sampling rays; The step of determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element comprises: Determine the intersection point of each sampling ray in the preset sampling range and the elevation map; The area formed by connecting multiple intersection points is determined as the sampling area.
5. The terrain detection method according to claim 4, characterized in that: Determining the intersection point of each sampling ray in the preset sampling range with the elevation map includes: For each sampling light, determining a sampling point corresponding to the sampling light according to the field angle of the sampling light in the coordinate system of the image acquisition element; For each sampling light, according to the posture information of the robot, the sampling point corresponding to the sampling light is converted from the coordinate system of the image acquisition element to the map coordinate system, and the equation of the straight line from the image acquisition element to the sampling point is generated in the map coordinate system; The intersection point of each sampling ray in the preset sampling range and the elevation map is determined according to the equation of a straight line from the image acquisition element to the sampling point corresponding to each sampling ray.
6. The terrain detection method according to claim 5, characterized in that: The step of determining the intersection of each sampling ray in the preset sampling range and the elevation map according to the equation of a straight line from the image acquisition element to the sampling point corresponding to each sampling ray comprises: Generate a plane equation of the ground where the robot is located according to the posture information of the robot and the body size of the robot; Determine the intersection of each sampling ray in the preset sampling range and the ground where the robot is located according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling ray and the plane equation of the ground where the robot is located; The point on the elevation map corresponding to the intersection of each sampling light in the preset sampling range and the ground where the robot is located is determined as the intersection of each sampling light in the preset sampling range and the elevation map.
7. The terrain detection method according to claim 1, characterized in that: The determining, according to the coordinate values of the plurality of three-dimensional coordinate points in the sampling point cloud, the terrain of the real area corresponding to the sampling point cloud comprises: Determine the height information of the ground where the robot is located according to the posture information of the robot and the body size of the robot; According to the difference between the coordinate value of each three-dimensional coordinate point in the height direction of the sampling point cloud and the height information of the ground where the robot is located, the category of each three-dimensional coordinate point is correspondingly determined, wherein the categories include plane points, upper step points and lower step points; The terrain of the real area corresponding to the sampling point cloud is determined according to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category and the number of three-dimensional coordinate points of the lower step point category.
8. The terrain detection method according to claim 7, characterized in that: The determining of the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category, and the number of three-dimensional points of the lower step point category includes: According to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category, and the number of three-dimensional coordinate points of the lower step point category, respectively determine the proportion of the three-dimensional coordinate points of the plane point category, the three-dimensional coordinate points of the upper step point category, and the three-dimensional coordinate points of the lower step point category in all the three-dimensional coordinate points; In response to the fact that the proportion of the three-dimensional coordinate points of the category of upper step points in all the three-dimensional points is not less than a first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of lower step points in all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is an upper step; In response to the fact that the proportion of the three-dimensional coordinate points of the category of down-step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of up-step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is a down-step; In response to the fact that the proportion of three-dimensional coordinate points classified as upper step points among all three-dimensional points is less than the first proportion threshold, and the proportion of three-dimensional coordinate points classified as lower step points among all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a plane.
9. The terrain detection method according to claim 7, characterized in that: The categories of the three-dimensional coordinate points also include invalid points; The determining of the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category, and the number of three-dimensional points of the lower step point category includes: When the proportion of three-dimensional coordinate points classified as invalid points in all three-dimensional coordinate points is not greater than a second proportion threshold, the terrain of the real area corresponding to the sampling point cloud is determined based on the number of three-dimensional points classified as plane points, the number of three-dimensional points classified as upper step points, and the number of three-dimensional points classified as lower step points.
10. The terrain detection method according to claim 1, characterized in that: Also includes: According to the terrain of the real area corresponding to the sampling point cloud, the robot is controlled to move in the real area corresponding to the sampling point cloud.
11. The terrain detection method according to claim 10, characterized in that: The controlling the robot to move in the real area corresponding to the sampling point cloud according to the terrain of the real area corresponding to the sampling point cloud comprises: When the terrain of the real area corresponding to the sampling point cloud is an upward step or a downward step, plane detection is performed on multiple three-dimensional coordinate points in the sampling point cloud, and the robot is controlled to move according to the plane detection result.
12. A terrain detection device, characterized in that: Applied to a robot having an image acquisition element, the device comprises: A mapping module, used to obtain the posture information of the robot and the detection image collected by the image acquisition element, and generate an elevation map according to the posture information and the detection image; A sampling module, used for sampling the elevation map to obtain a sampling point cloud; The detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the coordinate values of multiple three-dimensional coordinate points in the sampling point cloud, wherein the terrain includes a plane, an upward step or a downward step.
13. The terrain detection device according to claim 12, characterized in that: The composition module is specifically used for: Converting the position information from the coordinate system of the robot to the coordinate system of the image acquisition element; An elevation map is generated based on the posture information in the coordinate system of the image acquisition element and the detected image.
14. The terrain detection device according to claim 12, characterized in that: The sampling module is specifically used for: Determining a sampling area on the elevation map according to a preset sampling range within the field of view of the image acquisition element; Sampling is performed in the sampling area to obtain the sampling point cloud.
15. The terrain detection device according to claim 14, characterized in that: The preset sampling range is represented by a plurality of sampling rays; The sampling module is used to determine the sampling area on the elevation map according to the preset sampling range within the field of view of the image acquisition element, specifically to: Determine the intersection point of each sampling ray in the preset sampling range and the elevation map; The area formed by connecting multiple intersection points is determined as the sampling area.
16. The terrain detection device according to claim 15, characterized in that: When the sampling module is used to determine the intersection point of each sampling ray in the preset sampling range and the elevation map, it is specifically used to: For each sampling light, determining a sampling point corresponding to the sampling light according to the field angle of the sampling light in the coordinate system of the image acquisition element; For each sampling light, according to the posture information of the robot, the sampling point corresponding to the sampling light is converted from the coordinate system of the image acquisition element to the map coordinate system, and the equation of the straight line from the image acquisition element to the sampling point is generated in the map coordinate system; The intersection point of each sampling ray in the preset sampling range and the elevation map is determined according to the equation of a straight line from the image acquisition element to the sampling point corresponding to each sampling ray.
17. The terrain detection device according to claim 16, characterized in that: The sampling module is used to determine the intersection of each sampling ray in the preset sampling range and the elevation map according to the straight line equation from the image acquisition element to the sampling point corresponding to each sampling ray, specifically for: Generate a plane equation of the ground where the robot is located according to the posture information of the robot and the body size of the robot; Determine the intersection of each sampling ray in the preset sampling range and the ground where the robot is located according to the equation of the straight line from the image acquisition element to the sampling point corresponding to each sampling ray and the plane equation of the ground where the robot is located; The point on the elevation map corresponding to the intersection of each sampling light in the preset sampling range and the ground where the robot is located is determined as the intersection of each sampling light in the preset sampling range and the elevation map.
18. The terrain detection device according to claim 12, characterized in that: The detection module is specifically used for: Determine the height information of the ground where the robot is located according to the posture information of the robot and the body size of the robot; According to the difference between the coordinate value of each three-dimensional coordinate point in the height direction of the sampling point cloud and the height information of the ground where the robot is located, the category of each three-dimensional coordinate point is correspondingly determined, wherein the categories include plane points, upper step points and lower step points; The terrain of the real area corresponding to the sampling point cloud is determined according to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category and the number of three-dimensional coordinate points of the lower step point category.
19. The terrain detection device according to claim 18, characterized in that: The detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category and the number of three-dimensional points of the lower step point category, specifically for: According to the number of three-dimensional coordinate points of the plane point category, the number of three-dimensional coordinate points of the upper step point category, and the number of three-dimensional coordinate points of the lower step point category, respectively determine the proportion of the three-dimensional coordinate points of the plane point category, the three-dimensional coordinate points of the upper step point category, and the three-dimensional coordinate points of the lower step point category in all the three-dimensional coordinate points; In response to the fact that the proportion of the three-dimensional coordinate points of the category of upper step points in all the three-dimensional points is not less than a first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of lower step points in all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is an upper step; In response to the fact that the proportion of the three-dimensional coordinate points of the category of down-step points among all the three-dimensional points is not less than the first proportion threshold, and the proportion of the three-dimensional coordinate points of the category of up-step points among all the three-dimensional points is less than the first proportion threshold, determining that the terrain of the real area corresponding to the sampling point cloud is a down-step; In response to the fact that the proportion of three-dimensional coordinate points classified as upper step points among all three-dimensional points is less than the first proportion threshold, and the proportion of three-dimensional coordinate points classified as lower step points among all three-dimensional points is less than the first proportion threshold, it is determined that the terrain of the real area corresponding to the sampling point cloud is a plane.
20. The terrain detection device according to claim 18, characterized in that: The categories of the three-dimensional coordinate points also include invalid points; The detection module is used to determine the terrain of the real area corresponding to the sampling point cloud according to the number of three-dimensional points of the plane point category, the number of three-dimensional points of the upper step point category and the number of three-dimensional points of the lower step point category, specifically for: When the proportion of three-dimensional coordinate points classified as invalid points in all three-dimensional coordinate points is not greater than a second proportion threshold, the terrain of the real area corresponding to the sampling point cloud is determined based on the number of three-dimensional points classified as plane points, the number of three-dimensional points classified as upper step points, and the number of three-dimensional points classified as lower step points.
21. The terrain detection device according to claim 12, characterized in that: Also includes motion modules for: According to the terrain of the real area corresponding to the sampling point cloud, the robot is controlled to move in the real area corresponding to the sampling point cloud.
22. The terrain detection device according to claim 21, characterized in that: The motion module is specifically used for: When the terrain of the real area corresponding to the sampling point cloud is an upward step or a downward step, plane detection is performed on multiple three-dimensional coordinate points in the sampling point cloud, and the robot is controlled to move according to the plane detection result.
23. A robot, characterized in that: The robot comprises a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the terrain detection method according to any one of claims 1 to 11 when executing the computer instructions.
24. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
