Robot control method and device, computer equipment, storage medium and product

By determining the circular control area in the screen and responding to the virtual rocker operation, combined with the speed control coefficient, the problem of low control accuracy in the prior art is solved, and higher robot control accuracy and stability are achieved.

CN120122631APending Publication Date: 2025-06-10ORANGE ARTIFICIAL INTELLIGENCE (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510177912.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing human-computer interaction method based on screen control has the problem of low control accuracy.

Method used

By determining the circular control area in the screen and in response to the position operation of the virtual rocker, the direction and distance of the target position relative to the center of the control area is determined, and the robot movement is accurately controlled in combination with the speed control coefficient.

Benefits of technology

It improves the accuracy and stability of robot control, can ignore screen differences, provide unified control standards, and meet the adaptive needs of different screen sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120122631A_ABST
    Figure CN120122631A_ABST
Patent Text Reader

Abstract

The invention relates to a robot control method and device, computer equipment, a storage medium and a product. The method comprises the following steps: determining a circular control area in a screen, wherein the area size of the control area and the screen size of the screen accord with a preset size relationship; in response to a joystick control operation for controlling the position of a virtual joystick in the control area, determining a target position of the virtual joystick in the control area; according to an angle metering mode of rotating from a preset reference direction to a preset rotating direction, determining a target angle formed by the direction of the target position relative to the circle center of the control area and the preset reference direction; determining a relative distance of the target position relative to the circle center, and linearly mapping the relative distance into a target distance in a preset interval; acquiring a speed control coefficient, and controlling the robot to act according to the target angle, the target distance and the speed determined by the speed control coefficient. By adopting the method, the robot control accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of control technology, and particularly to a robot control method, device, computer device, storage medium, and product. Background Art

[0002] With the rapid development of computer technology, robots have been widely used in various fields, such as industrial production, robot competitions, logistics distribution, home services, and daily entertainment. In order to achieve flexible control of robots, a human-computer interaction method based on screen manipulation has emerged. In this human-computer interaction method, specific elements can be displayed on the screen of the control device, and users can control the actions of the robot by operating the specific elements.

[0003] However, the existing human-computer interaction method based on screen manipulation has the problem of low control accuracy. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a robot control method, device, computer device, storage medium, and product that can improve control accuracy.

[0005] In a first aspect, this application provides a robot control method, including:

[0006] Determine a circular manipulation area on the screen, where the area size of the manipulation area and the screen size of the screen conform to a preset size relationship;

[0007] In response to a joystick control operation for controlling the position of a virtual joystick in the manipulation area, determine the target position of the virtual joystick in the manipulation area;

[0008] According to the angle measurement method of rotating from a preset reference direction to a preset rotation direction, determine the target angle formed by the direction of the target position relative to the center of the manipulation area and the preset reference direction;

[0009] Determine the relative distance of the target position relative to the center of the circle, and linearly map the relative distance to a target distance within a preset interval;

[0010] Obtain a speed control coefficient, and control the robot's action according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0011] In a second aspect, this application also provides a robot control device, including:

[0012] A manipulation area determination module, configured to determine a circular manipulation area on the screen, where the area size of the manipulation area and the screen size of the screen conform to a preset size relationship;

[0013] A joystick management module, configured to determine a target position of the virtual joystick in the manipulation area in response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area; determine, according to an angle measurement method of rotating from a preset reference direction to a preset rotation direction, a target angle formed by the direction of the target position relative to the center of the manipulation area and the preset reference direction; determine a relative distance of the target position relative to the center, and linearly map the relative distance to a target distance within a preset interval;

[0014] A robot control module, which obtains a speed control coefficient and controls the movement of the robot according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0015] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0016] Determine a circular manipulation area on the screen, where the area size of the manipulation area and the screen size of the screen conform to a preset size relationship;

[0017] In response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area, determine the target position of the virtual joystick in the manipulation area;

[0018] Determine, according to an angle measurement method of rotating from a preset reference direction to a preset rotation direction, a target angle formed by the direction of the target position relative to the center of the manipulation area and the preset reference direction;

[0019] Determine a relative distance of the target position relative to the center, and linearly map the relative distance to a target distance within a preset interval;

[0020] Obtain a speed control coefficient and control the movement of the robot according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0021] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0022] Determine a circular manipulation area on the screen, where the area size of the manipulation area and the screen size of the screen conform to a preset size relationship;

[0023] In response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area, determine the target position of the virtual joystick in the manipulation area;

[0024] Determine a target angle formed between the direction of the target position relative to the center of the control area and the preset reference direction according to an angle measurement method of rotating from the preset reference direction towards the preset rotation direction;

[0025] Determine the relative distance of the target position relative to the center of the circle, and linearly map the relative distance to a target distance within a preset interval;

[0026] Obtain a speed control coefficient, and control the movement of the robot according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0027] In a fifth aspect, the present application also provides a computer program product, including a computer program, which when executed by a processor implements the following steps:

