Rocker calibration and operation mapping method and device, electronic equipment and storage medium

By calibrating the joystick and building a virtual rectangular area, the problem of the joystick operation not matching the screen display area is solved, improving the accuracy and user experience of the operation.

CN120161958APending Publication Date: 2025-06-17WUXI RUIQIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing mobile devices and gaming devices, the circular operating range of the rocker does not match the display area of ​​the rectangular screen, resulting in the degree of operational freedom that does not exactly match the screen utilization, affecting the user experience.

Method used

By obtaining the initial circular operation area of ​​the rocker, calibrate to obtain the calibration circular operation area, determine the aspect ratio of the screen display area corresponding to the rocker operation, build a virtual rectangular area, map the real-time rocker position to the virtual rectangular area and finally map to the screen display area.

Benefits of technology

It improves the accuracy and flexibility of rocker operation, makes the operation more in line with user intuition, and enhances the user experience, especially in application scenarios that require precise control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120161958A_ABST
    Figure CN120161958A_ABST
Patent Text Reader

Abstract

The invention discloses a rocker calibration and operation mapping method and device, electronic equipment and a storage medium, which are used for solving the technical problem that the degree of freedom of current rocker operation is not completely matched with the utilization of a screen display area. The method comprises the following steps: acquiring an initial circular operation area of a rocker; calibrating the initial circular operation area to obtain a calibrated circular operation area; determining the length-width ratio of a screen display area corresponding to the rocker operation, and constructing a virtual rectangular area of the calibrated circular operation area based on the length-width ratio; and acquiring a real-time rocker position when the user operates the rocker, calculating a virtual coordinate position of the real-time rocker position in the virtual rectangular area, and mapping the virtual coordinate position to the screen display area. Therefore, when a user actually operates the rocker, the system can quickly obtain the corresponding screen coordinates through mapping calculation and execute the corresponding operation, the problem that the current screen rocker operation is not matched with the reality is solved, and the user experience is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of operation control of mobile devices and game devices, and particularly relates to a joystick calibration and operation mapping method, device, electronic device, and storage medium. Background Art

[0002] Joysticks are widely used in game pads, flight controllers, and other occasions where coordinate input needs to be obtained. Taking a game pad as an example, by shaking the joystick, arbitrary movement of a character or an object can be controlled. However, due to influencing factors such as the difference of the joystick itself, the performance of the joystick, and the assembly error of the product, there is a large deviation between the actual position of the target object and the expected control position when the joystick is used. As a result, the user experience is poor. Therefore, how to calibrate the joystick to improve the performance of the joystick and the user experience is a problem that needs to be solved by those skilled in the art.

[0003] In existing mobile devices and game devices, the movement range of the joystick is usually circular, while the display interface is rectangular. This design results in an incomplete match between the freedom of joystick operation and the utilization of the screen display area. Especially in games and applications that require precise operation, the joystick control deviation is invisibly amplified, thus greatly affecting the user experience. Summary of the Invention

[0004] The present invention provides a joystick calibration and operation mapping method, device, electronic device, and storage medium, which are used to solve or partially solve the technical problem that the freedom of current joystick operation does not fully match the utilization of the screen display area.

[0005] The present invention provides a joystick calibration and operation mapping method, and the method includes:

[0006] Obtain the initial circular operation area of the joystick;

[0007] Calibrate the initial circular operation area to obtain a calibrated circular operation area;

[0008] Determine the aspect ratio of the length and width of the screen display area corresponding to the joystick operation, and based on the aspect ratio, construct a virtual rectangular area of the calibrated circular operation area;

[0009] Obtain the real-time joystick position when the user operates the joystick, calculate the virtual coordinate position of the real-time joystick position in the virtual rectangular area, and map the virtual coordinate position to the screen display area.

[0010] Optionally, the construction process of the initial circular operation area of the joystick includes:

[0011] Obtain the theoretical radius extreme values corresponding to the theoretical rotation operation range of the joystick;

[0012] Construct a plane rectangular coordinate system with the center of the rocker as the origin, and construct an outer regular circle according to the extreme value of the theoretical radius;

[0013] Repeat the operation of continuously rotating the rocker by the maximum angle for one week and then releasing it to return to the natural center for several times, and combine the mean value taking method to obtain the actual radius extreme value of the actual rotation operation range of the rocker;

[0014] Based on the actual radius extreme value, construct an inner regular circle within the outer regular circle, and use the outer regular circle and the inner regular circle as regular circles;

[0015] For each actual point within the actual rotation operation range of the rocker, with the origin as the starting point, the intersection of the straight line connecting the origin and the actual point and the inner regular circle is used as the first actual extreme point of the regular circle corresponding to the actual point, and the intersection with the outer regular circle is used as the first theoretical extreme point of the regular circle corresponding to the actual point;

[0016] Calibrate and compensate the actual point based on the first actual extreme point and the first theoretical extreme point, and map the initial calibrated point obtained after calibration and compensation into the regular circle;

[0017] Complete the primary calibration of all actual points to obtain the initial circular operation area of the rocker.

[0018] Optionally, calibrating the initial circular operation area to obtain a calibrated circular operation area includes:

[0019] Perform secondary calibration on all initial calibrated points within the initial circular operation area through median calibration and extreme value calibration to obtain a calibrated circular operation area.

[0020] Optionally, performing secondary calibration on all initial calibrated points within the initial circular operation area through median calibration and extreme value calibration to obtain a calibrated circular operation area includes:

