Automatic orientation control method and device of robot and storage medium

Through environmental perception and RTK positioning technology, the robot identifies the working surface and tracks the positioning point, solving the problems of robot orientation failure and insufficient safety, and realizing high-precision automatic orientation control.

CN120686701APending Publication Date: 2025-09-23SHENZHEN MAMMOTION INNOVATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510872818.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

When the robot is initializing the positioning device or recovering after positioning is lost, it is difficult to accurately determine the orientation, resulting in failure of automatic orientation or insufficient safety.

Method used

The environmental perception unit is used to collect data about the robot's surrounding environment, control the robot to perform linear motion, and track multiple positioning points through the position tracking unit. The semantic segmentation model is used to identify the working surface, and the RTK positioning module is combined to achieve high-precision orientation.

Benefits of technology

Improves safety and success rate during robot automatic orientation, ensuring the robot is accurately oriented within the work surface, avoiding interference from obstacles and non-work surfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120686701A_ABST
    Figure CN120686701A_ABST
Patent Text Reader

Abstract

The invention provides an automatic orientation control method and device for a robot and a storage medium, the robot comprises an environment sensing unit and a position tracking unit, and the method comprises the steps that the environment sensing unit is used for collecting data of the surrounding environment of the robot, and the robot is controlled to execute linear motion, the data directs the robot to perform the linear motion in a direction having a continuous working surface; during the linear motion, using the position tracking unit to track a plurality of positioning position points passed by the robot; and determining the current orientation of the robot according to at least two positioning position points in the plurality of positioning position points. By executing the embodiment of the invention, the automatic orientation capability of the robot can be improved when the robot is in an initialization stage of the positioning device or is recovered after positioning is lost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robotics technology, and in particular to a method, device, and storage medium for automatic orientation control of a robot. Background Art

[0002] Currently, with the rapid development of robotics technology, robots are widely used in people's lives. For example, in home gardens or large lawns, intelligent lawn mower robots have greatly improved the efficiency of lawn maintenance and mowing. During the initialization phase of the positioning device or when recovering after a positioning loss, the robot needs to re-determine its orientation, that is, obtain information about its facing direction. Knowing where the robot is facing is fundamental for planning paths, understanding maps (which typically provide coordinate system orientation), and accurately moving toward a target point. Without the correct orientation, even if the robot's location is known, it may still move in the wrong direction.

[0003] Therefore, how to improve the safety and success rate of the robot's automatic orientation during automatic orientation needs to be solved urgently. Summary of the Invention

[0004] The embodiments of the present application provide a method, device, and storage medium for controlling automatic orientation of a robot, which improve the safety and success rate of automatic orientation during the robot's automatic orientation during the initialization phase of the positioning device or when the robot recovers after positioning is lost.

[0005] In a first aspect, an embodiment of the present application provides a method for automatic orientation control based on a robot, wherein the robot includes an environment perception unit and a position tracking unit, and the method includes: Using the environmental perception unit to collect data about the robot's surrounding environment; controlling the robot to perform linear motion, wherein the data guides the robot to perform the linear motion in a direction having a continuous working surface; During the linear motion, using the position tracking unit to track a plurality of positioning position points passed by the robot; The current orientation of the robot is determined according to at least two positioning points among the multiple positioning points.

[0006] In a second aspect, an embodiment of the present application provides a robot, comprising: A body and a moving mechanism, wherein the moving mechanism is used to drive the body to move; Environmental perception unit, used to collect environmental data; A position tracking unit, used to locate the position of the robot; Storage devices for storing data; A control unit is configured to: determine a safe area that meets preset safe driving conditions based on the output of the environmental perception unit; control the movement mechanism to drive the body to travel in a straight line within the safe area; during the straight-line driving process, record multiple positioning points reached by the robot in a storage device; and determine the current orientation of the robot based on at least two of the multiple positioning points.

[0007] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program comprises instructions for executing the steps of any method of the first aspect of the embodiment of the present application.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.

[0009] In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.

[0010] By implementing the embodiments of the present application, the following beneficial effects are achieved: This application describes a method, device, and storage medium for controlling automatic orientation of a robot. The method is applied to a robot comprising an environmental sensing unit and a position tracking unit. The method first uses the environmental sensing unit to collect data about the robot's surroundings. The method then controls the robot to perform linear motion, wherein the data guides the robot to perform the linear motion in the direction of a continuous work surface. During the linear motion, the position tracking unit tracks multiple positioning points passed by the robot. Finally, the robot's current orientation is determined based on at least two of the multiple positioning points. In this manner, the robot identifies the work surface and guides the robot to achieve orientation within the work surface, thereby improving the safety and success rate of the robot's automatic orientation. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 This is a system architecture diagram of an automatic orientation control method for a robot provided in an embodiment of the present application; Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application; Figure 3 This is a flow chart of an automatic orientation control method for a robot provided in an embodiment of the present application; Figure 4 1 is a flow chart of a method for automatic orientation control of a robot on an obstacle avoidance or non-working surface provided by an embodiment of the present application; Figure 5 1 is a flow chart of another method for automatic orientation control of a robot provided in an embodiment of the present application; Figure 6 This is a schematic diagram of a scenario of an automatic orientation control method for a robot provided in an embodiment of the present application; Figure 7 1 is a schematic diagram of another scenario of an automatic orientation control method for a robot provided in an embodiment of the present application; Figure 8 This is a block diagram of the functional modules of a robot provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0014] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0015] It should be understood that the term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document indicates that the associated objects are in an "or" relationship. The "plurality" appearing in the embodiments of this application refers to two or more.

[0016] In the embodiments of the present application, "at least one item" or similar expressions refers to any combination of these items, including any combination of single items or plural items, and refers to one or more, and multiple refers to two or more. For example, at least one item (item) of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.

[0017] The "connection" appearing in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.