[0028] Determine a circular control area on the screen, and the area size of the control area conforms to a preset size relationship with the screen size of the screen;

[0029] In response to a joystick control operation for controlling the position of a virtual joystick in the control area, determine the target position of the virtual joystick in the control area;

[0030] Determine a target angle formed between the direction of the target position relative to the center of the control area and the preset reference direction according to an angle measurement method of rotating from the preset reference direction towards the preset rotation direction;

[0031] Determine the relative distance of the target position relative to the center of the circle, and linearly map the relative distance to a target distance within a preset interval;

[0032] Obtain a speed control coefficient, and control the movement of the robot according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0033] The above-mentioned robot control method, device, computer equipment, storage medium and product, since the area size of the control area in the screen conforms to the preset size relationship with the screen size of the screen, the control area can adapt to screens of different sizes, providing a basis for accurately operating the joystick in the control area. Moreover, in response to the joystick control operation, the target position of the virtual joystick is determined, and then according to the angle measurement method of rotating from the preset reference direction to the preset rotation direction, the target angle formed by the direction of the target position relative to the center of the control area and the preset reference direction is determined, and the relative distance of the target position relative to the center is mapped to the target distance within the preset interval. The screen difference can be ignored, and the target position can be converted into the target angle and target distance of a unified standard. And the speed control coefficient can provide information that meets the control requirements. Thus, the speed determined according to the target angle, target distance and speed control coefficient is used to control the robot's action, which can improve the control accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0035] Figure 1 It is an application environment diagram of the robot control method in an embodiment;

[0036] Figure 2 It is a flowchart of the robot control method in an embodiment;

[0037] Figure 3 It is a structural block diagram of the robot control device in an embodiment;

[0038] Figure 4 It is an internal structure diagram of the computer equipment in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0039] In order to make the objectives, technical solutions and advantages of the present application clearer, the following further details the present application in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0040] The robot control method provided by the embodiments of the present application can be applied to, for example Figure 1In the application environment shown. Among them, the computer device 102 can communicate with the robot 104. The computer device 102 can determine a circular control area on the screen of the computer device 102. In response to a joystick control operation that controls the position of the virtual joystick in the control area, it determines the target position of the virtual joystick in the control area, determines the target angle and target distance based on the target position, and controls the action of the robot 104 according to the speed determined by the target angle, target distance, and speed control coefficient. Among them, the computer device 102 can be a personal computer, a laptop computer, a smart phone, a tablet computer, an Internet of Things device, and a portable wearable device. The Internet of Things device can be a smart TV, a smart vehicle-mounted device, etc. The portable wearable device can be a smart watch, a smart bracelet, etc. The robot 104 can be a movable robot, such as a sweeping robot, a transport robot, a robot car, etc. The robot 104 can use wheels to achieve movement. The wheels can be, for example, omni wheels, mecanum wheels, or others.

[0041] In an exemplary embodiment, as Figure 2 shown, a robot control method is provided. Taking the computer device 102 in Figure 1 as an example, the following steps 202 to step 210 are included. Among them:

[0042] Step 202, determine a circular control area on the screen. The area size of the control area conforms to a preset size relationship with the screen size of the screen.

[0043] Among them, the screen is a display device in the computer device for controlling the robot. The screen can specifically be a touch screen, and the touch screen allows users to interact with the computer device by touching. The control area is a specific area for controlling the movement of the virtual joystick. The area size can be the diameter or radius of the control area. The screen size can be the diagonal size or the side length of the screen. The area size and the screen size can be represented by resolution or by physical size units such as inches.

[0044] The screen side length can include the screen height and the screen width. The screen height can be the side length of the shorter side in the display area of the screen, and the screen width can be the side length of the longer side in the display area of the screen. The preset size relationship can be that the ratio between the area size of the control area and the screen size of the screen is a preset ratio. For example, the preset size relationship can be that the ratio between the diameter of the control area and the screen width of the screen is a preset ratio, and the preset ratio can be, for example, 0.2, 0.15, or others.

[0045] Exemplarily, the screen size may include the screen width. The computer device may obtain the screen width, determine the diameter of the manipulation area according to the preset size relationship between the diameter of the to-be-determined manipulation area and the screen width, and determine a circular manipulation area on the screen based on the determined diameter.

[0046] In one embodiment, the screen size may include the screen height and the screen width. The computer device may, in the screen coordinate system, determine the coordinates of the center of the manipulation area according to the screen height and the screen width; and determine a circular manipulation area on the screen according to the determined diameter and the coordinates of the center.

[0047] Among them, the screen coordinate system may be a coordinate system for determining the position of each point on the screen. The origin of the coordinate system of the screen coordinate system may be a vertex of the screen. The positive direction of the horizontal axis (x-axis) may be a direction extending along one of the sides where the screen height is located or the side where the screen width is located starting from the origin of the coordinate system, and the positive direction of the vertical axis (y-axis) may be the other. For example, the origin of the coordinate system may be the vertex at the upper left corner of the screen when the screen is placed horizontally. The positive direction of the horizontal axis may be the direction in which the origin of the coordinate system extends along the side where the screen width is located, and the vertical axis direction may be the direction in which the origin of the coordinate system extends towards the side where the screen height is located.