[0021] Take the origin as the theoretical center return point, and obtain the maximum median value of the rotation radius of the rocker within the actual rotation operation range;

[0022] Take the maximum median value as the dead zone radius of the rocker, and construct a rocker dead zone within the regular circle; all the initial calibrated points include the first initial calibrated points located within the rocker dead zone, the second initial calibrated points located outside the rocker dead zone and within the inner regular circle, and the third initial calibrated points located outside the inner regular circle and within the outer regular circle;

[0023] Map all the first initial calibrated points to the theoretical center return point to standardize the rocker dead zone;

[0024] For each of the second initial calibration points, starting from the origin, the intersection point of the straight line passing through the origin and the second initial calibration point and the joystick dead zone is used as the actual centering point of the joystick dead zone corresponding to the second initial calibration point, the intersection point with the inner regular circle is used as the second actual extreme point of the regular circle corresponding to the second initial calibration point, and the intersection point with the outer regular circle is used as the second theoretical extreme point of the regular circle corresponding to the second initial calibration point;

[0025] Perform extreme value calibration on the second initial calibration point according to the theoretical centering point, the second theoretical extreme point, the second actual extreme point and the actual centering point, and map the obtained target calibration point to between the joystick dead zone and the inner regular circle;

[0026] For each of the third initial calibration points, starting from the origin, the intersection point of the straight line passing through the origin and the third initial calibration point and the outer regular circle is used as the third theoretical extreme point of the regular circle corresponding to the third initial calibration point;

[0027] Map each of the third initial calibration points to the corresponding third theoretical extreme point respectively to standardize the irregular circle restricted by the physical structure of the joystick device into a regular circle;

[0028] Complete the secondary calibration of all the initial calibration points to obtain the calibrated circular operation area.

[0029] Optionally, calculating the virtual coordinate position of the real-time joystick position in the virtual rectangular area includes:

[0030] Starting from the center of the calibrated circular operation area, construct a position vector of the real-time joystick position, calculate the vector length of the position vector, and calculate the angle between the position vector and the positive x-axis direction;

[0031] Construct a straight line equation passing through the center of the calibrated circular operation area and the real-time joystick position, and solve the slope of the straight line equation;

[0032] Take the intersection point of the straight line equation and the virtual rectangular area in the same direction as the position vector as the rectangular boundary point;

[0033] Calculate the boundary distance from the rectangular boundary point to the center of the calibrated circular operation area;

[0034] Calculate the vector scaling coefficient according to the boundary distance and the theoretical radius extreme value, and calculate the scaled distance according to the scaling coefficient and the vector length;

[0035] Calculate the scaled ordinate and abscissa of the coordinate position respectively according to the included angle and the scaled distance, and use them as the virtual coordinate position of the real-time joystick position in the virtual rectangular area.

[0036] Optionally, constructing the virtual rectangular area of the calibrated circular operation area based on the aspect ratio includes:

[0037] Taking the center of the calibrated circular operation area as the center of the virtual rectangular area, and constructing the virtual rectangular area according to the aspect ratio and the diameter value of the calibrated circular operation area.

[0038] Optionally, constructing the virtual rectangular area according to the aspect ratio and the diameter value of the calibrated circular operation area includes:

[0039] Taking the diameter value of the calibrated circular operation area as the width value or the height value of the virtual rectangular area;

[0040] When the diameter value of the calibrated circular operation area is used as the first width value of the virtual rectangular area, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in the portrait orientation. At this time, determine the first height value of the virtual rectangular area based on the aspect ratio, and construct the virtual rectangular area according to the first width value and the first height value;

[0041] When the diameter value of the calibrated circular operation area is used as the second height value of the virtual rectangular area, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in the landscape orientation. At this time, determine the second width value of the virtual rectangular area based on the aspect ratio, and construct the virtual rectangular area according to the second height value and the second width value.

[0042] The present invention also provides a joystick calibration and operation mapping device, including:

[0043] A circular operation area acquisition unit, configured to acquire the initial circular operation area of the joystick;

[0044] A circular operation area calibration unit, configured to calibrate the initial circular operation area to obtain a calibrated circular operation area;

[0045] A virtual rectangular area construction unit, configured to determine the aspect ratio of the screen display area corresponding to the joystick operation, and construct the virtual rectangular area of the calibrated circular operation area based on the aspect ratio;

[0046] A virtual coordinate position conversion unit, configured to acquire the real-time joystick position when the user operates the joystick, calculate the virtual coordinate position of the real-time joystick position in the virtual rectangular area, and map the virtual coordinate position to the screen display area.

[0047] The present invention also provides an electronic device, which includes a processor and a memory:

[0048] The memory is used to store program codes and transmit the program codes to the processor;

[0049] The processor is used to execute the joystick calibration and operation mapping method as described in any one of the above according to the instructions in the program codes.

[0050] The present invention also provides a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the joystick calibration and operation mapping method as described in any one of the above.

[0051] As can be seen from the above technical solutions, the present invention has the following advantages:

[0052] A joystick calibration and operation mapping method is provided. First, the initial circular operation area of the joystick is obtained, and the initial circular operation area is calibrated to obtain a calibrated circular operation area, so as to obtain a more accurate circular operation area through further calibration, making the subsequent mapping calculation more accurate; the aspect ratio of the length and width of the screen display area corresponding to the joystick operation is determined, and based on the aspect ratio, a virtual rectangular area of the calibrated circular operation area is constructed, so that the circular operation area of the joystick is converted into a rectangular area that better matches the actual screen by using the aspect ratio of the screen, enabling the subsequent actual operation of the joystick to be dynamically adjusted according to the aspect ratio of the screen and realizing accurate mapping of the operation; the real-time joystick position when the user operates the joystick is obtained, the virtual coordinate position of the real-time joystick position in the virtual rectangular area is calculated, and the virtual coordinate position is mapped to the screen display area, so that when the user actually operates the joystick, the system can quickly obtain the corresponding screen coordinates through mapping calculation and execute the corresponding operations, greatly improving the user experience. Description of the Drawings

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0054] Figure 1 It is a step flow chart of a joystick calibration and operation mapping method;

[0055] Figure 2 It is a point position diagram when calibrating and compensating the actual point position of the joystick taking the x-axis as an example;

[0056] Figure 3 It is a schematic diagram of the points when the median and extreme value calibration is performed taking the left half of the x-axis as an example;

[0057] Figure 4 A schematic diagram of constructing a virtual rectangular area when the screen display area is in landscape mode;

[0058] Figure 5 A schematic diagram of a process for calculating the virtual coordinate position of the real-time joystick position in the virtual rectangular area;

[0059] Figure 6 The present invention is a structural block diagram of a joystick calibration and operation mapping device. DETAILED DESCRIPTION

[0060] The embodiments of the present invention provide a joystick calibration and operation mapping method, device, electronic device and storage medium, which are used to solve or partially solve the technical problem that the current degree of freedom of joystick operation and the utilization of screen display area are not completely matched.

[0061] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below 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] As an example, in existing mobile devices and gaming devices, the range of movement of the joystick is usually circular, while the display interface is rectangular. This design results in the incomplete matching of the degree of freedom of joystick operation with the utilization of the screen display area. Especially in games and applications that require precise operation, the joystick control deviation is invisibly magnified, thus greatly affecting the user experience.

[0063] Therefore, one of the core inventive points of the embodiment of the present invention is: in view of the shortcomings of the current technology, a joystick calibration and operation mapping method is provided. Through coordinate transformation and dynamic adjustment of the mapping algorithm, the circular operation area of ​​the joystick is converted into a rectangular area that matches the aspect ratio of the screen, so that the operation of the joystick can be dynamically adjusted according to the aspect ratio of the screen to achieve accurate mapping of the operation. The technical solution provided by the present invention can, on the one hand, improve the accuracy, flexibility and real-time responsiveness of the joystick operation, making the operation more in line with the user's intuition. On the other hand, it can also enhance the user experience, especially in application scenarios that require precise control.

[0064] Reference Figure 1, which shows the step flow chart of a rocker calibration and operation mapping method provided by an embodiment of the present invention, may specifically include the following steps:

[0065] Step 101, obtain the initial circular operation area of the rocker;

[0066] In this step, the initial circular operation area of the rocker is obtained for subsequent calibration of the circular operation area. Before executing this step, the actual physical quantity of the rocker can be mapped to a regular circle through a calibration compensation algorithm to construct the initial circular operation area of the rocker. Exemplarily, Figure 2 shows a point position schematic diagram when calibrating and compensating the actual point position of the rocker taking the x-axis as an example.

[0067] Combined with Figure 2 , in some embodiments, the construction process of the initial circular operation area of the rocker can be realized by executing the following sub-steps S01 to S07:

[0068] Step S01: Obtain the theoretical radius extreme values corresponding to the theoretical rotation operation range of the rocker;

[0069] The theoretical radius extreme values can also be understood as belonging to the data reported by the tooling theory. During the calibration process, the tooling theory refers to the basic theory, principles, and methodologies used to guide and execute the calibration work. The data reported by the tooling theory refers to the data required in this process. Such as the theoretical radius extreme values used to construct the outer regular circle , such as Figure 2 the outer regular circle corresponding to the blue solid line in , and the theoretical minimum value on the x-axis and the theoretical maximum value . The distance from the center of the rocker to the theoretical minimum value , or the distance to the theoretical maximum value is the theoretical radius extreme value . Among them, the theoretical radius extreme value

[0070] is the ADC (Analog-to-Digital Converter) sampling value defined according to the rocker spec (referring to a series of indicators and characteristics describing the performance and technical parameters of the rocker), and the typical value is 4096. This value can be modified according to the specifications of different rockers.

[0071] The constructed outer regular circle is as shown by the blue solid line in Figure 2 .

[0072] Step S03: Repeat the operation of continuously rotating the joystick one full circle at the maximum angle and then releasing it to return to the neutral position several times. Combining with the mean value extraction method, obtain the actual radius extreme value of the actual rotation operation range of the joystick.

[0073] Specifically, the joystick can be rotated to the maximum angle and then continuously rotated one full circle, and then the joystick is released to return to the neutral position naturally to obtain the extreme value for a single time. And the median . Repeat this step five times to obtain the mean value of the extreme values And the maximum value of the median . Take the mean value of the extreme values As the actual radius extreme value of the actual rotation operation range of the joystick. The minimum value of the actual radius extreme value On the x-axis is the actual minimum value , and the maximum value is the actual maximum value . The distance from the center of the joystick to the actual minimum value , or to the actual maximum value Is the actual radius extreme value .

[0074] Step S04: Based on the actual radius extreme value, construct an inner regular circle within the outer regular circle, and use the outer regular circle and the inner regular circle as regular circles;