[0018] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0019] The following are the explanations of the relevant terms involved in this application: RTK positioning: Based on the carrier phase real-time kinematic (RTK) method, the positioning system consists of a base station and a rover. The base station continuously collects satellite observation data and obtains precise coordinates, transmitting the raw observations and coordinate information to the rover in real time via wireless communication. The rover synchronously receives GPS satellite signals and calculates the difference between the base station data and its own observations in real time, ultimately outputting a three-dimensional positioning result with centimeter-level accuracy.

[0020] Smart lawn mowing robots face the following major challenges during automatic orientation: First, they rely on continuous linear motion. At low speeds, when obstructed by obstacles, or when restricted by lawn boundaries, the robot may be unable to maintain straight movement, resulting in automatic orientation failure. Second, there is the risk of losing control of the safety boundary, causing the robot to mistakenly drive outside the lawn area, causing damage to the equipment or interrupting the mission. Therefore, improving the safety and success rate of the robot's automatic orientation is an urgent issue.

[0021] To address the aforementioned issues, embodiments of the present application provide a method, device, and storage medium for controlling automatic orientation of a robot. The robot includes an environmental sensing unit and a position tracking unit. The environmental sensing unit collects data about the robot's surrounding environment and controls the robot to perform linear motion. The data is used to guide the robot to perform the linear motion in the direction of a continuous work surface. During the linear motion, the position tracking unit tracks multiple positioning points passed by the robot, and the robot's current orientation is determined based on at least two of the multiple positioning points. In this way, the robot can identify the work surface and guide the robot to achieve orientation within the work surface, thereby improving the safety and success rate of the robot's automatic orientation.

[0022] The following combination Figure 1 The system architecture of a method for automatic orientation control of a robot in an embodiment of the present application is described. Figure 1 1 is a system architecture diagram of an automatic orientation control method for a robot provided in an embodiment of the present application. The system architecture 100 of the automatic orientation control method for a robot includes: a robot 110 and an RTK reference station 120 .

[0023] The robot 110 includes a camera module 111 and an RTK positioning module 112. As the main actuator for automatic orientation control, the robot 110 integrates these two modules to form a "environmental perception-precise positioning" perception system. The camera module 111 collects visual data of the robot's surroundings and identifies environmental elements such as lawns, obstacles, and non-working surfaces based on a preset semantic segmentation model. For example, in a lawn mowing robot application, it can detect image information within a range of 1-3 meters in front of it. After pre-processing, it inputs the semantic segmentation model to distinguish between continuous lawn areas and non-working areas, providing visual evidence for environmental judgment during automatic orientation control (e.g., whether the front is a continuous working surface). The RTK positioning module 112 is used for high-precision position tracking. By receiving differential signals broadcast by the RTK base station 120 and combining them with its own satellite positioning data, it performs real-time dynamic differential positioning, outputting centimeter-level accuracy of the robot's three-dimensional coordinates (X, Y, Z) and timestamp information. In the automatic orientation control process, this module provides precise spatial coordinates for steps such as "tracking the positioning points passed by the robot", "calculating the distance between the robot and the boundary of the task area / forbidden zone", and "determining the current orientation of the robot", ensuring the accuracy of position and direction calculation of orientation control and building a reliable spatial positioning benchmark.

[0024] In one possible embodiment, when robot 110 executes linear motion instructions, camera module 111 continuously captures images of the surroundings ahead, monitoring in real time for obstacles or non-working surfaces. Simultaneously, RTK positioning module 112 outputs positioning points, providing data support for trajectory tracking and orientation calculation. If camera module 111 detects an anomaly ahead (such as an obstacle), the robot stops and reorients. The high-precision coordinates of RTK positioning module 112 assist in calculating the relative position of the robot and its surroundings (such as the mission area boundary and pre-set restricted areas), providing a spatial constraint basis for new directional decisions, thereby enhancing the robustness of directional control in complex scenarios.

[0025] The RTK base station 120, as the core support unit for high-precision positioning, provides differential correction data to the RTK positioning module 112 of the robot 110. By continuously receiving satellite signals over a long period of time, it establishes a local, high-precision coordinate reference and broadcasts differential signals containing correction information such as satellite orbit error, ionospheric delay, and tropospheric delay in real time. Data exchange between the RTK base station 120 and the robot 110 occurs via a wireless communication link, providing the robot 110 with high-precision positioning services over a wide area. This addresses the issue of satellite positioning signal accuracy degradation caused by multipath effects and ionospheric interference, ensuring that the RTK positioning module 112 outputs centimeter-level positioning results, laying the foundation for precise spatial decision-making for automatic orientation control.

[0026] In one possible embodiment, the base station receives GNSS satellite signals in real time, generates differential correction parameters through calculation, encapsulates them according to a preset protocol (such as RTCM), and broadcasts them to robots 110 within the coverage area via a wireless base station. The robot's RTK positioning module 112 receives the differential signals, integrates them with its own collected raw satellite observation data, performs carrier phase differential analysis, and outputs a high-precision real-time positioning result.

[0027] As can be seen, the system architecture of the robot's automatic orientation control method described above establishes a "visual perception + high-precision positioning + differential reference" system. In applications such as lawn mowing robots, this can effectively improve the robot's orientation accuracy and operational reliability in complex lawn environments, addressing operational inefficiencies caused by environmental interference and positioning errors, and enhancing the robot's automatic orientation performance. Furthermore, this architecture is scalable and can be adapted to larger operating scenarios and higher-precision robot applications by upgrading the camera module's algorithms (e.g., introducing 3D reconstruction and multimodal fusion) or optimizing the deployment of RTK base stations (e.g., building a base station network).

[0028] The following combination Figure 2 The electronic device in the embodiment of the present application is described. Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the electronic device 200 includes one or more processors 210, a memory 220, a communication interface 230 and one or more programs 221. The processor 210 is communicatively connected to the memory 220 and the communication interface 230 via an internal communication bus.

[0029] The one or more programs 221 are stored in the memory 220 and configured to be executed by the processor 210. The one or more programs include instructions for executing any step in the embodiment of the automatic orientation control method of the robot described below.

[0030] The processor 210 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, units, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on. The communication unit may be a communication interface, a transceiver, a transceiver circuit, etc., and the storage unit may be a memory.