[0048] Step 204: In response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area, determine the target position of the virtual joystick in the manipulation area.

[0049] Among them, the virtual joystick is a joystick control control presented in a virtual form and is used to simulate the functions of a traditional physical joystick. The virtual joystick is displayed in a shape smaller than the manipulation area, such as a circle, a rectangle, the shape of a quasi-physical joystick, or others. In the initial state, the center position of the virtual joystick may coincide with the center position of the manipulation area. When the virtual joystick is controlled, the virtual joystick may move in the manipulation area.

[0050] The joystick control operation may be an independent control operation or a combined control operation. The independent control operation includes a separate control operation, specifically, it may be a dragging operation on the virtual joystick, or a clicking operation in the manipulation area, such as a mouse click operation or a touch click operation. The combined control operation includes two or more control operations. For example, the combined control operation may be to first perform a clicking operation on the virtual joystick and then perform a clicking operation on a position outside the position of the virtual joystick in the manipulation area. The combined control operation may also be to perform a long-press operation on the virtual joystick and then perform a dragging operation on the virtual joystick. The target position may be the position for displaying the virtual joystick. Specifically, the target position may be the position where the center of the virtual joystick is located when the virtual joystick is displayed.

[0051] Exemplarily, the computer device may, in response to a joystick control operation that controls the position of a virtual joystick in the control manipulation area, obtain the operation position of the joystick control operation on the screen, and determine the target position of the virtual joystick in the manipulation area based on the operation position. Among them, the operation position represents the position where the joystick control operation expects to move the virtual joystick to. For example, when the joystick control operation is a click operation, the operation position may be the click position; when the joystick control operation is a drag operation, the operation position may be the position where it stops after dragging.

[0052] In one embodiment, when the operation position is within the manipulation area, the computer device may determine the operation position as the target position of the virtual joystick in the manipulation area.

[0053] In one embodiment, the computer device may determine the distance between the operation position and the center of the manipulation area. When the distance is not greater than the radius of the manipulation area, it may be determined that the operation position is within the manipulation area; when the distance is greater than the radius of the manipulation area, it may be determined that the operation position is outside the manipulation area. Among them, both the operation position and the center can be represented as different coordinates in the screen coordinate system.

[0054] Step 206, determine the target angle formed by the direction of the target position relative to the center of the manipulation area and the preset reference direction according to the angle measurement method of rotating from the preset reference direction towards the preset rotation direction.

[0055] Among them, the preset reference direction is a reference direction pre-set for determining the angle. The preset reference direction can be the direction where the screen height is located, or the direction where the screen width is located. Specifically, the preset reference direction can be the positive direction of the horizontal axis or the positive direction of the vertical axis in the screen coordinate system. The preset rotation direction can be the clockwise direction or the counterclockwise direction.

[0056] According to the angle measurement method of rotating from the preset reference direction towards the preset rotation direction, with the preset reference direction as the 0-degree direction, the angles increase sequentially when rotating from the preset reference direction towards the preset rotation direction. The target angle can be the angle rotated from the preset reference direction towards the preset rotation direction and rotated to the direction of the target position relative to the center of the manipulation area. The direction of the target position relative to the center of the manipulation area can be the direction pointing from the center of the manipulation area to the target position.

[0057] Exemplarily, the target position and the center of the manipulation area can be different coordinates in the screen coordinate system respectively, the preset reference direction can be the positive direction of the horizontal axis in the screen coordinate system, and the computer device may subtract the two coordinate values of the center from the two coordinate values corresponding to the target position respectively to obtain two offsets, and determine the target angle obtained according to the angle measurement method of rotating from the preset reference direction towards the counterclockwise direction based on the inverse trigonometric function values determined by the two offsets and the comparison results of the two offsets with zero respectively.

[0058] In one embodiment, the computer device may use inverse trigonometric functions to determine an inverse trigonometric function value based on two offsets, determine a compensation value according to the comparison results of the two offsets with zero respectively and the type of the inverse trigonometric function, and determine a target angle obtained by measuring in the counterclockwise direction from a preset reference direction according to the compensation value and the trigonometric function value.

[0059] For example, the two offsets may be offsets in the x - direction and y - direction of the screen coordinate system, the inverse trigonometric function may be the arctangent function, and the inverse trigonometric function value may be the arctangent function value; when both offsets are greater than zero, the compensation value can be determined as 0, and the arctangent function value is used as the target angle; when both offsets are less than zero, the compensation value can be determined as π, and the target angle can be obtained by adding π to the arctangent function value; when the offset in the x - direction is less than zero and the offset in the y - direction is greater than zero among the two offsets, the compensation value can be determined as π, and the target angle can be obtained by adding π to the arctangent function value; when the offset in the x - direction is greater than zero and the offset in the y - direction is less than zero among the two offsets, the compensation value can be determined as 2π, and the target angle can be obtained by adding 2π to the arctangent function value.