[0075] The constructed inner regular circle is as shown by the black dashed line in Figure 2 . The point data on the inner regular circle can also be understood as the data obtained after preliminary calibration.

[0076] Step S05: For each actual point within the actual rotation operation range of the joystick, with the origin as the starting point, the intersection of the line connecting the origin and the actual point and the inner regular circle is used as the first actual extreme point of the regular circle corresponding to the actual point, and the intersection with the outer regular circle is used as the first theoretical extreme point of the regular circle corresponding to the actual point;

[0077] Such as the orange point in Figure 2 . Assuming the value of the actual point On the x-axis is , Figure 2 The intersection of the extension line of the line segment in Figure 2 And the inner regular circle (the × in the black dashed line in Figure 2 ) is the first actual extreme point, and the intersection with the outer regular circle (the × in the blue solid line in ) is the first theoretical extreme point. Assuming the minimum and maximum values of the first actual extreme point on the x-axis are respectively , . The minimum and maximum values of the first theoretical extreme point on the x-axis are respectively .

[0078] Step S06: Calibrate and compensate the actual position based on the first actual extreme point and the first theoretical extreme point, and map the obtained initial calibrated position to within the regular circle;

[0079] Construct the initial calibrated position The calibration equation on the x-axis is: .

[0080] Among them, the calibration coefficient ; the deviation .

[0081] When , it means that the tooling setting interval is equal to the calibration interval [100, 300].

[0082] When , it means that the tooling setting interval is greater than the calibration interval [110, 290].

[0083] When , it means that the tooling setting interval is less than the calibration interval [90, 300].

[0084] When the tooling setting interval is not equal to the calibration interval [100, 300], the tooling setting interval can be finely adjusted through the calibration compensation algorithm to meet the calibration interval requirements.

[0085] Finally, the value of the initial calibrated position on the x-axis is:

[0086]

[0087] The calculation of the calibration value of the initial calibrated position on the y-axis can be carried out by referring to the foregoing steps and will not be elaborated here.

[0088] Step S07: Complete the primary calibration of all actual positions to obtain the initial circular operation area of the rocker.

[0089] Step 102, calibrate the initial circular operation area to obtain the calibrated circular operation area;

[0090] In this step, mainly achieve standardizing the centering position (i.e., the dead zone of the rocker) of the rocker through median calibration, unifying the centering position coordinates, and at the same time standardizing the irregular circle restricted by the physical structure of the rocker device into a regular circle through extreme value calibration.

[0091] Then calibrate the initial circular operation area to obtain the calibrated circular operation area, specifically: perform secondary calibration on all initial calibrated positions within the initial circular operation area through median calibration and extreme value calibration to obtain the calibrated circular operation area.

[0092] Exemplarily, Figure 3 A point position schematic diagram for median and extreme value calibration is shown taking the left half region of the x-axis as an example.

[0093] Combined with Figure 3 , in some embodiments, the process of obtaining the calibrated circular operation area by performing secondary calibration on all initial calibration points in the initial circular operation area through median calibration and extreme value calibration can be achieved by executing the following sub-steps S11 to S18:

[0094] Step S11: Take the origin as the theoretical centering point, and obtain the maximum median value of the rotation radius of the joystick within the actual rotation operation range;

[0095] Take the origin (i.e., the center of the regular circle) as the theoretical centering point , and the maximum median value of the rotation radius of the joystick within the actual rotation operation range is .

[0096] Step S12: Take the maximum median value as the dead zone radius of the joystick, and construct a joystick dead zone within the regular circle;

[0097] Take the maximum median value as the dead zone radius of the joystick, and construct a joystick dead zone within the regular circle (as shown by the gray area in Figure 3 ). The actual centering point corresponding to the maximum median value on the x-axis is .

[0098] For the convenience of subsequent calculations, all initial calibration points within the regular circle are divided into the first initial calibration points located within the joystick dead zone, the second initial calibration points located outside the joystick dead zone and within the inner regular circle, and the third initial calibration points located outside the inner regular circle and within the outer regular circle (which can also be understood as irregular circle points).

[0099] Step S13: Map all the first initial calibration points to the theoretical centering point to standardize the joystick dead zone;

[0100] Step S14: For each second initial calibration point, starting from the origin, take the intersection point of the line connecting the origin and the second initial calibration point with the joystick dead zone as the actual centering point of the second initial calibration point corresponding to the joystick dead zone, the intersection point with the inner regular circle as the second actual extreme value point of the second initial calibration point corresponding to the regular circle, and the intersection point with the outer regular circle as the second theoretical extreme value point of the second initial calibration point corresponding to the regular circle;

[0101] Step S15: Perform extreme value calibration on the second initial calibration points according to the theoretical centering point, the second theoretical extreme value point, the second actual extreme value point, and the actual centering point, and map the obtained target calibration points to between the joystick dead zone and the inner regular circle;

[0102] Step S16: For each third initial calibration point, with the origin as the starting point, the intersection point of the line connecting the origin and the third initial calibration point and the outer regular circle is used as the third theoretical extreme point of the regular circle corresponding to the third initial calibration point;

[0103] Step S17: Map each third initial calibration point to its corresponding third theoretical extreme point to standardize the irregular circle restricted by the physical structure of the rocker device into a regular circle;

[0104] Step S18: Complete the secondary calibration of all initial calibration points to obtain the calibrated circular operation area.