[0031] Memory 220 may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. Nonvolatile memory may be read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM).

[0032] It is understandable that the electronic device 200 may include more or fewer structural elements than those in the above structural block diagram, for example, a power module, physical buttons, a Wi-Fi module, a speaker, a Bluetooth module, a sensor, a display module, etc., which are not limited here.

[0033] After understanding the software and hardware architecture of this application, Figure 3 A method for automatic orientation control of a robot in an embodiment of the present application is described. Figure 3 1 is a flow chart of an automatic orientation control method for a robot provided in an embodiment of the present application. The robot includes an environment perception unit and a position tracking unit. The method specifically includes the following steps: Step S310: Use the environment perception unit to collect data about the robot's surrounding environment.

[0034] The environmental perception unit uses visual sensors to collect real-time environmental data and utilizes a semantic segmentation model to identify lawn and non-lawn areas. The visual sensor utilizes a high-resolution CMOS image sensor, covering a 180-degree field of view in front of the robot, ensuring real-time perception of the surrounding environment. The semantic segmentation model is built on a deep learning framework, employing an autoencoder network structure, a convolutional neural network model, or a Transform model (not specifically defined here). Using training samples, it learns the color, texture, and geometric features of lawn and non-lawn areas, achieving pixel-level classification of the input image and outputting a binary mask that identifies drivable areas (lawn) and prohibited areas (non-lawn). The model's training dataset is derived from scenes with varying lighting conditions (sunny, cloudy, dusk), lawn growth states (neatly trimmed, overgrown), and non-lawn objects (mud, bricks, stones, shrubs), ensuring the model's generalization capabilities in complex environments.

[0035] Environmental data processing includes preprocessing and identifying the robot's straight-line area. During preprocessing, the original image undergoes grayscale conversion, Gaussian filtering for denoising, and brightness normalization to eliminate the impact of ambient light fluctuations on the detection results. During identification of the robot's straight-line area, the continuity of the lawn in front of the robot is calculated based on the output mask. If the proportion of lawn pixels within 1 meter directly in front of the robot exceeds 90%, it is determined to be a "continuous lawn area," allowing the robot to proceed straight. If the proportion is below this threshold or there is a non-lawn area, a rotation search mechanism is triggered. The 1m detection distance threshold directly in front of the robot is determined by the robot's motion speed and sensor latency.

[0036] It should be noted that when the robot is near the edge of a lawn, the environmental perception unit must simultaneously perform boundary distance estimation. The restricted area mask obtained through semantic segmentation is combined with the robot's own positioning coordinates to calculate the minimum distance D between the robot and the nearest restricted area boundary. If D > 1.5m, it is considered a safe distance and the robot is allowed to move straight in that direction; if D ≤ 1.5m, it is considered close to the boundary, triggering the robot to rotate in place around its body. The setting of the 1.5m threshold takes into account the robot's body size and motion errors, ensuring that the robot will not exit the lawn area due to positioning deviation or control delay. In addition, if the robot still fails to detect a qualified continuous lawn area after rotating 360° in place, it is determined that the "environment is not orientable" and a voice prompt message is output to guide the robot to move to an appropriate location before restarting.

[0037] Step S320 : controlling the robot to perform linear motion, wherein the data guides the robot to perform the linear motion in a direction having a continuous working surface.

[0038] The semantic segmentation output from the environmental perception unit indicates the presence of a continuous work surface (i.e., a lawn area) directly in front of the robot and that the distance between the robot and the boundary of the task area or the pre-set restricted area must meet a safety threshold. If the environmental perception unit detects that the percentage of lawn pixels within 1 meter in front of the robot exceeds 90%, and the minimum distance D between the robot's center point and the nearest restricted area boundary exceeds 1.5 meters, the behavioral decision module generates a "go straight" command. Furthermore, real-time environmental status monitoring and dynamic adjustments are required during linear motion.

[0039] It's important to note that directional control of linear motion is coupled with the positioning and tracking process. During the straight-line phase, the position tracking unit (an RTK positioning module that integrates GPS and inertial navigation) records the robot's real-time coordinates. Adjacent positioning points are smoothed using a Kalman filter algorithm to form a continuous motion trajectory. Based on this trajectory, the behavior decision module calculates the robot's real-time heading angle (the azimuth of the line connecting the current and previous positions).

[0040] In a possible embodiment, using the environment perception unit to collect data about the robot's surrounding environment; and controlling the robot to perform linear motion includes: 321. Position the robot at a starting position, and use the environment perception unit to collect environment data in a first direction of the robot to obtain first environment data; 322. Determine whether there is a continuous working surface in the first direction according to the first environmental data; 323. If there is a continuous working surface in the first direction, control the robot to perform the linear motion from the starting position to the first direction; 324. If there is no continuous working surface in the first direction, use the environment perception unit to collect environment data in a second direction of the robot to obtain second environment data; the second direction is different from the first direction; 325. If there is a continuous working surface in the second direction, control the robot to perform the linear motion in the second direction.

[0041] The starting position is the starting position where the robot is placed. The first direction is set by default to the front of the robot body. The visual sensor of the environmental perception unit is centered in this direction, collects image data within the 180° viewing angle in front, and transmits the data collected by the visual sensor to the main control unit. The determination of a continuous working surface is based on the semantic segmentation results: if the proportion of lawn pixels within the first 1m range in the first direction is ≥90%, and the minimum distance D between the center point of the robot body and the boundary of the prohibited area in this direction is greater than 1.5m, it is determined to have a "continuous working surface".