[0060] Step 208: Determine the relative distance of the target position with respect to the center of the circle, and linearly map the relative distance to a target distance within a preset interval.

[0061] Among them, the relative distance of the target position with respect to the center of the circle may be the Euclidean distance from the target position to the center of the circle on the screen. The preset interval is a pre - set value interval. The preset interval may be, for example, from 0 to 0.5, from 0 to 1, or others. Since the sizes of different screens may be different, by mapping the relative distance to a target distance within a preset interval, the stability of robot control is improved, and situations such as controlling the robot through a larger - sized screen to generate a larger speed value are avoided.

[0062] Exemplarily, the target position and the center of the circle may be different coordinates in the screen coordinate system. The computer device may determine the relative distance of the target position with respect to the center of the circle according to the coordinate values corresponding to the target position and the center of the circle respectively, and linearly map the relative distance to a target distance within a preset interval according to the ratio between the relative distance and the radius of the control area. Among them, the target distance can be obtained by multiplying the ratio between the relative distance and the radius of the control area by the maximum value in the preset interval.

[0063] Step 210: Obtain a speed control coefficient, and control the robot's movement according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0064] Among them, the speed control coefficient is used to control the speed value of the robot's movement. Specifically, based on the basic speed determined according to the target angle and target distance, the speed value of the basic speed can be increased or decreased through the speed control coefficient to obtain the speed for controlling the robot's movement. The speed control coefficient can be set according to requirements. For example, in order to improve the sensitivity of the robot, the speed control coefficient can be set to a first value, and the first value can be a value greater than 1, such as the first value is 2. Another example is that a sprint control can be displayed at a position outside the control area on the screen. When the sprint control is triggered, the speed control coefficient can be set to a second value greater than the first value. For example, the second value can be 3.

[0065] Exemplarily, the computer device can obtain the speed control coefficient, determine the speed value according to the target distance and the speed control coefficient, determine the speed direction according to the target angle, and control the robot's movement according to the speed composed of the speed value and the speed direction.

[0066] In the above robot control method, since the area size of the control area on the screen conforms to the preset size relationship with the screen size of the screen, the control area can adapt to different-sized screens, providing a basis for accurately operating the joystick in the control area. Moreover, in response to the joystick control operation, the target position of the virtual joystick is determined, and then according to the angle measurement method of rotating from the preset reference direction to the preset rotation direction, the target angle formed by the direction of the target position relative to the center of the control area and the preset reference direction is determined, and the relative distance of the target position relative to the center is mapped to the target distance within the preset interval. The screen difference can be ignored, and the target position can be converted into a unified standard target angle and target distance. And the speed control coefficient can provide information that meets the control requirements. Thus, controlling the robot's movement according to the speed determined by the target angle, target distance, and speed control coefficient can improve the control accuracy.

[0067] In an exemplary embodiment, the screen size of the screen includes the screen width and screen height of the screen, and the area size of the control area includes the diameter of the control area. Step 202 may include: determining a square positioning area on the screen; the screen width conforms to the preset size relationship with the side length of the positioning area; the two coordinate values of the starting coordinates of the positioning area in the screen coordinate system of the screen are determined respectively according to the screen width and screen height; a circular control area is determined within the positioning area such that the control area is inscribed in the positioning area, and the diameter of the control area is the same as the side length of the area.

[0068] Among them, the positioning area is used to position the control area. The side length of the positioning area can be understood as the side length of the square. The ratio between the side length of the positioning area and the screen width can be a preset ratio, such that the side length of the positioning area conforms to the preset size relationship with the screen width. The preset ratio is, for example, 0.2, 0.15 or others.

[0069] The starting coordinates of the positioning area in the screen coordinate system of the screen can be the coordinates of a vertex of the positioning area in the screen coordinate system. For example, they can be the coordinates of the upper left corner vertex of the positioning area in the screen coordinate system. The two coordinate values of the starting coordinates of the positioning area can include a first coordinate value in the direction of the screen width (e.g., the x-axis direction) and a second coordinate value in the direction of the screen height (e.g., the y-axis direction). Then, the ratio of the first coordinate value to the screen width can be a first preset ratio, and the ratio of the second coordinate value to the screen height can be a second preset ratio. The first preset ratio and the second preset ratio can be the same or different, and the values can be, for example, 0.1, 0.12, 0.2, or others.

[0070] Exemplarily, the computer device can draw a circular manipulation area within the positioning area with the manipulation area inscribed in the positioning area. Wherein, the diameter of the manipulation area is the same as the side length of the area. In this way, the diameter of the manipulation area also conforms to a preset size relationship with the screen width. The center of the positioning area can be the center of the manipulation area.

[0071] In this embodiment, since the side length of the positioning area conforms to a preset size relationship with the screen width, the two coordinate values of the starting coordinates of the positioning area in the screen coordinate system of the screen can be determined respectively according to the screen width and the screen height. Moreover, since the screen itself is rectangular, the positioning area can be efficiently determined, and then the manipulation area can be inscribed in the positioning area, so that the manipulation area can be quickly determined.