[0105] For easy understanding, take the points on the left half of the x-axis as the initial calibration points as an example for a brief description. Assume the initial calibration points that need to be calibrated The value is .

[0106] When , Is within the dead zone of the rocker, and at this time there is , to standardize the points within the dead zone of the rocker.

[0107] When , Is outside the dead zone of the rocker and within the inner regular circle, and at this time there is .

[0108] Among them, the calibration coefficient , the deviation . Thus, further calibration of the points within the dead zone of the rocker and the area of the inner regular circle is achieved, making the subsequent point conversion calculation more accurate.

[0109] When , Is outside the inner regular circle and within the outer regular circle, that is, at the irregular circle, and at this time there is . Thus, through boundary calibration, the irregular circle restricted by the physical structure of the rocker device is standardized into a regular circle.

[0110] Step 103, determine the aspect ratio of the length and width of the screen display area corresponding to the rocker operation, and based on the aspect ratio, construct a virtual rectangular area of the calibrated circular operation area;

[0111] Determine the aspect ratio of the screen display area, that is, the ratio of the screen width to the height. Then divide the calibrated circular operation area of the rocker into virtual rectangular areas corresponding to the aspect ratio of the screen length and width.

[0112] Further, based on the aspect ratio, a virtual rectangular area of the calibrated circular operation area can be constructed as follows: taking the center of the calibrated circular operation area as the center of the virtual rectangular area, and constructing the virtual rectangular area according to the aspect ratio and the diameter value of the calibrated circular operation area.

[0113] In some embodiments, the process of constructing the virtual rectangular area according to the aspect ratio and the diameter value of the calibrated circular operation area can be specifically as follows:

[0114] First, take the diameter value of the calibrated circular operation area as the width value or height value of the virtual rectangular area.

[0115] When the diameter value of the calibrated circular operation area is used as the first width value of the virtual rectangular area, and at this time the screen is in the portrait form, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in the portrait form. At this time, determine the first height value of the virtual rectangular area based on the aspect ratio, and construct the virtual rectangular area according to the first width value and the first height value.

[0116] When the diameter value of the calibrated circular operation area is used as the second height value of the virtual rectangular area, and at this time the screen is in the landscape form, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in the landscape form. At this time, determine the second width value of the virtual rectangular area based on the aspect ratio, and construct the virtual rectangular area according to the second height value and the second width value. The schematic diagram of constructing the virtual rectangular area when the screen display area is in the landscape form is as Figure 4 shown.

[0117] For both portrait or landscape operations, the corresponding virtual rectangular area can be constructed based on the calibrated circular operation area and the corresponding aspect ratio. Thus, the mapping algorithm can be dynamically adjusted according to the screen orientation (landscape or portrait) to adapt to different usage scenarios. When the screen orientation changes, the algorithm can perform coordinate mapping based on the new width and height, increasing the flexibility of the joystick operation.

[0118] Step 104, obtain the real-time joystick position when the user operates the joystick, calculate the virtual coordinate position of the real-time joystick position in the virtual rectangular area, and map the virtual coordinate position to the screen display area.

[0119] In this step, it mainly realizes calculating the virtual coordinate position of the user's joystick operation position in the virtual rectangular area and mapping the virtual coordinate position to the corresponding position in the screen display area.

[0120] In some embodiments, combined with Figure 5 , the process of calculating the virtual coordinate position of the real-time joystick position in the virtual rectangular area can be realized by executing the following sub-steps S21 to S26:

[0121] Step S21: Taking the center of the calibrated circular operation area as the starting point, construct the position vector of the real-time joystick position, calculate the vector length of the position vector, and calculate the angle between the position vector and the positive x-axis direction;

[0122] Assume the real-time joystick position is , first, the position vector can be constructed, as shown in (a) of . Calculate the vector length Figure 5 of the position vector , as shown in (b) of . And calculate the angle Figure 5 between and the positive x-axis direction , as shown in (c) of Figure 5 .

[0123] Step S22: Construct the straight-line equation passing through the center of the calibrated circular operation area and the real-time joystick position, and solve for the slope of the straight-line equation;

[0124] Construct the straight-line equation passing through the center of the calibrated circular operation area and the real-time joystick position , as shown in (d) of . And calculate the slope of the straight-line equation through the following formula: Figure 5

[0125]

[0126] Step S23: Take the intersection point of the straight-line equation in the same direction as the position vector and the virtual rectangular area as the rectangular boundary point;

[0127] Calculate the intersection point of and the virtual rectangular area. Assume the width of the virtual rectangular area is , and the height is . The intersection point positions of the left, right, upper, and lower boundaries can be calculated and judged in the following way by combining the theoretical radius extreme value and the slope .

[0128] Left boundary: , ; when , the intersection point is inside the rectangle.

[0129] Right boundary: , ; when , the intersection point is inside the rectangle.

[0130] Upper boundary: , ; When the intersection point is inside the rectangle.

[0131] Lower boundary: , ; When the intersection point is inside the rectangle.

[0132] Select the intersection point in the same direction as .

[0133] Step S24: Calculate the boundary distance from the rectangle boundary point to the center of the calibrated circular operation area;

[0134] Calculate to distance as shown in (e) of Figure 5 .

[0135] Step S25: Calculate the vector scaling coefficient according to the boundary distance and the extreme value of the theoretical radius, and calculate the scaled distance according to the scaling coefficient and the vector length;