[0042] When the first direction fails to meet the requirements, the robot executes a direction-switching strategy. The motor drives the robot body to rotate in place at a preset angular velocity (e.g., 10° / s), switching the visual sensor's detection direction from the first to the second. This second direction allows detection of areas with smaller angles relative to the first, thus reducing the number of rotations. If no valid working surface is detected in k consecutive directions, a 360° full-circle scanning mode is initiated. Furthermore, during the direction-switching process, an inertial measurement unit (IMU) is provided to output angular velocity data in real time, compensating for motion blur during image acquisition and ensuring semantic segmentation accuracy. For example, when an intelligent lawn mower robot is activated at the edge of a lawn, its first direction may point toward a non-lawn area (e.g., a concrete path). At this point, the robot body is triggered to rotate 90° clockwise and collect environmental data in the second direction (inside the lawn). If continuous lawn is detected in this direction, the robot is controlled to move straight ahead, and the position tracking unit records the location point for subsequent heading calculation. If the robot still cannot detect the valid area after rotating 360° around its body, it will alarm through the buzzer and send a prompt message to the user terminal, suggesting that the robot be moved to the center of the lawn or on the charging station to start.

[0043] In a possible embodiment, the method further includes the following steps: A1. Control the robot to rotate in place at the starting position so that the environment perception unit changes from aligning with the first direction to aligning with the second direction.

[0044] The robot's differential drive mechanism controls in-situ rotation, allowing it to rotate 360° around its body, allowing it to rotate at a constant angular velocity on uneven surfaces such as lawns. During rotation, encoders provide real-time feedback on wheel speed, allowing the rotation angle to be dynamically adjusted.

[0045] The switching angle in the second direction prioritizes detection of adjacent areas in the clockwise direction. When the lawn area is irregularly shaped, a smaller switching angle can reduce the number of full-circle scans. If detection fails at 45°, the switching angle is gradually increased in 45° steps until a full 360° range is covered. When a continuous working surface is detected, rotation immediately stops and the current heading angle is recorded. This angular error is corrected by integrating the angular velocity of the inertial measurement unit.

[0046] In a possible embodiment, the method further includes the following steps: B1. Record the multiple positioning points in a storage device in the form of coordinates.

[0047] Among them, the coordinate record of the positioning position point adopts a dual coordinate system mapping mechanism: the global coordinate system uses the WGS84 coordinate system for cross-scene task scheduling; the local coordinate system uses the robot's starting position as the origin (0,0) and the north direction as the positive direction of the X-axis to construct a two-dimensional plane coordinate system for real-time heading calculation.

[0048] In a possible embodiment, the method further includes the following steps: C1. A map including the boundary of a task area is stored in the storage device of the robot. The map has a coordinate system direction. The robot performs a task in the task area, and the current orientation uses the coordinate system direction as a reference direction.

[0049] Among them, the initial map of the mission area based on satellite remote sensing or manual mapping is pre-stored in the storage device, including geographical features such as lawn boundaries, no-go zones, and charging station locations. The map coordinate system uses a custom plane coordinate system, with the north direction as the reference direction of 0° to ensure compatibility with GPS coordinates. When the robot is started, the map boundary is corrected in real time based on the semantic segmentation results of the environmental perception unit. When a deviation is detected between the actual lawn boundary and the pre-stored map (deviation threshold ≥ 50cm), the map update mechanism is triggered, and the SLAM (Simultaneous Localization and Mapping) algorithm is used to fuse the positioning data with the semantic segmentation mask to generate a dynamically corrected boundary contour with correction accuracy at the centimeter level. When the robot performs a task, the current orientation is defined as the angle between the robot's movement direction and the X-axis of the map coordinate system, meeting the path planning requirements of mowing operations.

[0050] In a possible embodiment, the robot is a lawn mowing robot, the working surface is a lawn, and the working surface is located within the task area.

[0051] The robot's task area can be pre-defined by the user using virtual boundaries (such as Bluetooth beacons) or physical boundaries (such as flower beds and fences), or it can be a user-defined virtual boundary of a closed geometric shape. The training data for the semantic segmentation model for the grass working surface is images of common grass species at different growth stages, as well as interference factors such as weather. This ensures that the model's recognition accuracy for grass features is ≥95%.

[0052] Specifically, the robot's orientation in a grassy environment can proceed as follows: First, in the initial detection phase, after the charging station is activated, the robot first detects the continuity of the grass within 2 meters around the charging station through semantic segmentation. If the proportion of grass pixels within 1 meter in front is ≥90% and the distance to the mission area boundary is >1.5 meters, it will proceed straight in that direction; otherwise, it will rotate at a constant angular velocity, each rotation angle (for example, 45 degrees) to detect the new direction until a qualified driving path is found. When obstacles such as tree trunks (diameter ≥10cm) or sprinklers in the grass are detected, the robot will stop immediately and record the obstacle's position to the map's dynamic layer. At the same time, an obstacle avoidance path will be generated. The heading angle will be updated every 0.2 meters during the obstacle avoidance process, and the heading will be recalibrated after the obstacle avoidance is completed.

[0053] In a possible embodiment, before controlling the robot to perform linear motion, the method further includes the following steps: D1. Determining, based on data of the robot's surrounding environment, whether there is a working surface having a length not less than a first preset length in a first direction; wherein, if there is a working surface having a length not less than the first preset length in the first direction, then the first direction has a continuous working surface; D2. controlling the robot to perform linear motion, comprising: D3. When determining that a working surface has a length in a first direction that is not less than a first preset length, control the robot to perform linear motion in the first direction.

[0054] The first preset length is 1m, a threshold determined by the robot's motion speed and sensor response delay. When the robot is moving straight at 0.5m / s, a 1m detection distance provides a safe reaction time of 2s, ensuring timely stopping when encountering a non-working surface. Environmental data processing involves pixel-level classification of images captured by the visual sensor based on a semantic segmentation model. The 1m area ahead is divided into 10×10 grid cells. If the lawn grid accounts for ≥90%, it is determined to be a "continuous working surface of at least 1m in length."

[0055] In a possible embodiment, the method further includes: E1. If it is determined based on the data of the robot's surrounding environment that there are no continuous working surfaces in multiple directions around the robot, output a prompt message; E2. Alternatively, if it is determined based on the data of the robot's surrounding environment that there are no continuous working surfaces in multiple directions around the robot, a first distance between the robot and a boundary of a task area and a second distance between the robot and a boundary of a preset restricted area are determined; if both the first distance and the second distance are greater than preset values, the robot is controlled to perform linear motion in a direction where there is no continuous working surface.