[0072] In an exemplary embodiment, step 204 may include: in response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area, obtaining the operation position of the joystick control operation on the screen; when the operation position is outside the manipulation area, determining the target position of the virtual joystick on the edge of the manipulation area according to the relative direction of the operation position with respect to the center of the manipulation area.

[0073] Wherein, the distance from a position on the edge of the manipulation area to the center of the manipulation area is the same as the radius of the manipulation area.

[0074] Exemplarily, both the operation position and the center can be represented as different coordinates in the screen coordinate system. The computer device can calculate the distance between the operation position and the center. When the distance is greater than the radius of the manipulation area, it can be determined that the operation position is outside the manipulation area, and the target position of the virtual joystick is determined on the edge of the manipulation area according to the relative direction of the operation position with respect to the center of the manipulation area, so that the relative direction of the target position with respect to the center is the same as the relative direction of the operation position with respect to the center of the manipulation area.

[0075] Among them, the target position can be determined based on the parametric equation of a circle. Specifically, the operation position can be denoted as the coordinates (i, j) in the screen coordinate system, the center of the circle can be denoted as the coordinates (m, n) in the screen coordinate system, the radius of the control area can be denoted as r, and the target position to be determined can be denoted as the coordinates (a, b) in the screen coordinate system. Then, a = m + r * cosθ, b = n + r * sinθ. cosθ and sinθ can be used to indicate the relative direction. When the distance between (i, j) and (m, n) is denoted as d, the value of cosθ can be (i - m) divided by d, and the value of sinθ can be (j - n) divided by d. In this way, the obtained target position is on the edge of the control area, and the relative direction of the target position with respect to the center of the circle is the same as the relative direction of the operation position with respect to the center of the control area.

[0076] In this embodiment, by obtaining the operation position of the joystick control operation and determining whether the operation position is outside the control area, when it is outside the control area, according to the relative direction of the operation position with respect to the center of the control area, the target position of the virtual joystick is determined at the edge of the control area, which can prevent the position of the virtual joystick from exceeding the control area, can retain the user's intention to the greatest extent, and improve the control stability and accuracy.

[0077] In an exemplary embodiment, step 210 may include: obtaining a speed control coefficient; determining a first speed component according to the sine function value of the target angle, the target distance, and the speed control coefficient; determining a second speed component according to the cosine function value of the target angle, the target distance, and the speed control coefficient; and controlling the robot's movement according to the first speed component and the second speed component.

[0078] Among them, the robot can move omnidirectionally. For example, the robot can use Mecanum wheels to achieve movement. The first speed component and the second speed component can be transmitted to the robot, and the robot can act according to the first speed component and the second speed component, so as to achieve the effect of acting in the action direction indicated by the target angle, the target distance, and the speed value indicated by the speed control coefficient.

[0079] The first speed component may include a first direction and a first speed value. The second speed component may include a second direction and a second speed value. The first direction may be perpendicular to the preset reference direction, and the second direction may be parallel to the preset reference direction. The first direction may be the positive or negative direction of the vertical axis in a rectangular coordinate system with the center of the circle as the origin and the preset reference direction as the horizontal axis. Whether it is the positive or negative direction specifically can be determined according to the sine function value of the target angle. The second direction may be the positive or negative direction of the horizontal axis in this rectangular coordinate system. Whether it is the positive or negative direction specifically can be determined according to the cosine function value of the target angle.

[0080] Exemplarily, the computer device can obtain a speed control coefficient, calculate the product of the sine function value of the target angle, the target distance, and the speed control coefficient, and obtain a first speed component. Among them, the absolute value of the product can represent the first speed value of the first speed component. When the product is positive, the positive direction of the vertical axis in the above rectangular coordinate system can be used as the first direction of the first speed component. When the product is negative, the negative direction of the vertical axis in the above rectangular coordinate system can be used as the first direction of the first speed component. It can be understood that if it is found during actual debugging that the coordinate system of the robot is opposite to the above rectangular coordinate system, the calculated product can be inverted to obtain the first speed component. The second speed component can be determined in a similar manner.

[0081] In this embodiment, according to the sine function value of the target angle, the target distance, and the speed control coefficient, the first speed component is determined. According to the cosine function value of the target angle, the target distance, and the speed control coefficient, the second speed component is determined. The robot's movement is controlled according to the first speed component and the second speed component. Since the sine function value is used when determining the first speed component and the cosine function value is used when determining the second speed component, the two speed components have the characteristic of being perpendicular to each other, which is convenient for corresponding to the robot's direction system, can reduce the debugging difficulty, and improve the accuracy of robot control.

