A method, related device and storage medium for a legged robot to avoid self-collision
By real-time update and applying repulsive force to control the inter-leg distance of the foot robot, the problem of leg collision of the robot under lateral disturbance is solved, and the travel stability is improved.
Patent Information
- Application Number
- CN202210102162.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-01-27
AI Technical Summary
In harsh working conditions, the foot-type robot may collide between the swinging legs and the supporting legs due to lateral disturbance, resulting in the robot being instable.
By updating the distance between the first leg and the second leg of the robot in real time, it is determined whether it is less than the preset distance, and if necessary, exert repulsion through the power module of the first leg to maintain a safe distance from the second leg to avoid collision.
It reduces the collision between the two legs during lateral disturbance of the robot, and improves stability during travel.
Smart Images

Figure CN114610017B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot control technology, and in particular, to a method for a legged robot to avoid self-collision, related devices, and storage media. Background Art
[0002] With the improvement of computer performance and the development of sensor technology, robot technology has been continuously improved, and various robots have gradually emerged in human life to help humans complete specific tasks. Compared with traditional wheeled robots and tracked robots, legged robots have the advantage of good obstacle-crossing performance, and their multi-degree-of-freedom leg-foot structure can cope with some relatively complex terrains.
[0003] A legged robot can be regarded as a traditional robotic arm with a floating base composed of multiple multi-link robotic arms. In the prior art, most of the foot landing point planning of legged robots adopts a one-step stable heuristic planning method of a capture point. This foot landing point planning method fully considers the contribution of the foot landing point to the stability of the fuselage. However, in some special harsh working conditions, such as being subjected to a strong lateral impact disturbance, there may be a problem of collision between the swinging leg and the supporting leg of the robot, which may directly lead to the instability of the robot. Summary of the Invention
[0004] This application provides a method for a legged robot to avoid self-collision, related devices, and storage media, which are used to reduce the occurrence of collision between two legs when the robot is subjected to lateral disturbance and improve the stability of the robot during the traveling process.
[0005] The first aspect of this application provides a method for a legged robot to avoid self-collision, including:
[0006] Updating the distance between the foot end of the first leg of the robot and the second leg;
[0007] Judging whether the distance is less than or equal to a first distance;
[0008] If so, applying a repulsive force to the first leg through the power module of the first leg, so that the distance between the foot end of the first leg and the second leg is greater than a second distance.
[0009] Optionally, the applying a repulsive force to the first leg through the power module of the first leg, so that the distance between the foot end of the first leg and the second leg is greater than a second distance includes:
[0010] Applying a repulsive force to the first leg through the power module of the first leg;
[0011] Calculating and judging whether the distance from a point on the current predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance;
[0012] If so, continue to apply a repulsive force to the first leg through the power module of the first leg until the distance from the point on the predicted trajectory of the foot end of the first leg to the second leg is greater than a second distance, so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
[0013] Optionally, applying a repulsive force to the first leg through the power module of the first leg includes:
[0014] Calculate the predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force according to the current predicted trajectory of the foot end of the first leg;
[0015] Calculate the target joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force according to the predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force, and the difference between the target joint angle and the predicted joint angle is less than a first preset value;
[0016] In the control period of applying the repulsive force, control the power modules corresponding to each joint of the first leg to apply a repulsive force to the first leg and adjust each joint of the first leg to the target joint angle.
[0017] Optionally, the relationship between the predicted position and the target position of the foot end of the first leg is shown by the following formula:
[0018] p1 = p0 + n||d1 - d||;
[0019] Wherein, n represents the cross product of the vector formed by the foot end speed vector of the first leg and the line connecting the foot end position of the second leg and the hip joint, p0 represents the predicted position, the predicted position is associated with the predicted joint angle, p1 represents the target position, the target position is associated with the target joint angle, d1 represents the first distance, and d represents the distance between the foot end of the first leg and the second leg.
[0020] Optionally, updating the distance between the foot end of the first leg and the second leg of the robot includes:
[0021] Determine a first target point according to the foot end of the first leg of the robot;
[0022] Determine a second target point according to the intersection point of the target plane passing through the foot end of the first leg and parallel to the robot body plane and the foot end of the second leg;
[0023] Update the distance between the first leg and the second leg according to the distance between the first target point and the second target point.
[0024] Optionally, before applying a repulsive force to the first leg through the power module of the first leg, the method further includes:
[0025] Determine whether the distance from a point on the currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to a second distance;
[0026] If so, apply a repulsive force to the first leg through the power module of the first leg.
[0027] A second aspect of the present application provides a device for a legged robot to avoid self-collision, including:
[0028] An update unit for updating the distance between the foot end of the first leg of the robot and the second leg;
[0029] A first judgment unit for judging whether the distance is less than or equal to a first distance;
[0030] A control unit for, when the judgment result of the first judgment unit is yes, applying a repulsive force to the first leg through the power module of the first leg, so that the distance between the foot end of the first leg and the second leg is greater than a second distance.
[0031] Optionally, the control unit includes:
[0032] A control module for applying a repulsive force to the first leg through the power module of the first leg;
[0033] A judgment module for calculating and judging whether the distance from a point on the currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to a second distance;
[0034] The control module is further configured to:
[0035] When the judgment result of the judgment module is yes, continue to apply a repulsive force to the first leg through the power module of the first leg until it is calculated that the distance from a point on the predicted trajectory of the foot end of the first leg to the second leg is greater than a second distance, so that the distance between the foot end of the first leg and the second leg is greater than a second distance.
[0036] Optionally, the control module is specifically configured to:
[0037] Calculate the predicted joint angles of the joints of the first leg corresponding to the control period of applying the repulsive force according to the currently predicted trajectory of the foot end of the first leg;
[0038] Calculate the target joint angles of the joints of the first leg corresponding to the control period of applying the repulsive force according to the predicted joint angles of the joints of the first leg corresponding to the control period of applying the repulsive force, and the difference between the target joint angle and the predicted joint angle is less than a first preset value;
[0039] In the control period of applying the repulsive force, control the power modules corresponding to the joints of the first leg to apply a repulsive force to the first leg, and adjust the joints of the first leg to the target joint angles.
[0040] Optionally, the relationship between the predicted position and the target position of the foot end of the first leg is shown by the following formula:
[0041] p1 = p0 + n||d1 - d||;
[0042] Wherein, n represents the cross product of the velocity vector of the foot end of the first leg and the vector formed by the connection line between the foot end position of the second leg and the hip joint, p represents the predicted position, the predicted position is associated with the predicted joint angle, p1 represents the target position, the target position is associated with the target joint angle, d1 represents the first distance, and d represents the distance between the foot end of the first leg and the second leg.
[0043] Optionally, the updating unit includes:
[0044] A first determination module, configured to determine a first target point according to the foot end of the first leg of the robot;
[0045] A second determination module, configured to determine a second target point according to the intersection point of the target plane passing through the foot end of the first leg and parallel to the body plane of the robot and the foot end of the second leg;
[0046] An updating module, configured to update the distance between the first leg and the second leg according to the distance between the first target point and the second target point.
[0047] Optionally, the device further includes:
[0048] A second judgment unit, configured to judge whether the distance from the point on the current predicted trajectory of the foot end of the first leg to the second leg is less than or equal to a second distance before applying a repulsive force to the first leg through the power module of the first leg;
[0049] If so, the control unit is further configured to: apply a repulsive force to the first leg through the power module of the first leg.
[0050] The third aspect of the present application provides a robot, and the robot includes:
[0051] A processor, a memory, an input-output unit, and a bus;
[0052] The processor is connected to the memory, the input-output unit, and the bus;
[0053] The memory stores a program, and the processor calls the program to execute the method for a legged robot to avoid self-collision in the first aspect and any optional one of the first aspect.
[0054] The fourth aspect of this application provides a computer-readable storage medium with a program stored thereon. When the program is executed on a computer, it executes the method for a legged robot to avoid self-collision in the first aspect and any optional one of the first aspect.
[0055] From the above technical solutions, it can be seen that this application has the following advantages:
[0056] By updating the distance between the first leg (swing leg) and the second leg (support leg) of the robot in real time, when it is detected that the distance between the first leg and the second leg of the robot is less than or equal to a preset first distance, a repulsive force is applied to the first leg through the power module of the first leg to achieve the purpose of repelling the first leg away from the second leg, thereby reducing the occurrence of collisions between the two legs when the robot is subjected to lateral disturbances and improving the stability of the robot during movement. Description of the Drawings
[0057] In order to more clearly illustrate the technical solutions in this application, the following will briefly introduce the drawings required for description in the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0058] Figure 1 It is a schematic diagram of the hardware structure and mechanical structure of the legged robot provided by this application;
[0059] Figure 2 It is a schematic flowchart of an embodiment of the method for a legged robot provided by this application to avoid self-collision;
[0060] Figure 3 It is a schematic diagram of the collision relationship between the swing leg and the support leg in the method for a legged robot provided by this application to avoid self-collision;
[0061] Figure 4 It is a schematic diagram of the first distance, second distance, and predicted trajectory in the method for a legged robot provided by this application to avoid self-collision;
[0062] Figure 5 It is a schematic flowchart of another embodiment of the method for a legged robot provided by this application to avoid self-collision;
[0063] Figure 6 It is a schematic diagram of the definition of the cross product;
[0064] Figure 7Vector schematic diagram of the first leg and the second leg in the device for preventing self-collision of the legged robot provided in this application;
[0065] Figure 8 Schematic structural diagram of an embodiment of the device for preventing self-collision of the legged robot provided in this application;
[0066] Figure 9 Schematic structural diagram of an embodiment of the robot provided in this application. Detailed implementation manners
[0067] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0068] It should be noted that for a method, related device, and storage medium for preventing self-collision of a legged robot provided in this application, the following will describe the hardware structure and mechanical structure of the robot provided in this application. In the subsequent description, suffixes such as "module", "component", or "unit" used to represent components are only for the convenience of describing the present invention, and they have no specific meaning in themselves. Therefore, "module", "component", or "unit" can be used interchangeably.
[0069] Please refer to Figure 1 , Figure 1 which is a schematic hardware structure diagram of the legged robot 100 according to one embodiment of the present invention. In the Figure 1 illustrated embodiment, the legged robot 100 includes a mechanical unit 101, a communication unit 102, a sensing unit 103, an interface unit 104, a storage unit 105, a control module 110, and a power supply 111. The various components of the legged robot 100 can be connected in any manner, including wired or wireless connections, etc. Those skilled in the art can understand that Figure 1 the specific structure of the legged robot 100 shown in
[0070] does not constitute a limitation to the legged robot 100. The legged robot 100 may include more or fewer components than those shown, and some components are not essential components of the legged robot 100 and can be omitted or combined according to needs without changing the essence of the invention. Figure 1 The following will specifically introduce each component of the legged robot 100 with reference to
[0071] The mechanical unit 101 is the hardware of the legged robot 100. As shown in Figure 1As shown, the mechanical unit 101 may include a drive board 1011, a motor 1012, and a mechanical structure 1013. In other specific embodiments, the mechanical structure 1013 may further include an extendable robotic arm, a rotatable head structure, a wagging tail structure, a load-carrying structure, a saddle structure, a camera structure, etc. It should be noted that each component module of the mechanical unit 101 can be one or multiple, and can be set according to specific circumstances. For example, for a bipedal robot, its legs can be 2, and each leg can be configured with 3 motors 1012, corresponding to 6 motors 1012. For a quadrupedal robot, its legs can be 4, and each leg can be configured with 3 motors 1012, corresponding to 12 motors 1012.
[0072] The communication unit 102 can be used for signal reception and transmission, and can also communicate with networks and other devices. For example, after receiving instruction information sent by a remote control or other legged robots 100 to move in a specific direction at a specific speed value according to a specific gait, it is transmitted to the control module 110 for processing. The communication unit 102 includes, for example, a WiFi module, a 4G module, a 5G module, a Bluetooth module, an infrared module, etc.
[0073] The sensing unit 103 is used to obtain information data about the environment around the legged robot 100 and monitor parameter data of each component inside the legged robot 100, and send them to the control module 110. The sensing unit 103 includes a variety of sensors, such as sensors for obtaining surrounding environment information: lidar (for remote object detection, distance determination, and / or speed value determination), millimeter-wave radar (for short-range object detection, distance determination, and / or speed value determination), cameras, infrared cameras, Global Navigation Satellite System (GNSS), etc. Sensors for monitoring each component inside the legged robot 100: Inertial Measurement Unit (IMU) (for measuring speed values, acceleration values, and angular velocity values), sole sensors (for monitoring the position of the sole contact point, sole posture, ground contact force magnitude and direction), temperature sensors (for detecting component temperature). Other sensors that the legged robot 100 can also be configured with, such as load sensors, touch sensors, motor angle sensors, torque sensors, etc., will not be elaborated here.
[0074] The interface unit 104 can be used to receive inputs from external devices (such as data information, power, etc.) and transmit the received inputs to one or more components within the legged robot 100, or can be used to output to external devices (such as data information, power, etc.). The interface unit 104 may include a power port, a data port (such as a USB port), a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, etc.
[0075] The storage unit 105 is used to store software programs and various data. The storage unit 105 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system program, a motion control program, an application program (such as a text editor), etc.; the data storage area may store the data generated during the use of the legged robot 100 (such as various sensing data obtained by the sensing unit 103, log file data), etc. In addition, the storage unit 105 may include a high-speed random access memory, and may also include a non-volatile memory, such as a disk memory, a flash memory, or other non-volatile solid-state memories.
[0076] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0077] The input unit 107 can be used to receive input numerical or character information. Specifically, the input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the touch operations of the user (such as the operations of the user using the palm, finger, or suitable accessory on or near the touch panel 1071), and drive the corresponding connected device according to a preset program. The touch panel 1071 may include two parts: a touch detection device 1073 and a touch controller 1074. Among them, the touch detection device 1073 detects the touch orientation of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller 1074; the touch controller 1074 receives the touch information from the touch detection device 1073, converts it into touch point coordinates, and then sends it to the control module 110, and can receive and execute the commands sent by the control module 110. In addition to the touch panel 1071, the input unit 107 may also include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a remote control operation handle, etc., and are not specifically limited here.
[0078] Further, the touch panel 1071 may cover the display panel 1061. After the touch panel 1071 detects a touch operation on or near it, it transmits the operation to the control module 110 to determine the type of touch event. Subsequently, the control module 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in Figure 1 , the touch panel 1071 and the display panel 1061 are implemented as two independent components to separately perform input and output functions, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement input and output functions, and specific implementation here is not limited.
[0079] The control module 110 is the control center of the legged robot 100. It uses various interfaces and circuits to connect all components of the entire legged robot 100. By running or executing software programs stored in the storage unit 105 and calling data stored in the storage unit 105, the control module 110 thus performs overall control of the legged robot 100.
[0080] The power supply 111 is used to supply power to each component. The power supply 111 may include a battery and a power control board, and the power control board is used to control functions such as battery charging, discharging, and power consumption management. In Figure 1 the illustrated embodiment, the power supply 111 is electrically connected to the control module 110. In other embodiments, the power supply 111 may also be electrically connected to the sensing unit 103 (such as cameras, radars, speakers, etc.) and the motor 1012 respectively. It should be noted that each component may be connected to different power supplies 111 or powered by the same power supply 111.
[0081] Based on the above embodiments, specifically, in some embodiments, a terminal device may be used to communicate with the legged robot 100. When the terminal device communicates with the legged robot 100, instruction information may be sent to the legged robot 100 through the terminal device. The legged robot 100 may receive the instruction information through the communication unit 102 and, in the case of receiving the instruction information, transmit the instruction information to the control module 110, so that the control module 110 can process the instruction information to obtain a target speed value. The terminal device includes but is not limited to: mobile phones with image capture functions, tablet computers, servers, personal computers, wearable smart devices, and other electrical devices.
[0082] Instruction information can be determined according to preset conditions. In one embodiment, the legged robot 100 may include a sensing unit 103, and the sensing unit 103 can generate instruction information according to the current environment where the legged robot 100 is located. The control module 110 can judge whether the current speed value of the legged robot 100 meets the corresponding preset conditions according to the instruction information. If it is satisfied, the current speed value and the current gait of the legged robot 100 will be maintained for movement; if it is not satisfied, the target speed value and the corresponding target gait will be determined according to the corresponding preset conditions, so as to control the legged robot 100 to move at the target speed value and the corresponding target gait. The environmental sensor may include a temperature sensor, a barometric pressure sensor, a vision sensor, and a sound sensor. The instruction information may include temperature information, barometric pressure information, image information, and sound information. The communication method between the environmental sensor and the control module 110 may be wired communication or wireless communication. The wireless communication methods include but are not limited to: wireless network, mobile communication network (3G, 4G, 5G, etc.), Bluetooth, and infrared.
[0083] The above describes the hardware structure and mechanical structure of the legged robot provided by the present application. Next, the method for the legged robot provided by the present application to avoid self-collision will be described.
[0084] The present application provides a method, a related device, and a storage medium for a legged robot to avoid self-collision, which are used to reduce the occurrence of collisions between two legs when the robot is subjected to lateral disturbances and improve the stability of the robot during movement.
[0085] Please refer to Figure 2 , Figure 2 This is an embodiment of the method for a legged robot provided by the present application to avoid self-collision. The method includes:
[0086] 201. Update the distance between the foot end of the first leg of the robot and the second leg;
[0087] The legged robot has a leg-foot structure with multiple degrees of freedom, enabling it to cope with some relatively complex terrains. The legged robot has forms such as biped, tripod, quadruped, hexapod, and octopod. The walking mechanism of the legged robot is a spatial link mechanism. Each leg has 3 joints respectively, equivalent to the hip joint, knee joint, and wrist joint of a human. The three power modules at the connection between the robot's leg and body can coordinate to achieve the movement of a leg within multiple degrees of freedom in space. Multiple legs working together can achieve walking.
[0088] During the walking process of the legged robot, the walking mechanism always satisfies the static balance condition of statics. The leg supporting on the ground is the supporting leg, and the leg in the suspended state is the swinging leg. However, in some special harsh working conditions, such as being subjected to a severe lateral impact disturbance, such as Figure 3As shown, taking a pair of legs of a quadruped robot as an example, after being subjected to a lateral impact disturbance, the swinging leg that enters the suspended state hits towards the supporting leg, that is, it moves along the swinging trajectory in Figure 3 and at this time, there may be a problem of mutual collision between the swinging leg and the supporting leg of the robot, which will directly cause the robot to become unstable or even fall.
[0089] To avoid the problem of self-collision of the legs of the legged robot, the control unit of the robot needs to update the distance between the foot end of the first leg and the second leg in real time during the movement. It should be noted that in this application, the first leg refers to the leg in the swinging state, and the second leg refers to the leg in the supporting state. The update frequency can be once every control cycle or once every multiple control cycles, and specific details are not limited here. The control cycle refers to the motion control cycle of the robot, and the control cycle of the robot is a very short time period, generally between 0.001 seconds and 0.003 seconds, preferably 0.002 seconds.
[0090] In the robot coordinate system, the distances of each point on the robot's leg relative to the robot's center of mass are all obtainable by the control unit, that is, the coordinates of each point on the robot's leg can be determined in the robot coordinate system defined with the robot's center of mass as the origin. Further, when updating the distance d between the foot end of the first leg and the second leg, one end point of the distance d can be the center point of the foot end of the first leg, or any point on the surface of the foot end of the first leg; and the other end point of the distance d can be any point on the second leg. For example, the other end point of the distance d is determined by the point on the second leg closest to the foot end of the first leg, or the intersection point of the section passing through the foot end of the first leg or the section of the moving direction passing through the foot end of the first leg and the second leg can be used to determine the other end point of the distance d. The selection of the end points of the distance d can be on the robot's skeleton or on the skin set on the surface of the robot's skeleton, and specific details are not limited here.
[0091] 202. Determine whether the distance is less than or equal to the first distance. If so, execute step 203;
[0092] The control unit of the robot determines whether the distance d from the foot end of the first leg to the second leg is less than or equal to the first distance d1 according to the obtained distance d. The first distance d1 is an artificially defined "safe distance". When the distance d from the foot end of the first leg of the robot to the second leg is less than or equal to the first distance d1, there may be a self-collision of the legs, and at this time, certain intervention can be carried out to prevent the self-collision from occurring.
[0093] When the control unit determines that the distance d between the foot end of the first leg and the second leg is less than or equal to the first distance d1, at this time the distance from the foot end of the first leg to the second leg is relatively close, and there may be a situation of leg self-collision. At this time, step 203 is executed to start the obstacle avoidance algorithm to control the distance d between the foot end of the first leg and the second leg to avoid self-collision.
[0094] 203. Apply a repulsive force to the first leg through the power module of the first leg so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
[0095] When the control unit determines that the distance d between the foot end of the first leg and the second leg is less than the first distance d1, the obstacle avoidance algorithm is started to control the foot end of the first leg to move away from the second leg. Specifically, a repulsive force can be applied to the first leg through the power module on the first leg so that the distance d between the foot end of the first leg and the second leg is greater than the second distance d2, thereby ensuring that no collision occurs between the two.
[0096] This second distance d2 is a "dangerous distance" defined artificially. This second distance can be 5 cm, 1 cm, or even infinitesimal. Specifically, it is not limited here. As Figure 4 shown, this second distance d2 is less than the first distance d1 and is the minimum distance to ensure that the robot does not have leg self-collision. When the distance d between the foot end of the first leg and the second leg is less than or equal to the first distance d1, self-collision may occur. However, due to inertia, the first leg may continue to move in the direction closer to the second leg. And when the distance d is less than or equal to the second distance d2, self-collision will occur or the risk of self-collision will greatly increase. Therefore, intervention is required when the distance between the two is less than or equal to the first distance d1 to ensure that the distance d is greater than the second distance d2 to avoid self-collision.
[0097] The values of the first distance d1 and the second distance d2 need to be specifically set according to the distance between the first leg and the second leg of different robots. If the distance between the two legs is farther apart, the values of the first distance and the second distance will be correspondingly larger. If the distance between the two legs is relatively close, the values of the first distance and the second distance will be correspondingly smaller.
[0098] In some specific embodiments, this repulsive force is a virtual repulsive force. Specifically, an artificial potential field can be set, and the second leg is set as an obstacle in the artificial potential field so that the first leg is repelled by the second leg during movement, thereby avoiding collision.
[0099] In this embodiment, by updating the distance between the first leg and the second leg of the robot in real time, when it is detected that the distance between the first leg and the second leg of the robot is less than or equal to a preset first distance, a repulsive force is applied to the first leg through the power module of the first leg, so as to achieve the purpose of repelling the first leg away from the second leg, thereby reducing the occurrence of collisions between the two legs when the robot is subjected to lateral disturbances and improving the stability of the robot during the traveling process.
[0100] Please refer to Figure 5 , Figure 5 which is another embodiment of the method for preventing self-collision of the legged robot provided by this application. The method includes:
[0101] 501. Update the distance between the foot end of the first leg of the robot and the second leg;
[0102] In this embodiment, step 501 is similar to step 201 in the foregoing embodiment, and will not be elaborated here.
[0103] In this embodiment, for the determination of the distance d between the foot end of the first leg of the robot and the second leg, it is preferably to use the foot end of the first leg of the robot as the first target point, and use the intersection point of the target plane passing through the foot end of the first leg and parallel to the robot body plane and the second leg as the second target point. The distance between the first target point and the second target point is used to describe the distance d between the foot end of the first leg of the robot and the second leg.
[0104] Further, the control unit of the robot can obtain the joint angles of each leg of the current robot. For example, it is obtained that the joint space configuration of the first leg is q = [θ1 θ2 θ3]. Where θ1, θ2, and θ3 respectively represent the joint angles of each joint of the first leg, and the three joint angles jointly determine the coordinates (x, y, z) of the foot end of the first leg in the Cartesian coordinate system. Therefore, the control unit can determine the coordinates A(x1, y1, z1) of the foot end of the first leg (the first target point) in the robot coordinate system defined with the robot centroid as the origin by calculating the joint angles of each joint of the current first leg of the robot, and then determine the coordinates B(x2, y2, z2) of the intersection point (the second target point) of the target plane passing through the foot end of the first leg and parallel to the body plane and the second leg, and determine the distance from point A to point B, so as to determine the distance d from the foot end of the first leg to the second leg.
[0105] 502. Determine whether the distance is less than or equal to the first distance. If so, execute step 503;
[0106] In this embodiment, step 502 is similar to step 202 in the foregoing embodiment, and will not be elaborated here.
[0107] It should be noted that if the distance from the foot end of the first leg to the second leg is greater than the first distance, the control unit controls the first leg to swing according to the pre-planned trajectory, and step 501 can be continued.
[0108] 503. Apply a repulsive force to the first leg through the power module of the first leg;
[0109] When the control unit determines that the distance d from the foot end of the first leg to the second leg is less than the first distance d1, the obstacle avoidance algorithm is started to control the foot end of the first leg to move away from the second leg. Specifically, a repulsive force can be applied to the first leg through the power module on the first leg, so that the foot end of the first leg moves in a direction away from the second leg, so as to ensure that no collision occurs between the two.
[0110] The process of applying a repulsive force to the first leg through the power module of the first leg in this embodiment is described in detail below:
[0111] 1) Calculate the predicted joint angles of each joint of the first leg in the control period of applying the repulsive force according to the current predicted trajectory of the foot end of the first leg;
[0112] When the distance from the foot end of the first leg to the second leg is less than or equal to the first distance, the control unit obtains the predicted trajectory of the foot end of the first leg. This predicted trajectory refers to the trajectory of the foot end of the first leg of the robot in the next period of time, that is, the trajectory after being subjected to lateral impact or other interference conditions, or the trajectory after the obstacle avoidance algorithm is started. The control unit calculates the position of the foot end of the first leg in the control period of applying the repulsive force according to this predicted trajectory, and can inversely calculate the joint angles of each joint of the first leg in the control period of applying the repulsive force, that is, the predicted joint angles in this application.
[0113] 2) Calculate the target joint angles of each joint of the first leg in the control period of applying the repulsive force according to the predicted joint angles of each joint of the first leg in the control period of applying the repulsive force, and the difference between the target joint angle and the predicted joint angle is less than the first preset value;
[0114] The control unit calculates the target joint angles corresponding to the control period of applying the repulsive force according to the calculated predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force. In fact, the control unit solves the target joint angles of the next control period according to the predicted joint angles of the next control period, and then controls according to the solved target joint angles.
[0115] To avoid self-collision by keeping the foot end of the first leg away from the second leg, a repulsive force needs to be applied to the foot end of the first leg in a direction away from the second leg. Therefore, the collision avoidance algorithm is converted to finding the minimum distance d between the coordinates A(x1, y1, z1) of the foot end of the first leg and the coordinates B(x2, y2, z2) of the second leg in the same plane, while minimizing the trajectory mutation of the first leg. This can be described as:
[0116] Min||q - q d || (1)
[0117] subject to d||AB|| > d2 (2)
[0118] where q d represents the predicted joint angle corresponding to the next control period t in the predicted trajectory, q is the new target joint angle at time t after adjusting q k+1 (1) represents that the adjusted target joint angle q (i.e., the target joint position to be solved) and the predicted joint angle at the same time should have the minimum deviation to prevent impact caused by sudden changes in joint position. (2) represents that the distance d between the foot end position A corresponding to the adjusted target joint angle q d and the point B on the second leg should be greater than the second distance d2, so as to ensure that the supporting leg and the swinging leg do not collide while minimizing the change in joints. k+1 d Obviously, the minimum value of equation (1) is 0, that is, no adjustment is made to the joint angle, but this does not meet the requirement that the foot end of the first leg of the robot does not self-collide. Therefore, equation (2) needs to be used as a constraint condition for solving equation (1), that is, the distance between the foot end coordinate position A formed by the target joint angle of the first leg described by q d and the current second leg coordinate B is always greater than the second distance d2.
[0119]
[0120]
[0121] In some specific embodiments, when calculating the target joint angle, the difference between the calculated target joint angle and the corresponding predicted joint angle can be restricted to be less than a first preset value, so as to limit the change in joint position within a small range, thereby avoiding the impact caused by sudden changes in joint position.
[0122] 3) During the control period when repulsive force is applied, control the power modules corresponding to the joints of the first leg, apply repulsive force to the first leg, and adjust the joints of the first leg to the target joint angle.
[0122] When the distance d between the end of the first leg and the second leg is less than the first distance d1, the first leg is subject to a virtual repulsive force. Specifically, by applying a repulsive force to the first leg, the joints of the first leg are adjusted to the calculated target joint angles. Under the action of this repulsive force, the first leg is pushed in the direction away from the collision (the n direction in the following formula).
[0123] p1 = p0 + n||d1 - d|| (3)
[0124] Where n represents the cross product of the vector of the end velocity of the first leg and the vector formed by the connection line between the end of the second leg and the hip joint. The definition of the cross product is as Figure 6 shown, where OC represents the cross product of vector OA and vector OB. OC must be perpendicular to the plane formed by vector OA and vector OB. When calculating, choosing the connection line between the end of the second leg and the hip joint, that is, the joint that drives the thigh of the second leg, as the vector can better fit the current state of the second leg and is closer to the actual working conditions. p0 represents the predicted position of the first leg at the next moment in the predicted trajectory, that is, the end position determined by the predicted joint angles. p1 represents the target position of the end modified based on p0, that is, the end position determined by the target joint angles, which is A in formula (2). d1 represents the first distance, and d represents the distance from the end of the first leg to the second leg.
[0125] As Figure 7 shown, when the first leg swings to the OA position and has a velocity V along the tangent direction of the trajectory, and the distance between the end of the first leg and the second leg is less than the first distance, the obstacle avoidance algorithm is activated, so that the joint position of the first leg at the next moment is q (the target joint position), thereby modifying the end coordinate from p0 to p1, which can avoid the problem that the swinging leg cannot swing due to directly pushing the swinging leg in the opposite direction of its velocity.
[0126] 504. Calculate and determine whether the distance from the point on the current predicted trajectory of the end of the first leg to the second leg is less than or equal to the second distance. If so, execute step 505;
[0127] In this embodiment, during the process of the control unit applying a repulsive force to the first leg through the power module of the first leg, it is also necessary to continuously calculate the distance from the point on the predicted trajectory of the end of the first leg to the second leg, and then determine whether this distance is less than or equal to the second distance. If the distance from the point on the predicted trajectory of the end of the first leg to the second leg is less than or equal to the second distance, such as Figure 4 the predicted trajectory a shown, it means that if the end of the first leg moves along the current predicted trajectory, it will hit the second leg. At this time, it is necessary to execute step 504 and continue to apply a repulsive force to the first leg. If the distance from the point on the current predicted trajectory of the end of the first leg to the second leg is greater than the second distance, such as Figure 4If the predicted trajectory b shown in the figure is obtained, it indicates that the foot end of the first leg moving along the current predicted trajectory will not collide with the second leg. At this time, the repulsive force applied to the first leg can be stopped, and step 501 can be executed again.
[0128] It should be noted that the predicted trajectory refers to the trajectory of the foot end of the first leg in the next period of time. This predicted trajectory will change continuously with the application of the repulsive force. What the control unit needs to calculate and judge is the distance from the point on the predicted trajectory at the current moment or control cycle to the second leg. The second distance d2 is a "dangerous distance" defined artificially. The second distance can be 5 cm, 1 cm, or even infinitesimal. Specifically, it is not limited here. As Figure 4 shown in the figure, the second distance d2 is less than the first distance d1, which is the minimum distance to ensure that the robot does not have self-collision of legs. When the distance d from the foot end of the first leg to the second leg is less than or equal to the first distance d1, self-collision may occur. However, due to inertia, the first leg may still continue to move in the direction closer to the second leg. When the distance d is less than or equal to the second distance d2, self-collision will occur or the risk of self-collision will increase significantly. Therefore, intervention is required when the distance between the two is less than or equal to the first distance d1 to ensure that the distance d is greater than the second distance d2, so as to avoid self-collision.
[0129] 505. Continue to apply a repulsive force to the first leg through the power module of the first leg until it is calculated that the distance from the point on the predicted trajectory of the foot end of the first leg to the second leg is greater than the second distance, so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
[0130] If the distance from the point on the predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance, as Figure 4 shown by the predicted trajectory a in the figure, it indicates that a collision may occur. At this time, a repulsive force needs to be continuously applied to the first leg until the distance from the point on the predicted trajectory of the foot end of the first leg to the second leg is greater than the second distance, as Figure 4 shown by the predicted trajectory b in the figure, to ensure that the distance between the foot end of the first leg and the second leg is greater than the second distance in the next period of time, so that the foot end of the first leg will not collide with the second leg.
[0131] Further, before applying a repulsive force to the first leg in step 503 of this embodiment, it is also possible to combine and determine whether the distance from the point on the currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to a second distance. Only when both the distance from the foot end of the first leg to the second leg is less than or equal to a first distance and the distance from the point on the currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance are steps 503 and subsequent steps executed to start the obstacle avoidance algorithm to apply a repulsive force to the first leg. When any of the above conditions is not satisfied, it is not started, so that the obstacle avoidance algorithm is started only at a necessary moment and does not intervene in some cases with less lateral disturbance, ensuring the stable operation of the robot.
[0132] In this embodiment, by updating the distance between the first leg (swinging leg) and the second leg (support leg) of the robot in real time, when it is detected that the distance between the first leg and the second leg of the robot is less than or equal to a preset first distance, a repulsive force is applied to the first leg through the power module of the first leg to achieve the purpose of repelling the first leg away from the second leg. At the same time, when controlling the foot end of the first leg to avoid the second leg, the predicted trajectory of the foot end of the first leg is considered to ensure that the distance between the points in the predicted trajectory and the second leg is greater than the second distance. In the case where the joint change is minimized, that is, the trajectory mutation of the first leg is minimized, it is ensured that the first leg and the second leg do not collide. Thereby reducing the occurrence of collisions between the two legs of the robot when it is subjected to lateral disturbances and improving the stability of the robot during movement.
[0133] Please refer to Figure 8 , Figure 8 which is an embodiment of the device for a legged robot provided by this application to avoid self-collision. The device includes:
[0134] An updating unit 801 for updating the distance between the foot end of the first leg of the robot and the second leg;
[0135] A first judgment unit 802 for judging whether the distance is less than or equal to a first distance;
[0136] A control unit 803 for, when the judgment result of the first judgment unit 802 is yes, applying a repulsive force to the first leg through the power module of the first leg so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
[0137] Optionally, the control unit 803 includes:
[0138] A control module 8031 for applying a repulsive force to the first leg through the power module of the first leg;
[0139] A judgment module 8032 for calculating and judging whether the distance from the point on the currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance;
[0140] The control module 8031 is further configured to:
[0141] When the judgment result of the judgment module 8032 is yes, continue to apply a repulsive force to the first leg through the power module of the first leg until the distance from the point on the predicted trajectory of the foot end of the first leg to the second leg is greater than the second distance, so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
[0142] Optionally, the control module 8031 is specifically configured to:
[0143] Calculate the predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force according to the current predicted trajectory of the foot end of the first leg;
[0144] Calculate the target joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force according to the predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force, and the difference between the target joint angle and the predicted joint angle is less than the first preset value;
[0145] During the control period of applying the repulsive force, control the power modules corresponding to each joint of the first leg to apply a repulsive force to the first leg and adjust each joint of the first leg to the target joint angle.
[0146] Optionally, the relationship between the predicted position and the target position of the foot end of the first leg is shown by the following formula:
[0147] p1 = p0 + n||d1 - d||;
[0148] Wherein, n represents the cross product of the foot end velocity vector of the first leg and the vector formed by the connection line between the foot end position of the second leg and the hip joint, p0 represents the predicted position, the predicted position is associated with the predicted joint angle, p1 represents the target position, the target position is associated with the target joint angle, d1 represents the first distance, and d represents the distance between the foot end of the first leg and the second leg.
[0149] Optionally, the update unit 801 includes:
[0150] The first determination module 8011 is configured to determine a first target point according to the foot end of the first leg of the robot;
[0151] The second determination module 8012 is configured to determine a second target point according to the intersection point of the target plane passing through the foot end of the first leg and parallel to the robot body plane and the foot end of the second leg;
[0152] The update module 8013 is configured to update the distance between the first leg and the second leg according to the distance between the first target point and the second target point.
[0153] Optionally, the device further includes:
[0154] The second determination unit 804 is configured to determine whether the distance from a point on the currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance before applying a repulsive force to the first leg through the power module of the first leg;
[0155] If so, the control unit 803 is further configured to: apply a repulsive force to the first leg through the power module of the first leg.
[0156] In the device of this embodiment, the functions of each unit correspond to the steps in the foregoing Figure 2 or Figure 5 method embodiment shown, and will not be elaborated here.
[0157] This application also provides a robot. Please refer to Figure 9 , Figure 9 which is an embodiment of the robot provided by this application. The robot includes:
[0158] a processor 901, a memory 902, an input / output unit 903, and a bus 904;
[0159] The processor 901 is connected to the memory 902, the input / output unit 903, and the bus 904;
[0160] The memory 902 stores a program, and the processor 901 calls the program to execute any of the methods for a legged robot to avoid self-collision as described above.
[0161] This application also relates to a computer-readable storage medium on which a program is stored. When the program runs on a computer, the computer is caused to execute any of the methods for a legged robot to avoid self-collision as described above.
[0162] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated here.
[0163] In several embodiments provided by this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be in electrical, mechanical, or other forms.
[0164] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in various embodiments of the present application may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0166] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, read-only memory), random access memories (RAM, random access memory), magnetic disks, or optical discs that can store program codes.
Claims
1. A method for a legged robot to avoid self-collision, characterized in that, The method includes: Updating the distance between the foot end of the first leg of the robot and the second leg, where the first leg is the leg in the swinging state and the second leg is the leg in the supporting state; Judging whether the distance is less than or equal to a first distance, where the first distance is a preset safety distance; If so, applying a repulsive force to the first leg through the power module of the first leg, so that the distance between the foot end of the first leg and the second leg is greater than a second distance, and the second distance is less than the first distance.
2. The method according to claim 1, characterized in that, The applying a repulsive force to the first leg through the power module of the first leg, so that the distance between the foot end of the first leg and the second leg is greater than a second distance, includes: Applying a repulsive force to the first leg through the power module of the first leg; Calculating and judging whether the distance from a point on the current predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance; If so, continuing to apply a repulsive force to the first leg through the power module of the first leg until it is calculated that the distance from a point on the predicted trajectory of the foot end of the first leg to the second leg is greater than the second distance, so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
3. The method according to any one of claims 1 or 2, characterized in that, The applying a repulsive force to the first leg through the power module of the first leg includes: Calculating the predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force according to the current predicted trajectory of the foot end of the first leg; Calculating the target joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force according to the predicted joint angles of each joint of the first leg corresponding to the control period of applying the repulsive force, and the difference between the target joint angle and the predicted joint angle is less than a first preset value; In the control period of applying the repulsive force, controlling the power modules corresponding to each joint of the first leg to apply a repulsive force to the first leg and adjusting each joint of the first leg to the target joint angle.
4. The method according to claim 3, characterized in that, The relationship between the predicted position and the target position of the foot end of the first leg is shown by the following formula: p1 = p0 + n||d1 - d||; Wherein, n represents the cross product of the vector formed by the foot end speed vector of the first leg and the line connecting the foot end position of the second leg and the hip joint, p0 represents the predicted position, the predicted position is associated with the predicted joint angle, p1 represents the target position, the target position is associated with the target joint angle, d1 represents the first distance, and d represents the distance between the foot end of the first leg and the second leg.
5. The method according to claim 1, wherein The updating the distance between the foot end of the first leg of the robot and the second leg includes: Determining a first target point according to the foot end of the first leg of the robot; Determining a second target point according to the intersection point of the target plane passing through the foot end of the first leg and parallel to the fuselage plane of the robot and the foot end of the second leg; Updating the distance between the first leg and the second leg according to the distance between the first target point and the second target point.
6. The method according to claim 1, wherein Before applying a repulsive force to the first leg through the power module of the first leg, the method further includes: Judging whether the distance from a point on the current predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance; If so, a repulsive force is applied to the first leg through the power module of the first leg.
7. An apparatus for preventing self-collision of a legged robot, characterized in that, The device includes: An updating unit configured to update the distance between the foot end of the first leg of the robot and the second leg, where the first leg is the leg in the swinging state and the second leg is the leg in the supporting state; A first judging unit configured to judge whether the distance is less than or equal to a first distance, where the first distance is a preset safety distance; A control unit configured to, when the judgment result of the first judging unit is yes, apply a repulsive force to the first leg through the power module of the first leg, so that the distance between the foot end of the first leg and the second leg is greater than a second distance, and the second distance is less than the first distance.
8. The device according to claim 7, characterized in that, The control unit includes: A control module configured to apply a repulsive force to the first leg through the power module of the first leg; A judging module configured to calculate and judge whether the distance from a point on the current predicted trajectory of the foot end of the first leg to the second leg is less than or equal to the second distance; The control module is further configured to: When the judgment result of the judging module is yes, continue to apply a repulsive force to the first leg through the power module of the first leg until it is calculated that the distance from a point on the predicted trajectory of the foot end of the first leg to the second leg is greater than the second distance, so that the distance between the foot end of the first leg and the second leg is greater than the second distance.
9. The device according to claim 8, characterized in that, Specifically, the control module is configured to: Calculate the predicted joint angles of the joints of the first leg corresponding to the control period of applying the repulsive force according to the current predicted trajectory of the foot end of the first leg; Calculate the target joint angles of the joints of the first leg corresponding to the control period of applying the repulsive force according to the predicted joint angles of the joints of the first leg corresponding to the control period of applying the repulsive force, and the difference between the target joint angle and the predicted joint angle is less than a first preset value; During the control period of applying the repulsive force, control the power modules corresponding to the joints of the first leg to apply a repulsive force to the first leg and adjust the joints of the first leg to the target joint angles.
10. The device according to claim 9, characterized in that, The relationship between the predicted position and the target position of the foot end of the first leg is shown by the following formula: p1 = p0 + n||d1 - d||; where n represents the cross product of the vector formed by the foot end velocity vector of the first leg and the line connecting the foot end position of the second leg and the hip joint, p0 represents the predicted position, the predicted position is associated with the predicted joint angle, p1 represents the target position, the target position is associated with the target joint angle, d1 represents the first distance, and d represents the distance between the foot end of the first leg and the second leg.
11. The device according to claim 7, characterized in that, The updating unit includes: A first determining module configured to determine a first target point according to the foot end of the first leg of the robot; A second determining module configured to determine a second target point according to the intersection point of the target plane passing through the foot end of the first leg and parallel to the fuselage plane of the robot and the foot end of the second leg; An updating module configured to update the distance between the first leg and the second leg according to the distance between the first target point and the second target point.
12. The device according to claim 7, characterized in that, The device further includes: A second determination unit, configured to determine whether a distance from a point on a currently predicted trajectory of the foot end of the first leg to the second leg is less than or equal to a second distance before applying a repulsive force to the first leg through the power module of the first leg; If so, the control unit is further configured to: apply a repulsive force to the first leg through the power module of the first leg.
13. A robot, characterized in that, The robot includes: a processor, a memory, an input / output unit, and a bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Collisionless motion planning method for curve forming of outer board of ship body based on double mechanical arms
CN111469129A