[0056] The robot detects multiple directions in a sequence of preset angles as it rotates 360° in place. If any of these directions fail to meet the continuous working surface condition of "grass pixels within 1m ahead account for ≥90%," the robot issues an alarm and sends a message to the user, allowing them to take corrective action. The default value is 1.5m, and prompts are output via a flashing red LED on the robot body, a long buzzer, and a text alert (e.g., "Please move the robot to the center of the lawn to start") sent to the user terminal via Wi-Fi. When the robot is greater than 1.5m from both the mission area boundary and the preset restricted area boundary, it is allowed to proceed straight ahead, even if no continuous working surface is detected in the surrounding directions.

[0057] For example, consider a smart lawnmower robot starting in the center of a circular lawn (10m radius). When the robot rotates 360° to detect eight directions, it fails detection due to a leaf-covered stone slab in front of it (not in the lawn area). A prompt message is then displayed. The prompt includes the robot's current location coordinates and a suggested movement direction (e.g., "Please move 2m northeast") to facilitate precise operation. If the robot fails to find a continuous working surface after rotation detection, but the calculated first distance D1 = 3.0m (from the lawn boundary) and second distance D2 = 2.5m (from the flowerbed restricted area) are both greater than 1.5m, the robot is directed to move straight ahead. If a continuous lawn is detected after 0.5m, normal orientation processing is resumed. If no valid area is found after 1m, the robot stops and a prompt message is displayed to the user.

[0058] Step S330: During the linear motion, use the position tracking unit to track a plurality of positioning points passed by the robot.

[0059] The position tracking unit utilizes a multi-sensor fusion positioning solution, integrating GPS, RTK modules, and an inertial measurement unit (IMU). It achieves centimeter-level positioning using a Kalman filter algorithm. A fixed sampling frequency allows for accurate determination of subtle position changes during the robot's linear motion. The time interval between adjacent positioning points (e.g., 100ms) ensures trajectory smoothness. Tracking data, including 3D coordinates (X, Y, Z), timestamps, and estimated heading angles, is stored in real time.

[0060] With the above Figure 3 For consistent, see Figure 4 , Figure 4 : This is a flow chart of a method for automatically controlling the orientation of a robot on an obstacle avoidance or non-working surface provided by an embodiment of the present application. The method for automatically controlling the orientation of a robot includes the following specific steps: S410, while performing the linear motion in the first direction, detecting whether there is an obstacle or a non-working surface in front of the robot; S420: If there is an obstacle or a non-working surface in front of the robot, control the robot to stop moving and use the environment perception unit to collect environmental data in a third direction of the robot, and determine whether there is a continuous working surface in the third direction based on the environmental data in the third direction; S430: If there is a continuous working surface in the third direction, control the robot to perform the linear motion in the third direction.

[0061] Detection of obstacles or non-working surfaces ahead utilizes a semantic segmentation and depth information fusion strategy. The environmental perception unit's visual sensor captures forward images and, combined with a semantic segmentation model (such as DeepLabv3+), identifies non-working surfaces (e.g., concrete floors and flower beds). The vision module can integrate a lidar (LiDAR) to acquire 3D point cloud data within a range of 0.5-5 meters ahead, enabling more precise determination of the presence of obstacles or non-working surfaces. For example, consider a scenario where an intelligent lawnmower robot encounters an obstacle while traveling straight east at 0.4 m / s. The visual sensor detects a tree trunk (non-lawn area) 0.8 m ahead. The semantic segmentation model outputs a 95% non-lawn pixel ratio in this area. Simultaneously, the lidar measures the tree trunk's 3D coordinates. The robot's control unit then stops the robot. Upon receiving the stop signal, the drive unit uses both electromagnetic braking and reverse braking to bring the robot to a stop within 0.4 m. Then, the robot rotates 30° clockwise on the spot, and the environmental perception unit collects images of the new direction. The semantic segmentation shows that the lawn pixels within 1m in front account for 90% and the distance from the south boundary to 2.0m is greater than 1.5m. The robot then moves straight in the new direction at a speed of 0.3m / s. The position tracking unit records the trajectory in real time and calculates the new heading angle of 60° through adjacent positioning points.

[0062] Step S340: Determine the current orientation of the robot according to at least two of the multiple positioning points.

[0063] The orientation is determined based on two-dimensional plane vector calculation, which is defined as the angle between the robot's moving direction and the reference coordinate system (such as the north direction of the map). The positioning point sequence is determined, and the trajectory is fitted according to the positioning point sequence. After obtaining the fitted trajectory, the slope k of the straight line segment of the trajectory is solved. Furthermore, the trajectory direction vector is derived from the slope k. , towards θ is the vector The angle between the coordinate system and the X-axis is mapped to the range of 0° to 360° as the current orientation.

[0064] In a possible embodiment, determining the current orientation of the robot based on at least two of the multiple positioning points specifically includes the following steps: 341. Determine a moving direction of the robot when performing the linear motion according to the at least two positioning points; 342. Determine the moving direction as the current orientation of the robot.

[0065] The determination of the moving direction is based on two-dimensional plane vector analysis. First, trajectory fitting is performed on multiple positioning points. A longer straight line on the fitting trajectory is selected, and the slope k of the straight line is taken in the two-dimensional plane vector. Further, the trajectory direction vector is derived from the slope k. , towards θ is the vector The angle between the robot and the X-axis of the coordinate system is mapped to the range of 0° to 360°, corresponding to the instantaneous movement direction of the robot in linear motion. In addition, the calculation of the movement direction integrates multi-source data for error correction. The weighted average of the inertial measurement unit (IMU) and the positioning vector calculation results is used to suppress short-term positioning drift. By uniformly mapping the positioning point coordinates to the mission area coordinate system (with true north as the positive direction of the X-axis), an affine transformation is used to eliminate sensor installation deviations (for example, the offset between the RTK antenna and the center of the fuselage is ≤3cm) and dynamic threshold adjustment is performed to avoid direction calculation deviations caused by terrain fluctuations.