[0082] In an exemplary embodiment, the target position is a coordinate in a screen coordinate system constructed with a vertex of the screen as the coordinate origin, and the preset rotation direction is the counterclockwise direction; step 206 may include: transforming the target position from the screen coordinate system to a rectangular coordinate system with the center of the control area as the origin, and obtaining a transformed coordinate corresponding to the target position; the rectangular coordinate system takes the preset reference direction as the positive direction of the horizontal axis, and takes the direction obtained by rotating the preset angle counterclockwise from the positive direction of the horizontal axis as the positive direction of the vertical axis; based on the abscissa value and the ordinate value in the transformed coordinate, determine the angle formed by the direction of the transformed coordinate relative to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis, and use the determined angle as the target angle formed by the direction of the target position relative to the center of the control area and the preset reference direction.

[0083] Among them, the preset angle can specifically be 90 degrees. Since the rectangular coordinate system takes the center of the control area as the origin, the preset reference direction as the positive direction of the horizontal axis, and the direction obtained by rotating the preset angle counterclockwise from the positive direction of the horizontal axis as the positive direction of the vertical axis, thus, after transforming the target position from the screen coordinate system to this rectangular coordinate, the angle determined based on the abscissa value and the ordinate value in the transformed coordinate is measured in the angle measurement method of rotating from the preset reference direction to the preset rotation direction.

[0084] In this direct coordinate system, after linearly mapping the relative distance between the target position and the center of the circle to the target distance between the preset regions in the subsequent step 208, the coordinate values in the transformed coordinates can be further transformed into the coordinate interval corresponding to the preset interval. For example, the preset interval can be from 0 to 0.5. Since the center of the circle is used as the origin, the coordinate interval can be from -0.5 to 0.5.

[0085] In this embodiment, by transforming the target position in the screen coordinate system into a rectangular coordinate system with the center of the control area as the origin, and the rectangular coordinate system has the preset reference direction as the positive direction of the horizontal axis and the direction obtained by rotating the positive direction of the horizontal axis counterclockwise by a preset angle as the positive direction of the vertical axis, the target angle can be determined quickly and accurately.

[0086] In an exemplary embodiment, the step of determining the angle formed by the direction of the transformed coordinates relative to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis based on the abscissa value and the ordinate value in the transformed coordinates includes: calculating an intermediate angle using the inverse trigonometric function based on the abscissa value and the ordinate value in the transformed coordinates; determining the target quadrant to which the transformed coordinates belong in the rectangular coordinate system according to the comparison results of the abscissa value and the ordinate value in the transformed coordinates with zero respectively; and processing the intermediate angle according to the target quadrant and the type of the inverse trigonometric function to obtain the angle formed by the direction of the transformed coordinates relative to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis.

[0087] Among them, the type of the inverse trigonometric function can be the inverse cosine function, the inverse sine function, the inverse tangent function or others. For the intermediate angle, for example, when the inverse trigonometric function is specifically the inverse tangent function, the abscissa value and the ordinate value in the transformed coordinates can be used as inputs, and the inverse tangent function value is calculated using the inverse tangent function, and this inverse tangent function value is used as the intermediate angle.

[0088] The rectangular coordinate system can include the first quadrant, the second quadrant, the third quadrant and the fourth quadrant, and the target quadrant can be one of them. Taking the type of the inverse trigonometric function as the inverse tangent function as an example, the method of processing the intermediate angle is described as follows: when the target quadrant is the first quadrant, the processing of the intermediate angle can be not to process it, that is, taking the intermediate angle as the angle formed by the direction of the transformed coordinates relative to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis; when the target quadrant is the second quadrant, the intermediate angle can be added with π; when the target quadrant is the third quadrant, the intermediate angle can be added with π; when the target quadrant is the fourth quadrant, the intermediate angle can be added with 2π.

[0089] In this embodiment, based on the abscissa value and the ordinate value in the transformed coordinates, the intermediate angle can be quickly obtained through the inverse trigonometric function, and then the target quadrant to which the transformed coordinates belong can be determined. Processing the intermediate angle according to the target quadrant and the type of the inverse trigonometric function can further accurately determine the final angle, that is, the target angle, which provides a basis for accurately controlling the robot subsequently.

[0090] In a specific embodiment, the above robot control method may include the following steps.

[0091] The computer device can determine the positioning area of the square on the screen; determine and display the manipulation area of the circle within the positioning area, so that the manipulation area is inscribed in the positioning area.

[0092] The computer device can, in response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area, obtain the operation position of the joystick control operation on the screen, and determine the distance between the operation position and the center of the manipulation area.

[0093] When the distance is not greater than the radius of the manipulation area, the computer device can determine that the operation position is within the manipulation area, and determine the operation position as the target position of the virtual joystick in the manipulation area.

[0094] When the distance is greater than the radius of the manipulation area, the computer device can determine that the operation position is outside the manipulation area, and determine the target position of the virtual joystick at the edge of the manipulation area according to the relative direction of the operation position with respect to the center of the manipulation area.

[0095] The computer device can transform the target position from the screen coordinate system to a rectangular coordinate system with the center of the manipulation area as the origin, and obtain the transformed coordinates corresponding to the target position; the rectangular coordinate system takes the preset reference direction as the positive direction of the horizontal axis, and takes the direction obtained by rotating the preset angle counterclockwise from the positive direction of the horizontal axis as the positive direction of the vertical axis.