[0136] Calculate the vector scaling coefficient as shown in (f) of Figure 5 . Calculate the scaled distance as shown in (g) of Figure 5 .

[0137] Step S26: Calculate the scaled ordinate and abscissa of the coordinate position respectively according to the included angle and the scaled distance, and use them as the virtual coordinate position of the real-time joystick position in the virtual rectangular area.

[0138] According to the included angle and the scaled distance , calculate the new coordinate point . Among them, , .

[0139] Finally, any point on the circle can be mapped to the point in the virtual rectangular area without changing the angle. Map to the screen display area.

[0140] In an embodiment of the present invention, a method for rocker calibration and operation mapping is provided. Through coordinate transformation and dynamic adjustment of the mapping algorithm, the circular operation area of the rocker is converted into a rectangular area that matches the aspect ratio of the screen, so that the operation of the rocker can be dynamically adjusted according to the aspect ratio of the screen, realizing accurate mapping of the operation. By adopting the technical solution provided by the present invention, on the one hand, the accuracy, flexibility and real-time responsiveness of the rocker operation can be improved, making the operation more in line with the user's intuition. On the other hand, the user experience can also be enhanced, especially in application scenarios that require precise control.

[0141] Referring to Figure 6 , a structural block diagram of a rocker calibration and operation mapping device provided by an embodiment of the present invention is shown, which may specifically include:

[0142] A circular operation area acquisition unit 601, configured to acquire the initial circular operation area of the rocker;

[0143] A circular operation area calibration unit 602, configured to calibrate the initial circular operation area to obtain a calibrated circular operation area;

[0144] A virtual rectangular area construction unit 603, configured to determine the aspect ratio of the screen display area corresponding to the rocker operation, and based on the aspect ratio, construct a virtual rectangular area of the calibrated circular operation area;

[0145] A virtual coordinate position conversion unit 604, configured to acquire the real-time rocker position when the user operates the rocker, calculate the virtual coordinate position of the real-time rocker position in the virtual rectangular area, and map the virtual coordinate position to the screen display area.

[0146] In an alternative embodiment, the device further includes:

[0147] A theoretical radius extreme value acquisition unit, configured to acquire the theoretical radius extreme values corresponding to the theoretical rotation operation range of the rocker;

[0148] An outer ring regular circle construction unit, configured to construct a plane rectangular coordinate system with the center of the rocker as the origin, and construct an outer ring regular circle according to the theoretical radius extreme values;

[0149] An actual radius extreme value acquisition unit, configured to repeatedly execute the operation of rotating the rocker continuously for one week at the maximum angle and then releasing it to return to the natural position, and combine the mean value taking method to obtain the actual radius extreme values of the actual rotation operation range of the rocker;

[0150] A regular circle construction unit, configured to construct an inner ring regular circle within the outer ring regular circle based on the actual radius extreme values, and use the outer ring regular circle and the inner ring regular circle as regular circles;

[0151] An actual position calculation unit, for each actual position within the actual rotation operation range of the joystick, taking the origin as the starting point, using the intersection point of the line connecting the origin and the actual position and the inner regular circle as the first actual extreme point of the regular circle corresponding to the actual position, and the intersection point of the line connecting the origin and the actual position and the outer regular circle as the first theoretical extreme point of the regular circle corresponding to the actual position;

[0152] A calibration compensation and mapping unit, for calibrating and compensating the actual position based on the first actual extreme point and the first theoretical extreme point, and mapping the initially calibrated position obtained after calibration compensation into the regular circle;

[0153] An initial circular operation area obtaining unit, for completing one-time calibration of all actual positions to obtain the initial circular operation area of the joystick.

[0154] In an alternative embodiment, the circular operation area calibration unit 602 includes:

[0155] A secondary calibration unit, for performing secondary calibration on all initially calibrated positions within the initial circular operation area through median calibration and extreme value calibration to obtain the calibrated circular operation area.

[0156] In an alternative embodiment, the secondary calibration unit includes:

[0157] A median maximum value obtaining unit, for taking the origin as the theoretical centering value point and obtaining the median maximum value of the rotation radius of the joystick within the actual rotation operation range;

[0158] A joystick dead zone construction unit, for taking the median maximum value as the joystick dead zone radius and constructing a joystick dead zone within the regular circle; all the initially calibrated positions include first initially calibrated positions located within the joystick dead zone, second initially calibrated positions located outside the joystick dead zone and within the inner regular circle, and third initially calibrated positions located outside the inner regular circle and within the outer regular circle;

[0159] A median calibration unit, for mapping all the first initially calibrated positions to the theoretical centering value point to standardize the joystick dead zone;

[0160] A second initially calibrated position data determination unit, for each of the second initially calibrated positions, taking the origin as the starting point, using the intersection point of the line connecting the origin and the second initially calibrated position and the joystick dead zone as the actual centering value point of the second initially calibrated position corresponding to the joystick dead zone, the intersection point of the line connecting the origin and the second initially calibrated position and the inner regular circle as the second actual extreme point of the regular circle corresponding to the second initially calibrated position, and the intersection point of the line connecting the origin and the second initially calibrated position and the outer regular circle as the second theoretical extreme point of the regular circle corresponding to the second initially calibrated position;

[0161] An extreme value calibration unit, configured to perform extreme value calibration on the second initial calibration position according to the theoretical centering point, the second theoretical extreme point, the second actual extreme point, and the actual centering point, and map the obtained target calibration position after calibration between the rocker dead zone and the inner regular circle;

