Obstacle sensing method and device, robot and readable storage medium
By installing line lidar on the front side panel of the robot and performing image processing to identify laser morphology information, the problem of close-range blind spots in the robot when climbing hills or crossing small hurdles is solved, and the accuracy and safety of obstacle detection are improved.
Patent Information
- Application Number
- CN202411231773.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-03
AI Technical Summary
Existing line lidars are prone to blind spots in close range when robots climb hills or cross small hurdles, resulting in misdetecting obstacles, which in turn leads to unpredictable behavior.
The lidar is installed on the front side panel of the robot, and the initial sensor data is obtained for preprocessing and image conversion. The obstacles are identified through the laser morphological information in the image, and combined with image processing, the accuracy of obstacle detection is improved.
It effectively avoids collisions and misdetection caused by close-range blind spots, and improves the robot's ability to perceive the environment and the accuracy of obstacle recognition.
Smart Images

Figure CN119064952A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an obstacle perception method, device, robot and readable storage medium. Background Art
[0002] Linear LiDAR is a distance measurement sensor. Due to its simple structure and low price, it is widely used in equipment such as robots. Linear LiDAR mainly determines whether there is an obstacle by measuring the distance. It compares the actual distance when there is an obstacle with the preset distance when there is no obstacle. If the actual distance is less than the preset distance, it is considered that there is an obstacle. This method is simple in theory and usually works well on flat ground. However, in actual use, when the line LiDAR is installed obliquely on the top or upper area of the robot, it is easy for the robot to have a close-range blind spot. For example, if the robot needs to climb a slope or pass a small bump, the distance measured by the line LiDAR will become shorter, and it is easy to misdetect it as an obstacle, thereby providing erroneous perception information, causing the robot to behave unpredictably. Summary of the invention
[0003] In view of this, the present application provides an obstacle perception method, device, robot and readable storage medium, which can solve the problem in the prior art that robots are prone to collisions due to close-range blind spots during movement.
[0004] In a first aspect, an embodiment of the present application provides an obstacle perception method, including:
[0005] Get initial sensor data from the line lidar detecting the ground area in front of the robot;
[0006] Preprocessing the initial sensor data to obtain valid sensor data;
[0007] converting the valid sensor data into image data according to a preset resolution;
[0008] Acquiring laser morphology information in the image data;
[0009] Determine whether there is an obstacle based on the laser morphology information.
[0010] In a second aspect, an embodiment of the present application further provides an obstacle sensing device, comprising:
[0011] A data acquisition module, used to acquire initial sensor data when the line laser radar detects the ground area in front of the robot;
[0012] A preprocessing module, used for preprocessing the initial sensor data to obtain valid sensor data;
[0013] An image conversion module, used for converting the effective sensor data into image data according to a preset resolution;
[0014] A morphology extraction module, used to obtain laser morphology information in the image data;
[0015] The obstacle judgment module is used to determine whether there is an obstacle based on the laser morphology information.
[0016] In a third aspect, an embodiment of the present application further provides a robot, comprising a line laser radar, a processor and a memory, wherein the line laser radar is used for collecting environmental information, the memory stores a computer program, and the processor is used for executing the computer program to implement the obstacle perception method.
[0017] In some embodiments, the line laser radar is disposed on the front panel of the robot to collect information of the ground area in front of the robot.
[0018] In a fourth aspect, an embodiment of the present application further provides a readable storage medium storing a computer program, which, when executed, implements the obstacle perception method.
[0019] The embodiments of the present application have the following advantages:
[0020] This application proposes an obstacle perception method, which obtains initial sensor data from the bottom area of the robot; preprocesses the initial sensor data to obtain effective sensor data; converts the effective sensor data into two-dimensional image data according to a preset resolution to obtain laser morphology information in the two-dimensional image; and determines whether there is an obstacle based on the laser morphology information. This method can improve the robot's ability to accurately identify obstacles and its ability to perceive the environment by installing a line laser radar that can sense the bottom environment such as the ground in front of the robot, and combining the image to perform morphology recognition of the laser beam for obstacle detection, thereby avoiding collisions and other phenomena that may occur easily due to close-range blind spots during the robot's movement. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A schematic diagram of the structure of a robot according to an embodiment of the present application is shown;
[0023] Figure 2A schematic diagram of installing a line laser radar according to an embodiment of the present application is shown;
[0024] Figure 3 A first flow chart of an obstacle perception method according to an embodiment of the present application is shown;
[0025] Figure 4 A flow chart for converting sensor data into two-dimensional image data is shown;
[0026] Figure 5 A schematic diagram showing the conversion of a polar coordinate system to a Cartesian coordinate system is shown;
[0027] Figure 6 A schematic diagram showing the conversion of sensor data into a binary image;
[0028] Figure 7 A flowchart of laser morphology information acquisition according to an embodiment of the present application is shown;
[0029] Figure 8 (a) and (b) respectively show the schematic diagrams of the image with disconnected points and after being connected;
[0030] Fig. 9 Shows the surrounding Figure 8 Schematic diagram of the minimum circumscribed rectangle of the contour in (b);
[0031] Fig.10 A flowchart of determining whether there is an obstacle based on laser morphology information according to an embodiment of the present application is shown;
[0032] Fig.11 Shows the Fig. 9 Schematic diagram of a clipping rectangle obtained by clipping the image;
[0033] Fig.12 A schematic diagram of the structure of an obstacle sensing device according to an embodiment of the present application is shown.
[0034] Description of main component symbols:
[0035] 10-robot; 11-processor; 12-memory; 13-sensing unit; 14-execution unit;
[0036] 100 - obstacle sensing device; 110 - data acquisition module; 120 - pre-processing module; 130 - image conversion module; 140 - morphology extraction module; 150 - obstacle judgment module. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0038] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0039] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0040] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0041] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0042] For example, in the robot navigation task, the robot 10 has a close-range blind spot due to the different installation positions and ranging ranges of the line laser radar. In particular, when the robot 10 is climbing a slope or passing a small bump, it is easy to misdetect obstacles. For this reason, the present application proposes an obstacle perception method, in which a line laser radar that can be used to perceive the bottom environment in front of the robot 10 is set on the front panel of the robot 10 to expand the field of view of the robot 10. At the same time, an image-based morphological method is used to process the ranging data collected by the line laser radar, and the presence of an obstacle is identified based on the line laser beam morphology in the converted image. Compared with the method of directly judging the presence or absence of an obstacle based on distance, the accuracy of obstacle detection can be improved, and collisions, foot crushing and the like caused by the close-range blind spot of the robot 10 can be effectively avoided.
[0043] Figure 1A schematic diagram of the structure of the robot 10 according to the embodiment of the present application is shown. Exemplarily, the robot 10 includes a processor 11, a memory 12, a perception unit 13, and an execution unit 14, wherein the memory 12 stores a computer program, and the processor 11 runs the computer program to enable the robot 10 to execute the obstacle perception method according to the embodiment of the present application, thereby preventing misdetection of obstacles and improving the obstacle recognition capability and environmental perception capability of the robot 10.
[0044] Among them, the processor 11 can be an integrated circuit chip with signal processing capabilities. The processor 11 can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0045] The memory 12 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 12 is used to store a computer program, and the processor 11 may execute the computer program accordingly after receiving an execution instruction.
[0046] Among them, the perception unit 13 is mainly used to transmit external environmental information to the control system of the robot 10, so as to provide the necessary conditions for the robot 10 in scenes such as cleaning, navigation, map building or recharging. For example, the perception unit 13 includes, but is not limited to, one or more of a linear laser radar, an ultrasonic sensor, a camera device, etc. Among them, the linear laser radar is set at the corresponding position of the robot 10, and is used for the robot 10 to obtain environmental information of the corresponding position area during the movement, such as measuring the distance information of obstacles based on time of flight (TOF) or triangulation ranging methods. It can be understood that the data collected by the linear laser radar is in the linear laser radar coordinate system. When the robot 10 needs to use the data information, it needs to be converted to a coordinate system, such as converting it to the robot coordinate system to obtain the distance information of the corresponding target in the robot coordinate system.
[0047] Furthermore, line laser radar includes single-line laser radar and multi-line laser radar. Single-line laser radar uses a laser to emit a linear laser beam, and then uses a rotating lens or other mechanical device to irradiate the linear laser beam in different directions. It can be used in scenarios such as household cleaning robots and simple indoor navigation robots. Multi-line laser radar uses multiple laser sources or emits multiple linear laser beams at the same time, with higher resolution and high data rate. Therefore, it is more suitable for fields such as autonomous driving vehicles, drones, precision agricultural robots, etc.
[0048] In the present application, for example, in one embodiment, Figure 2 As shown, the line laser radar is used to sense the bottom environment in front of the robot 10. It can be set on the front side panel of the robot 10 and the viewing angle can detect the ground area in front of the robot 10.
[0049] Among them, the execution unit 14 is mainly related to the use scenario of the robot 10. For example, if the robot 10 is a navigation robot 10, the execution unit 14 may include a walking mechanism, etc. Further, the walking mechanism may include but is not limited to side wheels, track wheels, tracks, etc. Alternatively, if the robot 10 is a cleaning robot 10, the execution unit 14 may include a cleaning mechanism, etc. in addition to the walking mechanism. Specifically, the cleaning mechanism may include but is not limited to a spray washing component, a decontamination component, etc. It can be understood that the specific structure of the execution unit 14 can be determined according to actual needs and is not limited here.
[0050] Based on the robot 10 of the above structure, the obstacle sensing method is described below in conjunction with some specific embodiments.
[0051] Figure 3A flow chart of an obstacle perception method according to an embodiment of the present application is shown. Exemplarily, the obstacle perception method includes the following steps:
[0052] S110, obtaining initial sensor data when the line laser radar detects the ground area in front of the robot 10.
[0053] For example, Figure 2 As shown, the line laser radar is arranged on the front side panel of the robot 10. When the robot 10 is in motion, the line laser radar is controlled to emit a linear laser beam to the bottom area of the ground in front of the robot when it moves, and receives its reflected signal, so as to detect whether there is an obstacle on the ground in front. It is worth noting that during the installation of the line laser radar, the line laser radar can be controlled to continuously emit a laser beam to the ground and adjust its installation position according to the ranging result to ensure that the ranging field of view of the line laser radar can cover the short-range blind area.
[0054] Each frame of sensor data collected by the line laser radar includes, but is not limited to, the distance value to the target, the rotation angle and vertical angle of the line laser beam, and may also include the reflection intensity of the line laser beam, a timestamp, etc., which may be used according to the actual usage scenario. In this embodiment, each frame of sensor data is processed as a unit to obtain corresponding image data.
[0055] S120, preprocessing the initial sensor data to obtain valid sensor data.
[0056] Exemplarily, the retained sensor data is obtained by filtering out a preset amount of header data and tail data in the initial sensor data respectively; then, the retained sensor data is smoothed and the smoothed sensor data is used as the valid sensor data. For example, in one embodiment, smoothing can be achieved by using a method such as median filtering, and of course, other embodiments such as average filtering can also be used, which are not limited here.
[0057] It can be understood that since the data at both ends of the line laser radar is unstable and prone to jumps, in this embodiment, a certain amount of data at both ends will be filtered and processed separately, and the data in the middle will be retained, which can improve the accuracy of recognition. Secondly, since the line laser radar product itself will be affected by factors such as its own system, the surface of the object to be measured, and the scanning environment, the collected data will inevitably be mixed with some noise points (outliers). Smoothing can effectively reduce the impact of noise points, thereby improving the reliability and accuracy of the data.
[0058] As an optional solution, after obtaining valid sensor data, a preliminary judgment can be made in advance as to whether there are obstacles or whether the linear lidar ranging is normal, in order to improve processing efficiency.
[0059] Exemplarily, the method further includes: detecting whether the number of distance values in the valid sensor data that are zero is greater than a preset number, and if so, determining that there is an obstacle. It can be understood that by preliminarily detecting whether there are distance values in the valid sensor data that are near 0 and the number is greater than a certain number, if so, it indicates that the line laser radar is blocked or the line laser radar distance measurement is abnormal, so it can be regarded as an obstacle, that is, it is determined that there is an obstacle. In this case, new sensor data can be reacquired after adjusting the position or angle of the line laser radar.
[0060] S130, converting the effective sensor data into image data according to a preset resolution.
[0061] For the sensor data collected by the line lidar, polar coordinates can usually be used to describe a series of distance values and angle information at corresponding moments; and to facilitate subsequent processing, this embodiment converts the distance value and angle information from the polar coordinate system to the Cartesian coordinate system (also a rectangular coordinate system) through coordinate system conversion to obtain the corresponding rectangular coordinates; then, it is mapped to the corresponding image pixels to obtain the image data corresponding to each frame of sensor data.
[0062] For example, in one embodiment, the effective sensor data may be converted into a two-dimensional plane image, such as Figure 4 As shown, specifically including:
[0063] S210, converting each group of distance values and angle information from the polar coordinate system to the Cartesian coordinate system to obtain two-dimensional coordinates in the Cartesian coordinate system.
[0064] like Figure 5 As shown, from the polar coordinate system to the Cartesian coordinate system, the two-dimensional plane coordinates (X, Y) corresponding to each set of distance values and angles can be calculated according to the following formula:
[0065]
[0066] In the formula, R is the distance value, α and ω are the rotation angle and vertical angle of the line laser beam at the current moment, respectively, where the vertical angle ω of each line laser beam is a fixed value. It can be understood that this is only an example of two-dimensional coordinates. If necessary, it can also be calculated as follows: Figure 5 The projection principle shown is used to calculate the three-dimensional coordinates, which means that the effective sensor data is converted into a three-dimensional image.
[0067] S220, mapping all two-dimensional coordinates of the frame sensor data to corresponding image pixel positions according to a preset resolution, and determining pixel values of the pixels according to the distance values to obtain two-dimensional image data.
[0068] The unit of the preset resolution is meter per pixel. Exemplarily, after determining each coordinate information, the point described by each two-dimensional coordinate can be used as each pixel point according to the pixel resolution of the image to be displayed, and the pixel value of each pixel point can be determined according to the original distance value. Generally, if the distance value is not zero, the pixel value is not zero, that is, it is a non-zero pixel point. To facilitate the subsequent extraction of laser morphology information, non-zero pixels and other pixels can be distinguished by two grayscale values, for example, Figure 6 As shown, non-zero pixels are white, and other pixels are black or gray, or vice versa.
[0069] S140, obtaining laser morphology information in the image data.
[0070] Among them, laser morphology information refers to the morphology information obtained when the line laser beam emitted by the line laser radar is projected onto the surface of an object. In this embodiment, the morphology of the line laser beam in the image is used to determine whether an obstacle is sensed. It can be understood that since the laser morphology information is directly related to the distance value, the morphology of the line laser beam without an obstacle is different from the morphology of the line laser beam with an obstacle. Based on this, it can be determined whether there is an obstacle. It can be understood that the obstacles here are obstacles in a broad sense, which can include various furniture, walls, uphill slopes, etc., and can also include cliffs such as stairs and downhill slopes.
[0071] In one embodiment, Figure 7 As shown, the above step S140 includes:
[0072] S310, extracting the maximum contour of the line laser beam emitted by the line laser radar when it is projected onto the surface of the object according to the non-zero pixel points in the image data.
[0073] Exemplarily, all pixel points whose pixel values are not zero are extracted, and the pattern formed by these pixel points is the pattern formed by the line laser beam emitted by the line laser radar projected onto the surface of the object and reflected back.
[0074] However, since the distance measured by the line laser radar is not continuous, for the disconnected non-zero pixels in the image, it is necessary to connect the disconnected non-zero pixels to form a connected pattern. For example, if there are disconnections in the generated two-dimensional image, such as Figure 8 As shown in (a), the two disconnected parts of the pattern need to be connected, as shown in Figure 8 Next, the maximum contour of the connected pattern is extracted.
[0075] S320, obtaining the minimum circumscribed rectangle information of the enclosing contour as the line laser beam morphology information.
[0076] In this embodiment, the minimum bounding rectangle information surrounding the maximum contour is used as the acquired line laser beam morphology information. The minimum bounding rectangle refers to a rectangle with the smallest area surrounding the maximum contour, and the minimum bounding rectangle information includes the width and height of the rectangle. Figure 8 Take (b) as an example, its minimum bounding rectangle is as follows Fig. 9 shown.
[0077] S150, determining whether there is an obstacle based on the laser morphology information.
[0078] For example, in one embodiment, Fig.10 As shown, determine whether there is an obstacle, including:
[0079] S410, detecting whether the width and height exceed preset thresholds in their respective corresponding directions.
[0080] For example, the corresponding number of pixels may be set in the horizontal and vertical directions according to the rectangular pixel size of the projection pattern of the line laser beam when there are no obstacles, so as to determine whether the rectangle obtained each time is normal.
[0081] Exemplarily, if at least one of the width and height exceeds the preset threshold in the corresponding direction, it indicates that there may be an obstacle in the rectangular frame. For further confirmation, steps S420 and S430 are performed to determine whether there is an image coordinate with a pixel value greater than 0 by traversing the pixel values in the rectangular frame.
[0082] Optionally, if the width and height do not exceed the preset thresholds in their respective corresponding directions, it indicates that there is no obstacle from the image perspective. As an optional solution, in order to further improve the accuracy, the original distance value will be used for direct judgment, that is, the execution of steps S440 and S450 will be executed.
[0083] S420, cropping the minimum circumscribed rectangle in the width direction to obtain a cropping rectangle.
[0084] With the aforementioned Fig. 9 For example, after cutting along the width direction, we get Fig.11 Then, the new contour is extracted again by contour search and using the minimum bounding rectangle.
[0085] S430, detect whether there is a non-zero pixel point in the cropping rectangle. If there is at least one non-zero pixel point, execute step S460. If not, execute steps S440 and S450.
[0086] S440: Obtain the horizontal projection distance of the distance value in the effective sensor data in the Cartesian coordinate system.
[0087] S450, detecting whether there is at least one projection distance less than a preset distance. If yes, executing step S460. Otherwise, executing step S470.
[0088] S460, determining that there is an obstacle.
[0089] S470, determining that there is no obstacle.
[0090] It can be understood that steps S440 and S450 mainly use the original distance value to directly determine whether there is an obstacle. This method, as a further supplement to the image-based recognition of no obstacles, can improve the recognition accuracy of obstacles.
[0091] As an optional solution, after determining that an obstacle exists, the method further includes:
[0092] S480, obtaining the coordinates of obstacles in the line laser radar coordinate system or in the image data, and marking the positions of the obstacles in the robot coordinate system. It can be understood that by marking the obstacles in the robot coordinate system, obstacle avoidance planning can be facilitated during the operation path planning.
[0093] For example, suppose there is a cleaning robot 10 cleaning the room. It has the above-mentioned line laser radar installed on its front panel. When it encounters a threshold or a small object, the robot 10 can accurately identify it through the above-mentioned obstacle perception method and tell the robot 10 how to avoid them, so that no collision occurs.
[0094] The obstacle perception method proposed in the embodiment of the present application is to install a line laser radar sensor at a specific position of the robot 10, so that the environment can be perceived from the bottom angle, the field of view of the robot 10 can be expanded, and the close-range blind spot can be avoided; at the same time, the collected initial sensor data is filtered and smoothed, and then converted into an image, so that the shape of the laser beam in the image can be intuitively seen; finally, by identifying the specific form in the image, it is determined whether there is an obstacle so as to make a timely response. By combining image processing, the present application allows the robot 10 to more accurately judge obstacles in the surrounding environment, improve the safety of the robot 10 and avoid unnecessary collisions, so as to better complete the task.
[0095] Fig.12 A schematic diagram of the structure of an obstacle sensing device 100 according to an embodiment of the present application is shown. Exemplarily, the obstacle sensing device 100 includes:
[0096] The data acquisition module 110 is used to acquire initial sensor data when the line laser radar detects the ground area in front of the robot 10.
[0097] The preprocessing module 120 is used to preprocess the initial sensor data to obtain valid sensor data.
[0098] The image conversion module 130 is used to convert the effective sensor data into image data according to a preset resolution.
[0099] The morphology extraction module 140 is used to obtain laser morphology information in the image data.
[0100] The obstacle determination module 150 is used to determine whether there is an obstacle based on the laser morphology information.
[0101] In some embodiments, the valid sensor data includes the distance value measured by the line laser radar and the angle at the corresponding time. The image conversion module 130 includes a coordinate system conversion unit and a pixel mapping unit.
[0102] The coordinate system conversion unit is used to convert each set of the distance value and the angle in each frame of sensor data from the polar coordinate system to the Cartesian coordinate system to obtain a two-dimensional coordinate in the Cartesian coordinate system. The pixel mapping unit is used to map all the two-dimensional coordinates of the frame of sensor data to corresponding image pixel positions according to a preset resolution, and determine the pixel value of the pixel according to the distance value to obtain two-dimensional image data.
[0103] In some embodiments, the effective sensor data includes the distance value measured by the line laser radar, the pixel value of the pixel point in the image data is determined according to the distance value, the distance value is not zero, and the pixel value is not zero. The morphology extraction module 140 includes a contour extraction unit and a circumscribed rectangle acquisition unit.
[0104] The contour extraction unit is used to extract the maximum contour of the line laser beam emitted by the line laser radar when it is projected onto the surface of the object based on the non-zero pixel points in the image data.
[0105] The circumscribed rectangle acquisition unit is used to acquire the minimum circumscribed rectangle information surrounding the contour as the morphological information of the line laser beam.
[0106] In some embodiments, the minimum bounding rectangle information includes the width and height of the minimum bounding rectangle; the obstacle determination module 150 includes a detection unit, a cropping unit, and a determination unit.
[0107] Among them, the detection unit is used to detect whether the width and the height exceed the preset thresholds in the respective corresponding directions; the cropping unit is used to crop the minimum circumscribed rectangle in the width direction to obtain a cropped rectangle if at least one of the width and the height exceeds the preset threshold in the corresponding direction; the determination unit is used to detect whether the non-zero pixel points exist in the cropping rectangle, and if there is at least one non-zero pixel point, it is determined that there is an obstacle.
[0108] In some embodiments, the obstacle determination module 150 further includes a projection unit.
[0109] The projection unit is used to obtain the horizontal projection distance of the distance value in the valid sensor data in the Cartesian coordinate system if the width and the height do not exceed the preset thresholds in their respective corresponding directions, or when the determination unit detects that the non-zero pixel point does not exist.
[0110] The determination unit is further configured to confirm the presence of an obstacle when at least one of the projection distances is less than a preset distance.
[0111] In some embodiments, the valid sensor data includes a distance value measured by the line laser radar. Exemplarily, the obstacle sensing device 100 further includes a sensor detection module.
[0112] The sensor detection module is used to determine that there is an obstacle when it is detected that the number of zero distance values in the valid sensor data is greater than a preset number.
[0113] In some embodiments, the pre-processing module 120 includes a data filtering unit and a data smoothing unit.
[0114] The data filtering unit is used to filter out a preset amount of data located at the head and tail of the initial sensor data respectively to obtain the retained sensor data; the data smoothing unit is used to smooth the retained sensor data and use the smoothed sensor data as the valid sensor data.
[0115] In some embodiments, the obstacle sensing device 100 further includes an obstacle marking module.
[0116] Among them, the obstacle marking module is used to obtain the obstacle coordinates in the line laser radar coordinate system or in the image data after the obstacle judgment module 150 determines that there is an obstacle, and mark the position of the obstacle in the robot coordinate system.
[0117] It can be understood that the device of this embodiment corresponds to the obstacle sensing method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0118] The present application also provides a computer-readable storage medium for storing the computer program used in the robot 10. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0119] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0120] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0121] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0122] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. An obstacle perception method, characterized in that: include: Get initial sensor data from the line lidar detecting the ground area in front of the robot; Preprocessing the initial sensor data to obtain valid sensor data; converting the valid sensor data into image data according to a preset resolution; Acquiring laser morphology information in the image data; Determine whether there is an obstacle based on the laser morphology information.
2. The obstacle sensing method according to claim 1, characterized in that: The valid sensor data includes the distance value measured by the line laser radar and the angle at the corresponding moment; The converting the valid sensor data into image data according to a preset resolution includes: Convert each set of the distance value and the angle in each frame of sensor data from a polar coordinate system to a Cartesian coordinate system to obtain a two-dimensional coordinate in the Cartesian coordinate system; All the two-dimensional coordinates of the frame sensor data are mapped to corresponding image pixel positions according to a preset resolution, and pixel values of the pixels are determined according to the distance values to obtain two-dimensional image data.
3. The obstacle sensing method according to claim 1, characterized in that: The valid sensor data includes a distance value measured by the line laser radar, and a pixel value of a pixel point in the image data is determined according to the distance value, wherein the distance value is not zero and the pixel value is not zero; The obtaining of laser morphology information in the image data comprises: Extracting, according to the non-zero pixel points in the image data, the maximum contour of the line laser beam emitted by the line laser radar when projected onto the surface of the object; The minimum circumscribed rectangle information surrounding the outline is obtained as the shape information of the line laser beam.
4. The obstacle sensing method according to claim 3, characterized in that: The minimum bounding rectangle information includes the width and height of the minimum bounding rectangle; The determining whether there is an obstacle based on the laser morphology information includes: Detecting whether the width and the height exceed preset thresholds in their respective corresponding directions; If at least one of the width and the height exceeds a preset threshold in the corresponding direction, the minimum circumscribed rectangle is cropped in the width direction to obtain a cropped rectangle; It is detected whether the non-zero pixel point exists in the cropping rectangle, and if at least one non-zero pixel point exists, it is determined that there is an obstacle.
5. The obstacle sensing method according to claim 4, characterized in that: Also includes: If the width and the height do not exceed the preset thresholds in their respective corresponding directions, or if the non-zero pixel does not exist, the horizontal projection distance of the distance value in the valid sensor data in the Cartesian coordinate system is obtained, and when at least one of the projection distances is less than the preset distance, it is confirmed that there is an obstacle.
6. The obstacle sensing method according to claim 1, characterized in that: The valid sensor data includes a distance value measured by the line laser radar; After obtaining the valid sensor data, the method further includes: When it is detected that the number of zero distance values in the valid sensor data is greater than a preset number, it is determined that an obstacle exists.
7. The obstacle sensing method according to claim 1, characterized in that: The preprocessing of the initial sensor data to obtain valid sensor data includes: Respectively filtering out a preset amount of data located at the head and the tail of the initial sensor data to obtain retained sensor data; The retained sensor data is smoothed, and the smoothed sensor data is used as valid sensor data.
8. The obstacle sensing method according to any one of claims 1 to 7, characterized in that: Also includes: After determining that there is an obstacle, the coordinates of the obstacle in the line laser radar coordinate system or in the image data are obtained, and the position of the obstacle is marked in the robot coordinate system.
9. An obstacle sensing device, characterized in that: include: A data acquisition module, used to acquire initial sensor data when the line laser radar detects the ground area in front of the robot; A preprocessing module, used for preprocessing the initial sensor data to obtain valid sensor data; An image conversion module, used for converting the effective sensor data into image data according to a preset resolution; A morphology extraction module, used to obtain laser morphology information in the image data; The obstacle judgment module is used to determine whether there is an obstacle based on the laser morphology information.
10. A robot, characterized in that: The robot includes a line laser radar, a processor and a memory, the line laser radar is used for collecting environmental information, the memory stores a computer program, and the processor is used for executing the computer program to implement the obstacle perception method described in any one of claims 1 to 8.
11. The robot according to claim 10, characterized in that: The line laser radar is arranged on the front panel of the robot and is used for collecting information of the ground area in front of the robot.
12. A computer-readable storage medium, characterized in that: It stores a computer program, and when the computer program is executed, the obstacle perception method according to any one of claims 1-8 is implemented.