[0096] The computer device can calculate the intermediate angle by using the inverse trigonometric function based on the abscissa value and the ordinate value in the transformed coordinates; determine the target quadrant to which the transformed coordinates belong in the rectangular coordinate system according to the comparison results of the abscissa value and the ordinate value in the transformed coordinates with zero respectively; process the intermediate angle according to the target quadrant and the type of the inverse trigonometric function to obtain the angle formed by the direction of the transformed coordinates with respect to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis.

[0097] The computer device can use the determined angle as the target angle formed by the direction of the target position with respect to the center of the manipulation area and the preset reference direction.

[0098] The computer device can determine the relative distance of the target position with respect to the center of the circle, and linearly map the relative distance to the target distance within the preset interval.

[0099] The computer device can obtain a speed control coefficient; determine a first speed component according to the sine function value of the target angle, the target distance, and the speed control coefficient; determine a second speed component according to the cosine function value of the target angle, the target distance, and the speed control coefficient; and control the robot's movement according to the first speed component and the second speed component.

[0100] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0101] Based on the same inventive concept, an embodiment of the present application also provides a robot control device for implementing the above-mentioned robot control method. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the robot control device provided below can refer to the limitations on the robot control method in the above text, and will not be repeated here.

[0102] In an exemplary embodiment, as Figure 3 shown, a robot control device 300 is provided, including: a manipulation area determination module 310, a joystick management module 320, and a robot control module 330, where:

[0103] The manipulation area determination module 310 is configured to determine a circular manipulation area on the screen, and the area size of the manipulation area and the screen size of the screen conform to a preset size relationship.

[0104] The joystick management module 320 is configured to, in response to a joystick control operation for controlling the position of a virtual joystick in the manipulation area, determine the target position of the virtual joystick in the manipulation area; determine the target angle formed by the direction of the target position relative to the center of the manipulation area and a preset reference direction according to an angle measurement method of rotating from a preset reference direction to a preset rotation direction; determine the relative distance of the target position relative to the center of the circle, and linearly map the relative distance to a target distance within a preset interval.

[0105] The robot control module 330 obtains a speed control coefficient and controls the movement of the robot according to the speed determined by the target angle, the target distance, and the speed control coefficient.

[0106] In an exemplary embodiment, the screen size of the screen includes the screen width and the screen height of the screen. The manipulation area determination module 310 is further configured to determine a square positioning area in the screen; the side length of the positioning area conforms to a preset size relationship with the screen width; the two coordinate values of the starting coordinate of the positioning area in the screen coordinate system of the screen are determined according to the screen width and the screen height respectively; a circular manipulation area is determined in the positioning area such that the manipulation area is inscribed in the positioning area, and the diameter of the manipulation area is the same as the side length of the area.

[0107] In an exemplary embodiment, the joystick management module 320 is further configured to, in response to a joystick control operation for controlling the position of the virtual joystick in the manipulation area, obtain the operation position of the joystick control operation in the screen; when the operation position is outside the manipulation area, determine the target position of the virtual joystick at the edge of the manipulation area according to the relative direction of the operation position with respect to the center of the manipulation area.

[0108] In an exemplary embodiment, the robot control module 330 is further configured to obtain a speed control coefficient; determine a first speed component according to the sine function value of the target angle, the target distance, and the speed control coefficient; determine a second speed component according to the cosine function value of the target angle, the target distance, and the speed control coefficient; and control the movement of the robot according to the first speed component and the second speed component.

[0109] In an exemplary embodiment, the target position is a coordinate in a screen coordinate system constructed with a vertex of the screen as the coordinate origin, and the preset rotation direction is the counterclockwise direction; the joystick management module 320 is further configured to transform the target position from the screen coordinate system to a rectangular coordinate system with the center of the manipulation area as the origin, to obtain a transformed coordinate corresponding to the target position; the rectangular coordinate system takes the preset reference direction as the positive direction of the horizontal axis, and takes the direction obtained by rotating the positive direction of the horizontal axis counterclockwise by a preset angle as the positive direction of the vertical axis; based on the abscissa value and the ordinate value in the transformed coordinate, determine the angle formed by the direction of the transformed coordinate with respect to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis, and use the determined angle as the target angle formed by the direction of the target position with respect to the center of the manipulation area and the preset reference direction.

[0110] In an exemplary embodiment, the rocker management module 320 is further configured to calculate an intermediate angle by using an inverse trigonometric function based on the abscissa value and the ordinate value in the transformed coordinates; determine the target quadrant to which the transformed coordinates belong in the rectangular coordinate system according to the comparison results of the abscissa value and the ordinate value in the transformed coordinates with zero respectively; and process the intermediate angle according to the target quadrant and the type of the inverse trigonometric function to obtain the angle formed by the direction of the transformed coordinates relative to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis.