[0066] For easier understanding, see Figure 5 , Figure 5This is a flow chart illustrating another method for automatic orientation control of a robot, provided by an embodiment of the present application. As can be seen, the control program is first initialized and a map is loaded. The map contains information such as lawn work areas and restricted areas. When loading the map data, lightweight storage and fast parsing technologies are employed, enabling real-time access and dynamic updates. This ensures accurate spatial detection of the robot's work area and addresses orientation errors caused by missing or outdated map information. Next, the robot uses visual sensors to collect real-time environmental data. A semantic segmentation model is used to perform pixel-level classification of the captured images, distinguishing between lawn and non-lawn areas. The semantic segmentation model, trained with extensive lawn scene data, is robust to lighting variations and occlusion interference. The output binary segmentation results (1 for lawn and 0 for non-lawn) provide a basis for subsequent area status determination, addressing the complex visual environment and inefficient manual recognition, achieving automated and precise environmental classification. Based on the semantic segmentation results, the robot continuously monitors the state of the area directly in front of it, updating environmental information within a 1-meter range (safe operating distance) at a fixed time step. The sliding window algorithm fuses the segmentation results of consecutive frames, filtering out transient noise (such as misjudgments caused by fallen leaves and shadows) and outputting a stable judgment of whether the front is a continuous lawn. This ensures the reliability of the input data for the decision-making process and avoids erroneous instructions caused by single-frame image errors. The system also determines whether the area 1 meter in front of the robot is a continuous working surface. If the area 1 meter in front is a continuous lawn area, the robot enters normal operation mode, moving straight along the lawn area while simultaneously updating the status of the area in front in real time to ensure that the robot always moves within the effective working area. If the area 1 meter in front is not a continuous lawn area, the backup strategy of "the robot rotates once to identify a continuous lawn area" is triggered. Through a 360-degree full-scale environmental scan, it re-searches for a continuous lawn area that can be operated, thus resolving the problem of operation stagnation caused by local environmental obstacles.

[0067] After the robot completes 360° rotation recognition, it enters the secondary decision-making phase. First, the robot calculates the minimum distance from the boundary of the restricted area in the work area. If this minimum distance is greater than 1.5 meters, the robot is deemed to be in a safe position within the work area and executes the "go straight and complete automatic orientation" command. Using the continuous lawn direction obtained through rotation recognition, the robot replans its straight path and resumes operations. If this minimum distance is less than or equal to 1.5 meters, an error message is triggered, prompting the robot to move to the lawn or a charging station to start. This prevents the robot from performing incorrect actions due to proximity to restricted areas (such as flower bed edges or roads), potentially causing collisions or operational anomalies. Whether entering straight ahead through initial forward detection or resuming straight ahead after rotation recognition and safe distance determination, the robot operates in the "straight ahead along the lawn area, updating the status of the area ahead in real time" mode, continuing in a loop until the task is completed (e.g., the lawn mowing area meets the target, the battery is depleted), or manual intervention is required.

[0068] For easier understanding, see Figure 6 , Figure 6 This is a scene diagram of a method for automatic orientation control of a robot provided by an embodiment of the present application. Take a lawn mowing robot as an example: It can be seen that when the lawn mowing robot performs automatic orientation control operations in a lawn environment, the lawn mowing robot identifies the boundary through environmental perception (such as visual sensors, semantic segmentation models) to avoid crossing the boundary. For example, the lawn mowing robot is equipped with a visual sensor to collect the lawn environment image in the figure, and the semantic segmentation model is used to process it to distinguish between "continuous lawn" and "non-lawn area". According to the segmentation results output by the model. If the front of the robot is detected as "continuous lawn" (such as Figure 6 If the robot is positioned in the image (i.e., the grass area extending forward from the robot's position in the image), the "Go straight along the lawn area" command is triggered. The robot follows the directional control process, moving at a steady speed along the lawn texture while simultaneously updating the status of the area ahead to ensure that the working trajectory matches the lawn shape. If the area ahead is detected as "discontinuous lawn" due to sparse vegetation or boundary interference, the "Robot rotates one circle to identify continuous lawn areas" strategy is activated. Centered on the current position in the image, the robot rotates at a constant speed to scan the lawn environment within a 360° range. Using a semantic segmentation model, it identifies continuous lawn areas in all directions, providing multiple direction candidates for the secondary decision (distance boundary determination). After the robot completes the 360° rotation recognition, it calculates the "minimum distance to the boundary of the restricted area of ​​the work area" (the lawn boundary in this scenario). If the minimum distance is greater than 1.5 meters, the robot is determined to be in a safe lawn operation area and executes "straight travel and complete automatic orientation". The straight path is replanned using the continuous lawn direction obtained by rotation recognition (such as a grass area with dense vegetation and no boundary interference in the scene). If the minimum distance is ≤1.5 meters, the error reporting mechanism is triggered, prompting the robot to move to the inside of the lawn or start the charging station to avoid performing incorrect actions due to being close to the boundary (such as the lawn edge curve in the figure), which may cause collisions or abnormal operations.

[0069] For easier understanding, see Figure 7 , Figure 7 This is a scene diagram of another automatic orientation control method of a robot provided by an embodiment of the present application. Take a lawn mowing robot as an example: It can be seen that in Figure 7In the figure, the mowing robot is sequentially in "position 71," "position 72," and "position 73," forming the spatial sequence of the mowing robot's operation. At "position 71," the mowing robot activates its environmental perception module, using its visual sensors to collect data about the surrounding environment and ahead. It then uses a semantic segmentation model to identify a continuous working surface (i.e., a continuous lawn). If the recognition result indicates that the current direction is not a continuous lawn (e.g., there is a non-grass area ahead or boundary interference), the direction adjustment mechanism is triggered, and the mowing robot rotates a certain angle to identify a continuous working surface. If the recognition result indicates a continuous working surface (i.e., a continuous lawn), the mowing robot proceeds straight toward the continuous lawn area. For example, when going straight from "position 71" to "position 72", when the lawn mower robot is at position 72, it recognizes through the environmental perception module that there is no continuous lawn in front, and the lawn mower robot rotates around the body. During the rotation process, it recognizes whether there is a continuous lawn in the front area. If there is a continuous lawn, the lawn mower robot goes straight in the direction of the continuous lawn from position 72 to position 73. If it is detected again at position 73 that the current direction is a non-continuous lawn, the lawn mower robot rotates in place at position 73 to identify the continuous working surface, and the lawn mower robot goes straight towards the continuous lawn area.

[0070] As can be seen, by executing the above-mentioned robot automatic orientation control method provided in the embodiments of the present application, the environment perception unit is first used to collect data about the robot's surrounding environment. Then, the robot is controlled to perform linear motion, wherein the data guides the robot to perform the linear motion in the direction of a continuous work surface. During the linear motion, the position tracking unit is used to track multiple positioning points passed by the robot. Finally, based on at least two of the multiple positioning points, the robot's current orientation is determined. In this way, the robot uses semantic segmentation to identify lawn areas in real time. Combining the "straight-and-rotate" behavior strategy to achieve robot orientation estimation, it strictly constrains the robot to achieve orientation within the lawn area, thereby improving the safety and success rate of the robot's automatic orientation.

[0071] The above mainly introduces the solution of the embodiment of the present application from the perspective of the execution process of the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0072] The embodiment of the present application can divide the functional units of the electronic device according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0073] In the case of dividing each functional module into corresponding functional modules, Figure 8 8 is a block diagram of the functional modules of a robot provided in an embodiment of the present application. The robot 800 includes: Environmental sensing unit 810, used to collect environmental data; A position tracking unit 820 is used to locate the position of the robot; The control unit 830 is configured to determine a safe area that meets preset safe driving conditions based on the output of the environmental perception unit; control the movement mechanism to drive the robot to travel in a straight line within the safe area; record multiple positioning points reached by the robot in a storage device during the straight-line travel; and determine the current orientation of the robot based on at least two of the multiple positioning points. The body and the moving mechanism 840 are used to drive the body to move.