[0162] A third theoretical extreme point determination unit, configured to, for each of the third initial calibration positions, with the origin as the starting point, use the intersection point of the straight line where the origin and the third initial calibration position are located and the outer regular circle as the third theoretical extreme point of the regular circle corresponding to the third initial calibration position;

[0163] A third theoretical extreme point mapping unit, configured to map each of the third initial calibration positions to the corresponding third theoretical extreme point respectively, so as to standardize the irregular circle restricted by the physical structure of the rocker device into a regular circle;

[0164] A calibrated circular operation area obtaining unit, configured to complete the secondary calibration of all initial calibration positions and obtain a calibrated circular operation area.

[0165] In an alternative embodiment, the virtual coordinate position conversion unit 604 includes:

[0166] A position vector and included angle calculation unit, configured to, with the center of the calibrated circular operation area as the starting point, construct a position vector of the real-time rocker position, calculate the vector length of the position vector, and calculate the included angle between the position vector and the positive direction of the x-axis;

[0167] A straight line equation construction and slope solving unit, configured to construct a straight line equation passing through both the center of the calibrated circular operation area and the real-time rocker position, and solve the slope of the straight line equation;

[0168] A rectangular boundary point determination unit, configured to use the intersection point of the straight line equation in the same direction as the position vector and the virtual rectangular area as the rectangular boundary point;

[0169] A boundary distance calculation unit, configured to calculate the boundary distance from the rectangular boundary point to the center of the calibrated circular operation area;

[0170] A scaled distance calculation unit, configured to calculate a vector scaling coefficient according to the boundary distance and the theoretical radius extreme value, and calculate a scaled distance according to the scaling coefficient and the vector length;

[0171] A virtual coordinate position calculation unit, configured to calculate the scaled ordinate and abscissa of the coordinate position respectively according to the included angle and the scaled distance, as the virtual coordinate position of the real-time rocker position in the virtual rectangular area.

[0172] In an alternative embodiment, the virtual rectangular area construction unit 603 is specifically configured to:

[0173] Use the center of the calibrated circular operation area as the center of the virtual rectangular area, and construct the virtual rectangular area according to the aspect ratio and the diameter value of the calibrated circular operation area.

[0174] In an alternative embodiment, the virtual rectangular area construction unit 603 is specifically configured to:

[0175] Use the diameter value of the calibrated circular operation area as the width value or the height value of the virtual rectangular area;

[0176] When the diameter value of the calibrated circular operation area is used as the first width value of the virtual rectangular area, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in the portrait orientation. At this time, determine the first height value of the virtual rectangular area based on the aspect ratio, and construct the virtual rectangular area according to the first width value and the first height value;

[0177] When the diameter value of the calibrated circular operation area is used as the second height value of the virtual rectangular area, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in the landscape orientation. At this time, determine the second width value of the virtual rectangular area based on the aspect ratio, and construct the virtual rectangular area according to the second height value and the second width value.

[0178] For the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, please refer to the partial description of the foregoing method embodiment.

[0179] It should be noted that, in order to enable those skilled in the art to better distinguish data of the same type but with different actual reference meanings, in the embodiments of the present invention, some technical features are distinguished and described using terms such as first and second. The terms first, second, etc. are only used for data distinction and have no other special meanings. It can be understood that the present invention makes no limitation in this regard.

[0180] The embodiments of the present invention further provide an electronic device, which includes a processor and a memory:

[0181] The memory is used to store program code and transmit the program code to the processor;

[0182] The processor is used to execute the joystick calibration and operation mapping method of any embodiment of the present invention according to the instructions in the program code.

[0183] An embodiment of the present invention also provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the rocker calibration and operation mapping method according to any embodiment of the present invention.

[0184] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0185] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0186] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0188] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.

[0189] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A joystick calibration and operation mapping method, characterized in that: include: Get the initial circular operation area of ​​the joystick; Calibrate the initial circular operation area to obtain a calibrated circular operation area; Determine the aspect ratio of the screen display area corresponding to the joystick operation, and construct a virtual rectangular area of ​​the calibrated circular operation area based on the aspect ratio; The real-time joystick position when the user operates the joystick is obtained, the virtual coordinate position of the real-time joystick position in the virtual rectangular area is calculated, and the virtual coordinate position is mapped to the screen display area.

2. The joystick calibration and operation mapping method according to claim 1, characterized in that: The construction process of the initial circular operation area of ​​the joystick includes: Get the theoretical radius extreme value corresponding to the theoretical rotation operation range of the joystick; A plane rectangular coordinate system is constructed with the center of the joystick as the origin, and an outer regular circle is constructed according to the theoretical radius extreme value; Repeat the operation of rotating the joystick for one circle at the maximum angle for several times and then releasing it to return to the center naturally, and obtain the actual radius extreme value of the actual rotation operation range of the joystick in combination with the average value method; Based on the actual radius extreme value, construct an inner regular circle within the outer regular circle, and use the outer regular circle and the inner regular circle as regular circles; For each actual point of the rocker within the actual rotation operation range, take the origin as the starting point, take the intersection of the origin, the straight line where the actual point is located and the inner circle regular circle as the first actual extreme point of the regular circle corresponding to the actual point, and the intersection of the outer circle regular circle as the first theoretical extreme point of the regular circle corresponding to the actual point; Performing calibration compensation on the actual point based on the first actual extreme point and the first theoretical extreme point, and mapping the initial calibration point obtained after calibration compensation into the regular circle; A calibration of all actual points is completed to obtain the initial circular operating area of ​​the joystick.