[0111] Each module in the above robot control device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form so that the processor can call and execute the operations corresponding to the above respective modules.

[0112] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 4 shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. The computer program, when executed by the processor, implements a robot control method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the outer shell of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0113] Those skilled in the art can understand, Figure 4The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0114] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0115] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0116] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0118] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.

[0119] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.

[0120] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A robot control method, characterized in that: The method comprises: Determine a circular control area on the screen, wherein the area size of the control area and the screen size of the screen conform to a preset size relationship; In response to a joystick control operation of controlling the position of a virtual joystick in the control area, determining a target position of the virtual joystick in the control area; Determine a target angle formed by the direction of the target position relative to the center of the control area and the preset reference direction according to an angle measurement method of rotating from a preset reference direction toward a preset rotation direction; Determine a relative distance of the target position relative to the center of the circle, and linearly map the relative distance to a target distance within a preset interval; A speed control coefficient is obtained, and the robot action is controlled according to the target angle, the target distance and the speed determined by the speed control coefficient.

2. The method according to claim 1, characterized in that The screen size of the screen includes the screen width and the screen height of the screen, the area size of the control area includes the diameter of the control area, and the circular control area determined in the screen includes: A square positioning area is determined in the screen; the area side length of the positioning area and the screen width conform to a preset size relationship; two coordinate values ​​of the starting coordinates of the positioning area in the screen coordinate system of the screen are determined according to the screen width and the screen height respectively; A circular manipulation area is determined in the positioning area, such that the manipulation area is inscribed in the positioning area, and the diameter of the manipulation area is the same as the side length of the area.

3. The method according to claim 1, characterized in that The determining, in response to the joystick control operation of controlling the position of the virtual joystick in the control area, a target position of the virtual joystick in the control area comprises: In response to a joystick control operation of controlling the position of a virtual joystick in the control area, obtaining an operation position of the joystick control operation in the screen; When the operation position is outside the control area, the target position of the virtual joystick is determined at the edge of the control area according to the relative direction of the operation position with respect to the center of the control area.

4. The method according to claim 1, characterized in that: The obtaining of the speed control coefficient and controlling the robot action according to the target angle, the target distance and the speed determined by the speed control coefficient include: Get the speed control coefficient; Determining a first velocity component according to the sinusoidal function value of the target angle, the target distance and the velocity control coefficient; Determining a second velocity component according to the cosine function value of the target angle, the target distance and the velocity control coefficient; The robot is controlled to move according to the first velocity component and the second velocity component.

5. The method according to any one of claims 1 to 4, characterized in that: The target position is a coordinate in a screen coordinate system constructed with a vertex of the screen as a coordinate origin, and the preset rotation direction is a counterclockwise direction; determining a target angle formed by a direction of the target position relative to the center of the control area and the preset reference direction according to an angle measurement method of rotating from a preset reference direction toward a preset rotation direction, includes: The target position is transformed from the screen coordinate system into a rectangular coordinate system with the center of the control area as the origin, to obtain a transformed coordinate corresponding to the target position; the rectangular coordinate system has a preset reference direction as the positive direction of the horizontal axis, and a direction rotated counterclockwise from the positive direction of the horizontal axis by a preset angle as the positive direction of the vertical axis; Based on the horizontal and vertical coordinate values ​​in the transformed coordinates, determine the angle formed by the direction of the transformed coordinates relative to the coordinate origin in the rectangular coordinate system and the positive direction of the horizontal axis, and use the determined angle as the target angle formed by the direction of the target position relative to the center of the control area and the preset reference direction.

6. The method according to claim 5, characterized in that The determining, based on the abscissa value and the ordinate value in the transformed coordinate, an angle formed by the direction of the transformed coordinate relative to the origin of the coordinate in the rectangular coordinate system and the positive direction of the abscissa, comprises: Based on the abscissa value and the ordinate value in the transformed coordinate, an intermediate angle is calculated by using an inverse trigonometric function; Determining the target quadrant to which the transformed coordinates belong in the rectangular coordinate system according to the comparison results of the abscissa value and the ordinate value in the transformed coordinates with zero; The intermediate angle is processed according to the target quadrant and the type of the inverse trigonometric function to obtain an angle formed by the direction of the transformed coordinate relative to the origin of the coordinates in the rectangular coordinate system and the positive direction of the horizontal axis.

7. A robot control device, characterized in that: The device comprises: A control area determination module, used to determine a circular control area on the screen, wherein the area size of the control area and the screen size of the screen conform to a preset size relationship; a joystick management module, configured to determine a target position of the virtual joystick in the control area in response to a joystick control operation for controlling the position of the virtual joystick in the control area; determine a target angle formed by a direction of the target position relative to the center of the control area and the preset reference direction according to an angle measurement method of rotating from a preset reference direction to a preset rotation direction; determine a relative distance of the target position relative to the center of the circle, and linearly map the relative distance to a target distance within a preset interval; The robot control module obtains a speed control coefficient and controls the robot action according to the target angle, the target distance and the speed determined by the speed control coefficient.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.