Differential robot control method and related device
By obtaining the position, determining the vector and adjusting the orientation in the differential robot, linear path control is achieved, and computing power occupation and real-time reduction caused by deviations in the prior art is solved, and the stability and speed of navigation are improved.
Patent Information
- Application Number
- CN202411086517.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing differential robot control method needs to be continuously calculated when there is a deviation between the robot's execution of the action and the calculated action, resulting in the problem of decreasing computing power and real-time performance.
By obtaining the starting point and end position of the differential robot, the first vector is determined and the robot is rotated in situ, so that its direction is consistent with the first vector, and then travels to the end point in the direction of the first vector at a preset linear speed and arrives at the end point. After the end point, adjust the angle to coincide with the end point to achieve straight line path control.
Simplifies the control process, reduces the amount of calculation, improves real-time and navigation stability, can quickly deal with obstacles and maintain path certainty.
Smart Images

Figure CN119002486A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automatic control technology, and in particular to a differential robot control method and related devices. Background Art
[0002] With the continuous update and iteration of current autonomous mobile robot technology, the robot control algorithm, as the core part that directly acts on the mobile carrier, has been deeply studied by many scholars. The movement of the differential mobile robot is achieved by controlling the speed difference of the two wheels. When the speeds of the two wheels are the same, the robot moves in a straight line; when there is a difference in the speed of the left and right wheels of the robot, the robot moves in a curve.
[0003] like Figure 1 As shown, a conventional differential mobile robot consists of two driving wheels and a universal wheel. The universal wheel only serves as a support in the structure of the differential mobile robot and does not participate in the actual robot control. The above control method usually uses a path planning algorithm to plan a travel route from the starting point to the end point of the mobile robot in real time, and combines the motion model of the mobile robot itself to obtain a series of linear velocity and angular velocity information. The excellence of this method is that it can dynamically plan a feasible route to guide the robot to reach the designated location according to the preset posture. However, the feasible route usually exists in the form of a curve or a broken line, the path is long, and the feasible route is uncertain, and it is easy to adjust the route due to the existence of obstacles.
[0004] When there is a slight deviation between the robot's action and the calculated action, it needs to be calculated again. During the whole process, the calculation part always exists, and the calculation method is relatively complicated. This method causes the computing power to be occupied to a certain extent, thus reducing the real-time performance. Summary of the invention
[0005] In view of this, the present invention provides a differential robot control method and related devices to solve the problem that in the process of controlling the differential robot from the starting point to the end point, when there is a slight deviation between the robot's execution action and the calculated action, another calculation is required. In the whole process, the calculation part always exists, and the calculation method is relatively complex. This method causes the computing power to be occupied to a certain extent, thereby reducing the real-time performance. The specific scheme is as follows:
[0006] A differential robot control method, comprising:
[0007] Obtaining the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle;
[0008] Determine a first vector based on the starting point coordinates and the end point coordinates, and rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector;
[0009] When the orientation of the differential robot is consistent with the orientation of the first vector, controlling the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector;
[0010] When the current differential robot travels to the end point coordinates, the current angle of the differential robot is acquired, and the current angle is controlled to coincide with the end point angle.
[0011] The above differential robot control method may optionally cause the differential robot to rotate in situ based on the first vector and the angle between the starting point so that the orientation of the differential robot is consistent with the orientation of the first vector, including:
[0012] Determine a direction vector based on the starting point angle;
[0013] Calculating a first angular deviation between the direction vector and the first vector;
[0014] The differential robot is rotated based on the first angle deviation to make the direction vector coincide with the first vector, and when the first angle deviation is less than a first preset angle threshold, it is determined that the orientation of the differential robot is consistent with the orientation of the first vector.
[0015] The above differential robot control method may, optionally, control the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector when the orientation of the differential robot is consistent with the orientation of the first vector, comprising:
[0016] Controlling the current differential robot to travel at a preset linear speed in the direction of the first vector, and obtaining the coordinates of the center point of the current differential robot;
[0017] Calculate the distance between the center point coordinates and the end point coordinates;
[0018] When the distance is less than a preset distance threshold, it is determined that the current differential robot has traveled to the end point coordinates.
[0019] The above differential robot control method may optionally further include:
[0020] Calculate a second vector of the center point coordinates and the end point coordinates;
[0021] Determine whether the first vector and the second vector coincide with each other. If the first vector and the second vector do not coincide with each other, add a preset angular velocity to the preset linear velocity to make the first vector and the second vector coincide with each other.
[0022] The above differential robot control method may optionally include, when the current differential robot travels to the end point coordinates, obtaining the current angle of the differential robot and controlling the current angle to coincide with the end point angle, comprising:
[0023] Determine whether the current angle is the same as the end angle;
[0024] When the current angle is different from the end angle, calculating a second angle deviation between the current angle and the end angle;
[0025] The current differential robot is rotated based on the second angle deviation, and when the second angle deviation is less than a second preset angle threshold, it is determined that the current angle coincides with the end point angle.
[0026] A differential robot control device, comprising:
[0027] An acquisition module is used to acquire the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle;
[0028] A determination and rotation module, configured to determine a first vector based on the starting point coordinates and the end point coordinates, and to rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector;
[0029] A first control module, configured to control the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector when the direction of the differential robot is consistent with the direction of the first vector;
[0030] The second control module is used to obtain the current angle of the differential robot when the current differential robot travels to the end point coordinates, and control the current angle to coincide with the end point angle.
[0031] The above differential robot control device, optionally, the determination and rotation module includes:
[0032] A determination unit, configured to determine a direction vector based on the starting point angle;
[0033] A first calculation unit, configured to calculate a first angle deviation between the direction vector and the first vector;
[0034] A rotation and determination unit is used to rotate the differential robot based on the first angle deviation so that the direction vector coincides with the first vector, and when the first angle deviation is less than a first preset angle threshold, determine that the orientation of the differential robot is consistent with the orientation of the first vector.
[0035] The above differential robot control device, optionally, the first control module includes:
[0036] A control and acquisition unit, used for controlling the current differential robot to travel at a preset linear speed in the direction of the first vector, and acquiring the coordinates of the center point of the current differential robot;
[0037] A second calculation unit, used for calculating the distance between the center point coordinates and the end point coordinates;
[0038] The determination unit is used to determine that the current differential robot has traveled to the end point coordinates when the distance is less than a preset distance threshold.
[0039] The above differential robot control device may optionally further include:
[0040] A third calculation unit, used for calculating a second vector of the center point coordinates and the end point coordinates;
[0041] The first judgment unit is used to judge whether the first vector and the second vector coincide with each other. If the first vector and the second vector do not coincide with each other, a preset angular velocity is added to the preset linear velocity to make the first vector and the second vector coincide with each other.
[0042] In the above differential robot control device, optionally, the second control module comprises:
[0043] A second judgment unit, used to judge whether the current angle is the same as the end angle;
[0044] A fourth calculation unit, configured to calculate a second angle deviation between the current angle and the endpoint angle when the current angle is different from the endpoint angle;
[0045] The rotation unit is used to rotate the current differential robot based on the second angle deviation, and when the second angle deviation is less than a second preset angle threshold, determine that the current angle coincides with the end point angle.
[0046] A computer program product includes computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the differential robot control method described above.
[0047] An electronic device comprises at least one processor and a memory connected to the processor, wherein:
[0048] The memory is used to store computer programs;
[0049] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned differential robot control method.
[0050] A computer storage medium, the storage medium carries one or more computer programs, when the one or more computer programs are executed by an electronic device, the electronic device can implement the above-mentioned differential robot control method. Compared with the prior art, the present invention has the following advantages:
[0051] The present application discloses a differential robot control method and related devices, which relate to the field of automatic control, including: obtaining the starting coordinates, starting angle, end coordinates and end angle of the current differential robot; determining the first vector based on the starting coordinates and the end coordinates, and rotating the differential robot in situ based on the first vector and the starting angle, so that the orientation of the differential robot is consistent with the orientation of the first vector; when the orientations of the two are consistent, controlling the current differential robot to travel to the end coordinates at a preset linear speed in the direction of the first vector; when the current differential robot travels to the end coordinates, obtaining the current angle of the differential robot, and controlling the current angle to coincide with the end angle. In the above process, when the orientation of the differential robot coincides with the first vector, it travels to the end coordinates in the direction of the first vector, and when the current angle is controlled to coincide with the end angle, the driving direction is a straight path. Since the distance of the path is short relative to the curve or broken line, the control speed is fast. Furthermore, the straight path is deterministic, and obstacles can be handled in time if there are any. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 It is a schematic diagram of a differential robot in the prior art;
[0054] Figure 2 A flow chart of a differential robot control method disclosed in an embodiment of the present invention;
[0055] Figure 3 A schematic diagram of coordinates of a differential robot disclosed in an embodiment of the present invention;
[0056] Figure 4 A schematic diagram of a differential robot route alignment disclosed in an embodiment of the present invention;
[0057] Figure 5 A schematic diagram of position overlap of a differential robot disclosed in an embodiment of the present invention;
[0058] Figure 6 A schematic diagram of aligning a differential robot disclosed in an embodiment of the present application;
[0059] Figure 7 A structural block diagram of a differential robot control device disclosed in an embodiment of the present invention;
[0060] Figure 8 The present invention is a schematic diagram of a device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 the present invention.
[0062] The present invention discloses a differential robot control method and related devices, which are used to solve the problem that in the existing differential robot control process, the linear velocity and angular velocity of the differential robot are usually calculated dynamically. When there is a deviation between the action executed by the differential robot and the calculated action, it is necessary to calculate again. In the whole process, the calculation part is always present, and the calculation method is relatively complicated. This method causes the computing power to be occupied to a certain extent, thereby resulting in a decrease in the real-time performance of the control. In order to solve the above problems, an embodiment of the present invention provides a differential robot control method and device, and the execution process of the method is as follows: Figure 2 The steps shown include:
[0063] S101, obtaining a starting position and an end position of the current differential robot in a world coordinate system, wherein the starting position includes: a starting point coordinate and a starting point angle, and the end position includes: an end point coordinate and an end point angle;
[0064] In the embodiment of the present invention, the coordinates of the starting point and the end point of the current differential robot in the world coordinate system can be obtained by a laser rangefinder and a visual sensor, etc. The specific acquisition method is not limited in the embodiment of the present invention. Figure 3 As shown in the figure, at the initial time t, the starting coordinates of the robot in the world coordinate system are (x1, y1), and the ending coordinates are (x2, y2). θ represents the local coordinate system of the current differential robot (X Rand Y R ) R The angle between the X axis and the world coordinate system (X and Y), ρ represents the local coordinate system (X R and Y R ) R The angle between the initial position and the end point of the world coordinate system is P1(x1,y1,θ) and the end point position is P2(x2,y2,ρ).
[0065] S102, determining a first vector based on the starting point coordinates and the end point coordinates, and rotating the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector;
[0066] In the embodiment of the present invention, Figure 4 As shown, at the start time, the orientation of the current differential robot does not coincide with the line connecting its starting point coordinates and end point coordinates, so the mobile robot needs to rotate on the spot to adjust its orientation to be consistent with the direction of the line. The specific processing process is as follows:
[0067] First, determine the direction vector based on the starting angle, where when the absolute value of the starting angle |θ| is an acute angle, a direction vector of the current differential robot in the current position is (1, tanθ); when the absolute value of the starting angle |θ| is an obtuse angle, a direction vector of the current differential robot in the current position is (-1, -tanθ); when the absolute value of the starting angle |θ| is a right angle, a direction vector of the current differential robot in the current position is (1, 0) or (-1, 0). The obtained direction vector is recorded as d1 = (x3, y3).
[0068] In an embodiment of the present invention, the process of determining the first quantity is as follows: through the initial posture P1 and the end posture P2, it can be calculated that the connecting vector from the starting point coordinates to the end point coordinates is (x2-x1, y2-y1), and this vector is recorded as the first vector d2=(x4, y4), where x4=x2-x1, y4=y2-y1.
[0069] Then, a first angle deviation between the direction vector and the first vector is calculated
[0070] According to the cosine theorem, the angle between the direction vector d1 and the first vector d2 is:
[0071]
[0072] Wherein, α is the first angular velocity deviation. When x3*y3+x4*y4 is less than zero, that is, the angular deviation between the direction vector and the first vector is an obtuse angle, the first angular deviation α=-α is taken.
[0073] Finally, after determining the first angle deviation, the differential robot is rotated based on the first angle deviation. When the first angle deviation α is less than zero, the angular velocity is issued as a negative value, so that the current differential robot rotates clockwise, otherwise it rotates counterclockwise, until the absolute value of the angle between the direction vector d1 and the first vector d2 of the current differential robot |α| is less than the first preset angle threshold, and it is determined that the orientation of the differential robot is consistent with the orientation of the first vector, that is, the direction quantity coincides with the first vector, wherein the first preset angle threshold is determined according to the needs of the actual project, and the theoretical optional range is between 0 and 90 degrees, and the actual project is usually within 0 to 10 degrees. The minimum deviation between the acceptable robot orientation and the connecting line orientation is because the execution unit in the actual project may not be able to make some minor orientation adjustments, such as 1 degree.
[0074] S103, when the orientation of the differential robot is consistent with the orientation of the first vector, controlling the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector;
[0075] In the embodiment of the present invention, when it is determined that the orientation of the differential robot is consistent with the orientation of the first vector, Figure 5 As shown, the current differential robot is controlled to travel at a preset linear speed in the direction of the first vector, wherein the preset linear speed is calculated artificially according to the physical structure of the current differential robot. Different differential robots have different corresponding preset linear speeds. Under normal circumstances, the preset linear speeds corresponding to the same differential robot are the same. In the embodiment of the present invention, there is no limit on the specific determination process of the preset linear speed. During the travel of the current differential robot in the direction of the first vector, the center point coordinates of the current differential robot can be obtained based on a position sensor or other preferred sensors at intervals of a specified length of time, and the Euclidean distance between the center point coordinates and the end point coordinates is calculated. When the Euclidean distance between the two points is less than the preset distance threshold given artificially, it is determined that the robot has reached the end point, and it is determined that the current differential robot has traveled to the end point coordinates. Among them, the preset distance threshold is similar to the first preset angle threshold, and specifically needs to be given according to the speed execution unit parameters, such as the minimum displacement that can be achieved by the vehicle chassis. The theoretical optional range is 0 to 1m, and the actual engineering is usually between 0 and 5cm.
[0076] Furthermore, the Euclidean distance (also called straight-line distance) is a method for calculating the distance between two points in a two-dimensional space. It uses the horizontal and vertical coordinates of the points. Assuming that the coordinates of the center point are (x5, y5) and the coordinates of the end point are (x2, y2), the Euclidean distance d between them can be calculated by the following formula:
[0077]
[0078] Furthermore, due to the instability of the current differential robot's driving, it is difficult to ensure that it always drives in the direction of the first vector, and a second vector of the center point coordinates and the end point coordinates is calculated, wherein the calculation process of the second vector is the same as the calculation process of the first vector, and the corresponding X-axis coordinates and Y-axis coordinates are subtracted. No specific description is given in the embodiment of the present invention. Further, it is determined whether the first vector and the second vector coincide with each other. The judgment of whether they coincide can be determined by whether the angle between the first vector and the second vector exceeds the corresponding threshold. For example, if the angle between the first vector and the second vector exceeds the corresponding threshold, it is determined that the two coincide, indicating that the current differential robot is driving stably and no processing is required. On the contrary, if the angle between the first vector and the second vector is greater than the corresponding threshold, it is determined that the two do not coincide. A preset angular velocity is added to the preset linear velocity to make the first vector and the second vector coincide. Among them, the preset angular velocity is the same as the preset linear velocity. The preset angular velocity is artificially calculated based on the physical structure of the current differential robot. For different differential robots, the corresponding preset angular velocities are different. Under normal circumstances, for the same differential robot, the corresponding preset angular velocity is the same. In the embodiment of the present invention, the specific value of the preset angular velocity is not limited.
[0079] S104: When the current differential robot travels to the end point coordinates, obtain the current angle of the differential robot, and control the current angle to coincide with the end point angle.
[0080] In the embodiment of the present invention, when the current differential robot travels to the end point coordinates, Figure 6As shown, the current angle represents the angle between the XR direction in the local coordinate system (XR and YR) of the current differential robot and the X axis of the world coordinate system (X and Y), and it is determined whether the current angle is the same as the terminal angle. If the current angle is the same as the terminal angle, the control process ends. If the current angle is not the same as the terminal angle, the second angle deviation between the current angle and the terminal angle is calculated, wherein the second angle deviation is the absolute value of the difference between the current angle and the terminal angle, which can be obtained by obtaining the current posture of the current angle, and using the cosine theorem as shown in formula (1) based on the current coordinates and the terminal coordinates in the current position. The current differential robot is rotated based on the second angle deviation, and the current angle coincides with the terminal angle. Assuming that the second angle deviation is β, when the second angle deviation β is less than zero, the angular velocity is negative, so that the current differential robot rotates clockwise, otherwise it rotates counterclockwise. After the absolute value of the angle |β| is less than the second preset angle threshold through self-rotation, it is determined that the mobile robot has overlapped with the end point posture, and navigation ends. Among them, the setting process of the second preset angle threshold is the same as that of the first preset angle threshold. The second angle threshold is determined according to the needs of the actual project. Theoretically, the optional range is between 0 and 90 degrees, and the actual project is usually within 0 to 10 degrees. It represents the minimum acceptable deviation between the robot orientation and the connection orientation, because the execution unit in the actual project may not be able to make some minor orientation adjustments, such as 1 degree.
[0081] The present application discloses a differential robot control method, which relates to the field of automatic control, including: obtaining the starting coordinates, starting angle, end coordinates and end angle of the current differential robot; determining a first vector based on the starting coordinates and the end coordinates, and rotating the differential robot in situ based on the first vector and the starting angle, so that the orientation of the differential robot is consistent with the orientation of the first vector; when the orientations of the two are consistent, controlling the current differential robot to travel to the end coordinates at a preset linear speed in the direction of the first vector; when the current differential robot travels to the end coordinates, obtaining the current angle of the differential robot, and controlling the current angle to coincide with the end angle. In the above process, when the orientation of the differential robot coincides with the first vector, the differential robot travels to the end coordinates in the direction of the first vector, and when the current angle is controlled to coincide with the end angle, the driving direction is a straight path. Since the distance of the path is short relative to the curve or broken line, the control speed is fast. Furthermore, the straight path is deterministic, and obstacles can be handled in time if there are any.
[0082] In the embodiment of the present invention, the core idea is to divide the control process into three steps, the first step is route alignment, the second step is position overlap, and the third step is orientation alignment. It is only necessary to calculate the overlap between the orientation of the differential robot and the first vector, the overlap between the final position and the end point coordinates, and the overlap between the current angle and the end point angle. There is no need to perform continuous calculations. Therefore, the amount of calculation required by the control algorithm is much less than the control method of the dynamic planning path, avoiding the problem of computing power being occupied and poor real-time control, which can effectively improve the real-time performance of autonomous navigation.
[0083] In the embodiment of the present invention, compared with the traditional control algorithm, the control algorithm proposed in the present application greatly reduces the amount of calculation of the robot during the movement process; compared with other navigation algorithms, this algorithm has achieved good results in actual engineering applications because its control logic is relatively simple and does not involve particularly complex calculation processes. Therefore, under certain scene restrictions, the robot navigation in the experiment has extremely stable performance; the navigation steps are simplified, the original dynamic but complex control method is abandoned, and a relatively simple but stable control method is used, which has high reliability. After multiple tests, good performance has been achieved. Most of the existing control algorithms are relatively complex. Although these methods have different advantages in navigation, they all require relatively high computing power.
[0084] Based on the above-mentioned differential robot control method, the present invention also provides a differential robot control device in an embodiment. The structural block diagram of the device is as follows: Figure 7 As shown, including:
[0085] An acquisition module 201 , a determination and rotation module 202 , a first control module 203 and a second control module 204 .
[0086] in,
[0087] The acquisition module 201 is used to acquire the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle;
[0088] The determination and rotation module 202 is used to determine a first vector based on the starting point coordinates and the end point coordinates, and to rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector;
[0089] The first control module 203 is used to control the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector when the direction of the differential robot is consistent with the direction of the first vector;
[0090] The second control module 204 is used to obtain the current angle of the differential robot when the current differential robot travels to the end point coordinates, and control the current angle to coincide with the end point angle.
[0091] The present application discloses a differential robot control device, which relates to the field of automatic control, including: obtaining the starting coordinates, starting angle, end coordinates and end angle of the current differential robot; determining the first vector based on the starting coordinates and the end coordinates, and making the differential robot rotate in situ based on the first vector and the starting angle, so that the orientation of the differential robot is consistent with the orientation of the first vector; when the orientations of the two are consistent, controlling the current differential robot to travel to the end coordinates at a preset linear speed in the direction of the first vector; when the current differential robot travels to the end coordinates, obtaining the current angle of the differential robot, and controlling the current angle to coincide with the end angle. In the above process, when the orientation of the differential robot coincides with the first vector, it travels to the end coordinates in the direction of the first vector, and when the current angle is controlled to coincide with the end angle, the driving direction is a straight path. Since the distance of the path is short relative to the curve or broken line, the control speed is fast. Furthermore, the straight path is deterministic, and obstacles can be handled in time if there are any.
[0092] In the embodiment of the present invention, the determination and rotation module 202 includes:
[0093] A determination unit, a first calculation unit and a rotation and judgment unit.
[0094] in,
[0095] The determining unit is used to determine the direction vector based on the starting point angle;
[0096] The first calculation unit is used to calculate a first angle deviation between the direction vector and the first vector;
[0097] The rotation and determination unit is used to rotate the differential robot based on the first angle deviation so that the direction vector coincides with the first vector, and when the first angle deviation is less than a first preset angle threshold, determine that the orientation of the differential robot is consistent with the orientation of the first vector.
[0098] In the embodiment of the present invention, the first control module 203 includes:
[0099] A control and acquisition unit, a second calculation unit and a determination unit.
[0100] in,
[0101] The control and acquisition unit is used to control the current differential robot to travel at a preset linear speed in the direction of the first vector, and to acquire the coordinates of the center point of the current differential robot;
[0102] The second calculation unit is used to calculate the distance between the center point coordinates and the end point coordinates;
[0103] The determination unit is used to determine that the current differential robot has traveled to the end point coordinates when the distance is less than a preset distance threshold.
[0104] In the embodiment of the present invention, the first control unit 203 further includes:
[0105] A third calculating unit and a first judging unit.
[0106] in,
[0107] The third calculation unit is used to calculate a second vector of the center point coordinates and the end point coordinates;
[0108] The first judgment unit is used to judge whether the first vector and the second vector coincide with each other. If the first vector and the second vector do not coincide with each other, a preset angular velocity is added to the preset linear velocity to make the first vector and the second vector coincide with each other.
[0109] In the embodiment of the present invention, the second control module 204 includes:
[0110] A second judging unit, a fourth calculating unit and a rotating unit.
[0111] in,
[0112] The second judging unit is used to judge whether the current angle is the same as the end angle;
[0113] The fourth calculation unit is used to calculate a second angle deviation between the current angle and the endpoint angle when the current angle is different from the endpoint angle;
[0114] The rotation unit is used to rotate the current differential robot based on the second angle deviation, and when the second angle deviation is less than a second preset angle threshold, it is determined that the current angle coincides with the end angle. The control device includes a processor and a memory, and the acquisition module, determination and rotation module, first control module and second control module are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
[0115] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the control speed can be increased by adjusting the kernel parameters.
[0116] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0117] An embodiment of the present invention provides a computer storage medium on which a program is stored. When the program is executed by a processor, the steps of the differential robot control method are implemented.
[0118] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the steps of the differential robot control method when running.
[0119] An embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of a differential robot control method provided in an embodiment of the present application.
[0120] An embodiment of the present invention provides a device, the structural block diagram of which is as follows Figure 8 As shown, the device includes: a processor 301, a storage medium 302, and a program stored in the storage medium 302 and executable on the processor 301. When the processor 301 executes the program, the following steps are implemented:
[0121] Obtaining the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle;
[0122] Determine a first vector based on the starting point coordinates and the end point coordinates, and rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector;
[0123] When the orientation of the differential robot is consistent with the orientation of the first vector, controlling the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector;
[0124] When the current differential robot travels to the end point coordinates, the current angle of the differential robot is acquired, and the current angle is controlled to coincide with the end point angle.
[0125] Obtaining the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle;
[0126] Determine a first vector based on the starting point coordinates and the end point coordinates, and rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector;
[0127] When the orientation of the differential robot is consistent with the orientation of the first vector, controlling the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector;
[0128] When the current differential robot travels to the end point coordinates, the current angle of the differential robot is acquired, and the current angle is controlled to coincide with the end point angle.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0133] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0134] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0135] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0136] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0138] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A differential robot control method, characterized in that: include: Obtaining the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle; Determine a first vector based on the starting point coordinates and the end point coordinates, and rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector; When the orientation of the differential robot is consistent with the orientation of the first vector, controlling the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector; When the current differential robot travels to the end point coordinates, the current angle of the differential robot is acquired, and the current angle is controlled to coincide with the end point angle.
2. The differential robot control method according to claim 1, characterized in that: The method of causing the differential robot to rotate in place based on the first vector and the angle between the starting point so that the orientation of the differential robot is consistent with the orientation of the first vector includes: Determine a direction vector based on the starting point angle; Calculating a first angle deviation between the direction vector and the first vector; The differential robot is rotated based on the first angle deviation to make the direction vector coincide with the first vector, and when the first angle deviation is less than a first preset angle threshold, it is determined that the orientation of the differential robot is consistent with the orientation of the first vector.
3. The differential robot control method according to claim 1, characterized in that: When the orientation of the differential robot is consistent with the orientation of the first vector, controlling the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector includes: Controlling the current differential robot to travel at a preset linear speed in the direction of the first vector, and obtaining the coordinates of the center point of the current differential robot; Calculate the distance between the center point coordinates and the end point coordinates; When the distance is less than a preset distance threshold, it is determined that the current differential robot has traveled to the end point coordinates.
4. The differential robot control method according to claim 3, characterized in that: Also includes: Calculate a second vector of the center point coordinates and the end point coordinates; Determine whether the first vector and the second vector coincide with each other. If the first vector and the second vector do not coincide with each other, add a preset angular velocity to the preset linear velocity to make the first vector and the second vector coincide with each other.
5. The differential robot control method according to claim 1, characterized in that: When the current differential robot travels to the end point coordinates, obtaining the current angle of the differential robot and controlling the current angle to coincide with the end point angle include: Determine whether the current angle is the same as the end angle; When the current angle is different from the end angle, calculating a second angle deviation between the current angle and the end angle; The current differential robot is rotated based on the second angle deviation, and when the second angle deviation is less than a second preset angle threshold, it is determined that the current angle coincides with the end point angle.
6. A differential robot control device, characterized in that: include: An acquisition module is used to acquire the starting position and the end position of the current differential robot in the world coordinate system, wherein the starting position includes: starting point coordinates and starting point angle, and the end position includes: end point coordinates and end point angle; A determination and rotation module, configured to determine a first vector based on the starting point coordinates and the end point coordinates, and to rotate the differential robot in situ based on the first vector and the angle between the starting point, so that the orientation of the differential robot is consistent with the orientation of the first vector; A first control module, configured to control the current differential robot to travel to the end point coordinates at a preset linear speed in the direction of the first vector when the direction of the differential robot is consistent with the direction of the first vector; The second control module is used to obtain the current angle of the differential robot when the current differential robot travels to the end point coordinates, and control the current angle to coincide with the end point angle.
7. The differential robot control device according to claim 6, characterized in that: The determination and rotation module comprises: A determination unit, configured to determine a direction vector based on the starting point angle; A first calculation unit, used for calculating a first angle deviation between the direction vector and the first vector; A rotation and determination unit is used to rotate the differential robot based on the first angle deviation so that the direction vector coincides with the first vector, and when the first angle deviation is less than a first preset angle threshold, determine that the orientation of the differential robot is consistent with the orientation of the first vector.
8. The differential robot control device according to claim 6, characterized in that: The first control module comprises: A control and acquisition unit, used for controlling the current differential robot to travel at a preset linear speed in the direction of the first vector, and acquiring the coordinates of the center point of the current differential robot; A second calculation unit, used for calculating the distance between the center point coordinates and the end point coordinates; The determination unit is used to determine that the current differential robot has traveled to the end point coordinates when the distance is less than a preset distance threshold.
9. The differential robot control device according to claim 8, characterized in that: Also includes: A third calculation unit, used for calculating a second vector of the center point coordinates and the end point coordinates; The first judgment unit is used to judge whether the first vector and the second vector coincide with each other. If the first vector and the second vector do not coincide with each other, a preset angular velocity is added to the preset linear velocity to make the first vector and the second vector coincide with each other.
10. The differential robot control device according to claim 6, characterized in that: The second control module includes: A second judgment unit, used to judge whether the current angle is the same as the end angle; A fourth calculation unit, configured to calculate a second angle deviation between the current angle and the endpoint angle when the current angle is different from the endpoint angle; A rotation unit is used to rotate the current differential robot based on the second angle deviation, and when the second angle deviation is less than a second preset angle threshold, determine that the current angle coincides with the end point angle.
11. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the differential robot control method as claimed in any one of claims 1 to 5.
12. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the differential robot control method as described in any one of claims 1 to 5.
13. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the differential robot control method as described in any one of claims 1 to 5.