3. The joystick calibration and operation mapping method according to claim 2, characterized in that: The step of calibrating the initial circular operation area to obtain a calibrated circular operation area includes: All initial calibration points in the initial circular operation area are recalibrated by median calibration and extreme value calibration to obtain a calibrated circular operation area.

4. The joystick calibration and operation mapping method according to claim 3, characterized in that: The performing secondary calibration on all initial calibration points in the initial circular operation area through median calibration and extreme value calibration to obtain a calibrated circular operation area includes: The origin is used as a theoretical median point, and the median maximum value of the rotation radius of the joystick within the actual rotation operation range is obtained; The maximum median value is used as the joystick dead zone radius, and the joystick dead zone is constructed within the regular circle; all the initial calibration points include a first initial calibration point located within the joystick dead zone, a second initial calibration point located outside the joystick dead zone and within the inner regular circle, and a third initial calibration point located outside the inner regular circle and within the outer regular circle; Mapping all the first initial calibration points to the theoretical median point to normalize the joystick dead zone; For each second initial calibration point, taking the origin as the starting point, the intersection of the origin, the straight line where the second initial calibration point is located, and the joystick dead zone is taken as the actual median point of the joystick dead zone corresponding to the second initial calibration point, the intersection of the origin and the inner circle as the second actual extreme point of the regular circle corresponding to the second initial calibration point, and the intersection of the origin and the outer circle as the second theoretical extreme point of the regular circle corresponding to the second initial calibration point; Performing extreme value calibration on the second initial calibration point according to the theoretical return to median point, the second theoretical extreme value point, the second actual extreme value point and the actual return to median point, and mapping the target calibration point obtained after calibration to between the joystick dead zone and the inner regular circle; For each of the third initial calibration points, taking the origin as the starting point, the intersection of the origin, the straight line where the third initial calibration point is located, and the outer regular circle is taken as the third theoretical extreme point of the regular circle corresponding to the third initial calibration point; Mapping each of the third initial calibration points to a corresponding third theoretical extreme point, so as to normalize the irregular circle affected by the physical structure of the rocker device into a regular circle; Complete the secondary calibration of all initial calibration points to obtain the calibrated circular operating area.

5. The joystick calibration and operation mapping method according to any one of claims 2 to 4, characterized in that: The calculating the virtual coordinate position of the real-time joystick position in the virtual rectangular area includes: Taking the center of the calibrated circular operating area as the starting point, constructing the position vector of the real-time joystick position, calculating the vector length of the position vector, and calculating the angle between the position vector and the positive direction of the x-axis; Constructing a straight line equation that passes through the center of the circular operating area after calibration and the real-time joystick position, and solving the slope of the straight line equation; The intersection of the straight line equation and the virtual rectangular area in the same direction as the position vector is taken as a rectangle boundary point; Calculating the boundary distance from the rectangular boundary point to the center of the calibrated circular operation area; Calculating a vector scaling factor according to the boundary distance and the theoretical radius extreme value, and calculating a scaled distance according to the scaling factor and the vector length; According to the included angle and the scaled distance, the scaled ordinate and the scaled abscissa of the coordinate position are respectively calculated as the virtual coordinate position of the real-time joystick position in the virtual rectangular area.

6. The joystick calibration and operation mapping method according to claim 1, characterized in that: The step of constructing a virtual rectangular area of ​​the calibrated circular operating area based on the aspect ratio includes: The center of the calibrated circular operation area is used as the center of the virtual rectangular area, and a virtual rectangular area is constructed according to the aspect ratio and the diameter value of the calibrated circular operation area.

7. The joystick calibration and operation mapping method according to claim 6, characterized in that: The step of constructing a virtual rectangular area according to the aspect ratio and the diameter value of the calibrated circular operating area includes: Using the diameter value of the calibrated circular operating area as the width value, or the height value, of the virtual rectangular area; When the diameter value of the calibrated circular operation area is used as the first width value of the virtual rectangular area, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in a vertical screen, and the first height value of the virtual rectangular area is determined based on the aspect ratio, and the virtual rectangular area is constructed according to the first width value and the first height value; When the diameter value of the calibrated circular operation area is used as the second height value of the virtual rectangular area, the aspect ratio is the ratio of the screen width to the screen height when the screen display area is in landscape mode. At this time, the second width value of the virtual rectangular area is determined based on the aspect ratio, and the virtual rectangular area is constructed according to the second height value and the second width value.

8. A joystick calibration and operation mapping device, characterized in that: include: A circular operation area acquisition unit, used to acquire an initial circular operation area of ​​the joystick; A circular operation area calibration unit, used to calibrate the initial circular operation area to obtain a calibrated circular operation area; A virtual rectangular area construction unit, used to determine the aspect ratio of the screen display area corresponding to the joystick operation, and construct a virtual rectangular area of ​​the calibrated circular operation area based on the aspect ratio; The virtual coordinate position conversion unit is used to obtain the real-time joystick position when the user operates the joystick, calculate the virtual coordinate position of the real-time joystick position in the virtual rectangular area, and map the virtual coordinate position to the screen display area.

9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the joystick calibration and operation mapping method according to any one of claims 1 to 7 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the joystick calibration and operation mapping method according to any one of claims 1 to 7.