[0074] In a possible embodiment, the robot 800 is specifically used to: Using the environmental perception unit to collect data about the robot's surrounding environment; controlling the robot to perform linear motion, wherein the data guides the robot to perform the linear motion in a direction having a continuous working surface; During the linear motion, using the position tracking unit to track a plurality of positioning position points passed by the robot; The current orientation of the robot is determined according to at least two positioning points among the multiple positioning points.

[0075] In a possible embodiment, the control unit 830, in terms of using the environment perception unit to collect data about the robot's surrounding environment and controlling the robot to perform linear motion, is specifically configured to: Positioning the robot at a starting position, and using the environment perception unit to collect environment data in a first direction of the robot to obtain first environment data; determining whether there is a continuous working surface in the first direction according to the first environmental data; If there is a continuous working surface in the first direction, controlling the robot to perform the linear motion from the starting position to the first direction; If there is no continuous working surface in the first direction, using the environment perception unit to collect environment data in a second direction of the robot to obtain second environment data; the second direction is different from the first direction; If there is a continuous working surface in the second direction, the robot is controlled to perform the linear motion in the second direction.

[0076] In a possible embodiment, the control unit 830 is further configured to: The robot is controlled to rotate in place at the starting position so that the environment perception unit changes from being aligned with the first direction to being aligned with the second direction.

[0077] In a possible embodiment, the location tracking unit 820 is specifically configured to: The plurality of positioning position points are recorded in a storage device in the form of coordinates.

[0078] In a possible embodiment, the environment sensing unit 810 is further configured to: A map including the boundary of a task area is stored in a storage device of the robot. The map has a coordinate system direction. The robot performs a task in the task area, and the current orientation uses the coordinate system direction as a reference direction.

[0079] In a possible embodiment, the robot 800 is a lawn mowing robot, the working surface is a lawn, and the working surface is located within the task area.

[0080] In a possible embodiment, before controlling the robot to perform linear motion, the environment perception unit 810 is specifically configured to: Determining, based on data of the robot's surrounding environment, whether there is a working surface having a length not less than a first preset length in a first direction; wherein, if there is a working surface having a length not less than the first preset length in the first direction, then the first direction has a continuous working surface; The controlling the robot to perform linear motion comprises: When it is determined that the working surface has a length in the first direction that is not less than a first preset length, the robot is controlled to perform linear motion in the first direction.

[0081] In a possible embodiment, the environment sensing unit 810 is further configured to: If it is determined based on the data of the robot's surrounding environment that there is no continuous working surface in multiple directions around the robot, outputting a prompt message; Alternatively, if it is determined based on the data of the robot's surrounding environment that there are no continuous working surfaces in multiple directions around the robot, a first distance between the robot and the boundary of the task area and a second distance between the robot and the boundary of a preset restricted area are determined; if both the first distance and the second distance are greater than preset values, the robot is controlled to perform linear motion in the direction where there is no continuous working surface.

[0082] In a possible embodiment, the control unit 830 is specifically configured to: During the linear motion in the first direction, detecting whether there is an obstacle or a non-working surface in front of the robot; If there is an obstacle or a non-working surface in front of the robot, control the robot to stop moving and use the environmental perception unit to collect environmental data in a third direction of the robot, and determine whether there is a continuous working surface in the third direction according to the environmental data in the third direction; If there is a continuous working surface in the third direction, the robot is controlled to perform the linear motion in the third direction.

[0083] It should be noted that the specific function implementation of the robot 800 is shown in the above Figure 3 The description of the automatic orientation control method of a robot shown in the figure, for example, the body and the moving mechanism 840, and the position tracking unit 820 are used to implement the relevant content of executing S330, which will not be repeated. The various units or modules in the robot 800 can be individually or completely merged into one or several other units or modules to form a structure, or one (or some) of the units or modules can be further divided into multiple functionally smaller units or modules to form a structure, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units or modules are divided based on logical functions. In actual applications, the functions of one unit (or module) are implemented by multiple units (or modules), or the functions of multiple units (or modules) are implemented by one unit (or module).

[0084] It can be seen that the robot 800 described in the embodiment of the present application coordinates the operation of an environment perception unit 810, a position tracking unit 820, a control unit 830, a body and a mobile mechanism 840, and a storage device. The environment perception unit 810 includes a semantic segmentation module and at least one camera. The at least one camera is used to take a photo of the current orientation of the robot, input the photo into the semantic segmentation module, and determine a safe area that meets the preset safe driving conditions through the output of the environment perception unit; control the mobile mechanism to drive the body to drive in a straight line within the safe area. During the straight-line driving process, multiple positioning points reached by the robot are recorded in a storage device, and the current orientation of the robot is determined based on at least two of the multiple positioning points. This improves the safety and success rate of the robot's automatic orientation during the initialization phase of the positioning device or when recovering after positioning is lost.

[0085] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0086] The present application also provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may comprise an electronic device.

[0087] It should be noted that, for the above-mentioned various embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. Those skilled in the art should know that this application is not limited by the order of the actions described, because some steps in the embodiments of the present application can be performed in other orders or simultaneously. In addition, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions, steps, modules or units involved are not necessarily required by the embodiments of the present application.

[0088] In the above embodiments, the embodiments of the present application have different focuses on the description of each embodiment. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0089] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0090] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and storage medium can also exist as discrete components in the terminal device or the management device.

[0091] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part via software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. This computer program product comprises one or more computer instructions. When these computer program instructions are loaded and executed on a computer, they fully or partially produce the processes or functions described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0092] The modules / units included in the various devices and products described in the above embodiments may be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units. For example, for various devices and products applied to or integrated into a chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least part of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated into a chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least part of the modules / units may be It is implemented in the form of a software program, which runs on the processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal equipment, or at least some modules / units can be implemented in the form of a software program, which runs on the processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.

[0093] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only a specific implementation method of the embodiments of the present application and is not intended to limit the scope of protection of the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the scope of protection of the embodiments of the present application.

Claims

1. A method for automatic orientation of a robot, characterized in that: The robot includes an environment perception unit and a position tracking unit, and the method includes: Using the environmental perception unit to collect data about the robot's surrounding environment; controlling the robot to perform linear motion, wherein the data guides the robot to perform the linear motion in a direction having a continuous working surface; During the linear motion, using the position tracking unit to track a plurality of positioning position points passed by the robot; The current orientation of the robot is determined according to at least two positioning points among the multiple positioning points.

2. The method according to claim 1, wherein The step of using the environment perception unit to collect data about the robot's surrounding environment and controlling the robot to perform linear motion includes: Positioning the robot at a starting position, and using the environment perception unit to collect environment data in a first direction of the robot to obtain first environment data; determining whether there is a continuous working surface in the first direction according to the first environmental data; If there is a continuous working surface in the first direction, controlling the robot to perform the linear motion from the starting position to the first direction; If there is no continuous working surface in the first direction, using the environment perception unit to collect environment data in a second direction of the robot to obtain second environment data; the second direction is different from the first direction; If there is a continuous working surface in the second direction, the robot is controlled to perform the linear motion in the second direction.

3. The method according to claim 2, wherein The method further comprises: The robot is controlled to rotate in place at the starting position so that the environment perception unit changes from being aligned with the first direction to being aligned with the second direction.

4. The method according to any one of claims 1 to 3, wherein The method further comprises: The plurality of positioning position points are recorded in a storage device in the form of coordinates.

5. The method according to any one of claims 1 to 4, characterized in that A map including the boundary of a task area is stored in a storage device of the robot. The map has a coordinate system direction. The robot performs a task in the task area, and the current orientation uses the coordinate system direction as a reference direction.

6. The method according to claim 5, wherein The robot is a lawn mowing robot, the working surface is a lawn, and the working surface is located in the task area.

7. The method according to claim 1, wherein Before controlling the robot to perform linear motion, the method further includes: Determining, based on data of the robot's surrounding environment, whether there is a working surface having a length not less than a first preset length in a first direction; wherein, if there is a working surface having a length not less than the first preset length in the first direction, then the first direction has a continuous working surface; The controlling the robot to perform linear motion comprises: When it is determined that the working surface has a length in the first direction that is not less than a first preset length, the robot is controlled to perform linear motion in the first direction.

8. The method according to claim 1, wherein The method further comprises: If it is determined based on the data of the robot's surrounding environment that there is no continuous working surface in multiple directions around the robot, outputting a prompt message; Alternatively, if it is determined based on the data of the robot's surrounding environment that there are no continuous working surfaces in multiple directions around the robot, a first distance between the robot and the boundary of the task area and a second distance between the robot and the boundary of a preset restricted area are determined; if both the first distance and the second distance are greater than preset values, the robot is controlled to perform linear motion in the direction where there is no continuous working surface.

9. The method according to claim 1, wherein The method further comprises: During the linear motion in the first direction, detecting whether there is an obstacle or a non-working surface in front of the robot; If there is an obstacle or a non-working surface in front of the robot, control the robot to stop moving and use the environmental perception unit to collect environmental data in a third direction of the robot, and determine whether there is a continuous working surface in the third direction according to the environmental data in the third direction; If there is a continuous working surface in the third direction, the robot is controlled to perform the linear motion in the third direction.

10. The method according to claim 1, wherein The determining the current orientation of the robot according to at least two of the plurality of positioning points includes: Determining a moving direction of the robot when performing the linear motion according to the at least two positioning position points; The moving direction is determined as the current orientation of the robot.

11. A robot, characterized in that: include: A body and a moving mechanism, wherein the moving mechanism is used to drive the body to move; Environmental perception unit, used to collect environmental data; A position tracking unit, used to locate the position of the robot; Storage devices for storing data; a control unit configured to: determine a safe area that meets preset safe driving conditions based on the output of the environmental perception unit; control the movement mechanism to drive the body to travel in a straight line within the safe area; and record multiple positioning points reached by the robot in a storage device during the straight-line travel; The current orientation of the robot is determined according to at least two positioning points among the multiple positioning points.

12. A readable storage medium, characterized in that: The readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 10.