Methods, devices, and electronic equipment for generating the trajectory of a ball.
By using offline trajectory fragments and binary tree search in the generation of ball motion trajectory, the contradiction between realism and computational consumption in the prior art is resolved, and ball motion prediction with high realism and low energy consumption is achieved.
Patent Information
- Application Number
- CN202310459617.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-24
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-04-24
AI Technical Summary
Existing technologies for simulating ball trajectories suffer from either high real-time computational costs for high-fidelity simulations or insufficient prediction accuracy for low-fidelity simulations.
By acquiring initial motion data, trajectory segments obtained from simulation calculations are determined from a preset offline trajectory set, and the final trajectory of the target ball is generated by combining binary tree search technology.
While ensuring the realism of the trajectory, the performance consumption of real-time calculation was reduced, and a high degree of realism in ball motion prediction was achieved.
Smart Images

Figure CN116764226B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game design technology, and in particular to a method, apparatus, and electronic device for generating the trajectory of a ball. Background Technology
[0002] In ball games, it's necessary to simulate and predict the ball's trajectory in various motions. One approach, given the forces acting on the ball, is to use simulated physics formulas to calculate in real-time the changes in these forces and their impact on the ball's motion, obtaining parameters such as velocity and acceleration, and ultimately, the complete trajectory. This method offers high realism, but predicting the ball's motion at a future moment requires sequentially calculating all its states, leading to significant performance overhead. To reduce performance overhead, another approach often uses stretched Bézier curves to simulate the ball's trajectory. This method provides lower performance overhead for predicting ball motion, but its realism is lower. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, and electronic device for generating the trajectory of a ball, so as to reduce the performance consumption of predicting the ball's motion while ensuring the realism of the ball's trajectory.
[0004] In a first aspect, the present invention provides a method for generating the trajectory of a ball, the method comprising: acquiring initial motion data of a target ball; wherein the initial motion data is used to indicate the initial motion state of the target ball; determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data; wherein the offline trajectory set includes multiple trajectory segments, the trajectory segments being obtained by simulating the preset initial state of the ball's motion; and obtaining the final trajectory of the target ball's motion based on at least one trajectory segment.
[0005] Secondly, the present invention provides a trajectory generation device for a ball, the device comprising: a data acquisition module for acquiring initial motion data of a target ball; wherein the initial motion data is used to indicate the initial motion state of the target ball; a trajectory segment determination module for determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data; wherein the offline trajectory set includes multiple trajectory segments, which are obtained by simulating the preset initial state of the ball's motion; and a final trajectory generation module for obtaining the final trajectory of the target ball's motion based on at least one trajectory segment.
[0006] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described method for generating the trajectory of a ball's motion.
[0007] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the above-described method for generating the trajectory of a ball's motion.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] This invention provides a method, apparatus, and electronic device for generating the trajectory of a ball. First, initial motion data of the target ball is acquired, indicating its initial motion state. Then, based on the initial motion data, at least one trajectory segment of the target ball's motion is determined from a preset offline trajectory set. This offline trajectory set includes multiple trajectory segments, which are obtained through simulation calculations based on the preset initial state of the ball's motion. Finally, based on at least one trajectory segment, the final trajectory of the target ball is obtained. In this method, because the trajectories in the offline trajectory set are obtained through simulation calculations, the simulation degree of the trajectories in the offline trajectory set is high. This also results in a high simulation degree of the complete ball trajectory generated based on the initial motion data of the target ball, while minimizing the performance consumption of real-time calculation of the complete ball trajectory. Therefore, this method can predict the ball's motion based on the complete ball trajectory while ensuring the simulation degree of the generated complete ball trajectory.
[0010] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for generating the trajectory of a ball's motion, as provided in an embodiment of the present invention;
[0014] Figure 2 A flowchart illustrating another method for generating the trajectory of a ball's motion, provided in an embodiment of the present invention;
[0015] Figure 3 This is a schematic diagram of an offline trajectory preprocessing method provided in an embodiment of the present invention;
[0016] Figure 4 A flowchart illustrating another method for generating the trajectory of a ball's motion, provided in an embodiment of the present invention;
[0017] Figure 5 A schematic diagram of the structure of a trajectory generation device for ball motion provided in an embodiment of the present invention;
[0018] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0020] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0021] In ball games (such as soccer and basketball), it is necessary to simulate and predict the trajectory of the ball in various movements (e.g., shooting and passing in soccer, and shooting in basketball). Related technologies provide two methods for generating the trajectory of the ball:
[0022] The first method involves real-time calculations based on simulated physics formulas to generate the complete trajectory of the ball. This approach establishes a physical model of the ball's motion, considering factors such as sliding friction, rolling friction, Magnus force, gravity, and air resistance. This model obtains data on the ball's velocity and acceleration during its motion, thus acquiring the complete trajectory. While this method boasts high realism, its single-point calculation process is complex. When predicting the ball's motion at a future moment, it requires sequentially calculating all of the ball's motion states, potentially creating significant performance bottlenecks. Furthermore, this method relies entirely on physically simulated ball motion, resulting in poor logical controllability.
[0023] The second method simulates the ball's trajectory by stretching the Bézier curve. This method is simple to calculate and supports the prediction of ball movement. However, the realism of this method is poor and it only supports the simulation of a limited number of ball movement scenarios, making it unsuitable for large-scale application in realistic ball sports games.
[0024] To address the aforementioned issues, this invention provides a method, apparatus, and electronic device for generating the trajectory of a ball. This technology can be applied to various ball games, particularly in scenarios involving the generation and prediction of ball trajectories in ball games.
[0025] To facilitate understanding of the embodiments of the present invention, a method for generating the trajectory of a ball's motion, as disclosed in the embodiments of the present invention, will first be described in detail, such as... Figure 1 As shown, the method includes the following specific steps:
[0026] Step S102: Obtain the initial motion data of the target ball; wherein, the initial motion data is used to indicate the initial motion state of the target ball.
[0027] In practical applications, the target ball's motion can be from ball games such as basketball, soccer, volleyball, or table tennis. The initial motion data includes the target ball's initial velocity, initial angle, starting position, and target position. The initial angle refers to the angle between the target ball's initial velocity direction and the ground. This initial angle primarily indicates the trajectory type of the target ball. Generally, an initial angle greater than zero indicates an aerial trajectory, while an initial angle of zero indicates a ground trajectory. The starting position and target position indicate the target ball's direction of motion. In practical implementation, the initial motion data of the target ball can be obtained in real-time from the ball game.
[0028] Step S104: Based on the initial motion data, determine at least one trajectory segment of the target ball's motion from a preset offline trajectory set; wherein, the offline trajectory set includes multiple trajectory segments, which are obtained by simulating the preset initial state of the ball's motion.
[0029] The aforementioned offline trajectory set is pre-set. Specifically, when generating the offline trajectory set, an initial state set needs to be pre-set. This initial state set contains multiple initial states of the target ball's motion, each containing the ball's velocity and initial angle. Then, using a pre-set physical simulation formula, a simulation calculation is performed on each initial state of the ball's motion to obtain discrete point information of the trajectory corresponding to each initial state. Each set of discrete point information constitutes a trajectory segment. The set of trajectory segments generated from all the initial states of the ball's motion is determined as the offline trajectory set. Since a highly realistic trajectory can be obtained through the physical simulation formula, the trajectory segments in the offline trajectory set all have a high degree of realism.
[0030] In practical implementation, since the trajectory segments in the offline trajectory set are determined by the initial state of the ball's motion, trajectory segments matching the initial motion state of the target ball can be determined from the offline trajectory set. If the target ball has not stopped moving at the end position of the determined trajectory segment, it is necessary to determine another trajectory segment from the offline trajectory set based on the ball's motion data at the end position of the determined trajectory segment, until the target ball stops moving. One or more trajectory segments can be obtained from the offline trajectory set using this method.
[0031] Step S106: Based on at least one trajectory segment, obtain the final trajectory of the target ball.
[0032] If a trajectory segment is identified from the offline trajectory set, then that segment is determined as the final trajectory of the target ball. If multiple trajectory segments are identified from the offline trajectory set, they need to be pieced together sequentially according to the chronological order of their identification, and the resulting piece is then determined as the final trajectory of the target ball.
[0033] In practical implementation, after the final trajectory of the target ball is formed, the starting point of the final trajectory can be set at the starting position of the target ball's motion, and the ending point of the final trajectory can be set at the target position of the target ball's motion.
[0034] This invention provides a method for generating the trajectory of a ball. First, initial motion data of the target ball is acquired, indicating its initial motion state. Then, based on the initial motion data, at least one trajectory segment of the target ball's motion is determined from a preset offline trajectory set. This offline trajectory set includes multiple trajectory segments, which are obtained through simulation calculations based on the preset initial motion state of the ball. Finally, based on at least one trajectory segment, the final trajectory of the target ball is obtained. In this method, because the trajectories in the offline trajectory set are obtained through simulation calculations, the simulation degree of the trajectories in the offline trajectory set is high. This also results in a high simulation degree of the complete ball trajectory generated based on the initial motion data of the target ball, and the performance consumption of real-time calculation of the complete ball trajectory is low. Therefore, this method can predict the ball's motion based on the complete ball trajectory while ensuring the simulation degree of the generated complete ball trajectory.
[0035] This invention also provides another method for generating the trajectory of a ball's motion. This method is implemented based on the above embodiments. The method focuses on describing the specific process of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on initial motion data (implemented through steps S204-S206 below). Figure 2 As shown, the method includes the following specific steps:
[0036] Step S202: Obtain the initial motion data of the target ball; wherein, the initial motion data includes the initial velocity and initial angle of the target ball.
[0037] Step S204: Based on the initial angle of the target ball's motion, determine the trajectory type of the target ball's motion; wherein, the trajectory type includes air trajectory and ground trajectory.
[0038] In practical implementation, if the initial angle is greater than zero, the trajectory of the target ball is an aerial trajectory; if the initial angle is equal to zero, the trajectory of the target ball is a ground trajectory. This invention employs different trajectory determination methods for aerial and ground trajectories.
[0039] Step S206: Based on the trajectory type and initial velocity of the target ball, determine at least one trajectory segment of the target ball's motion from the offline trajectory set.
[0040] In practical implementation, the above-mentioned offline trajectory set can be determined through the following steps 10-12:
[0041] Step 10: Obtain a preset initial state set; wherein, the initial state set includes multiple initial states of ball motion; the initial states of ball motion are used to indicate the initial velocity and initial angle of the ball motion.
[0042] Specifically, the aforementioned initial state set contains multiple initial states of ball motion. These initial states can be obtained by developers considering the velocity vector range of ball motion in game combat, where the velocity vector includes initial velocity and initial angle. For example, in game combat, ball motion has a velocity range and an initial angle range. Assuming the velocity range is 10m / s-40m / s and the angle range is 0-90 degrees, the initial states of ball motion in the initial state set are obtained by sampling the velocity from the velocity range and the angle from the angle range, such as (10m / s, 0 degrees), (40m / s, 20 degrees), (11m / s, 40 degrees), etc.
[0043] Step 11: For each initial state of ball motion in the initial state set, calculate the trajectory segment corresponding to the initial state of ball motion based on the initial state of ball motion and the preset simulation formula.
[0044] In practical implementation, the trajectory type of the ball's initial state can be determined based on the initial angle. Trajectory types include aerial trajectories and ground trajectories. Then, based on the initial velocity and a preset simulation formula corresponding to that trajectory type, the trajectory segment corresponding to the ball's initial state is calculated. Specifically, if it is an aerial trajectory, the ball's motion is simulated using the corresponding physical simulation formula, as well as factors such as gravitational acceleration, Magnus force, air resistance, and rotational decay that the ball may experience during its motion. This yields discrete point information for multiple discrete points in the ball's trajectory, and the trajectory segment corresponding to the ball's initial state is determined based on this discrete point information. Each trajectory segment includes multiple discrete points, as well as the velocity and position of each discrete point.
[0045] If it is a ground trajectory, the physical simulation formula corresponding to the ground trajectory is used to calculate the ball's motion, as well as the sliding friction and rolling friction of the ball's motion, to obtain the discrete point information of multiple discrete points in the ball's motion trajectory, and the trajectory segment corresponding to the initial state of the ball's motion is determined based on the discrete point information.
[0046] Step 12: Construct an offline trajectory set based on each trajectory segment.
[0047] In the specific implementation, the offline trajectory set contains trajectory segments of the target ball's motion in each ball's initial state in the initial state set, and each trajectory segment contains multiple discrete points.
[0048] In practical applications, to improve the efficiency of determining the trajectory segments of a target ball in real time, the velocities of discrete points in the offline trajectory set can be extracted. Then, a binary tree is constructed based on the horizontal and vertical velocity components of the discrete points. The horizontal and vertical velocity components of the discrete points serve as the two-dimensional spatial data of the binary tree, and each discrete point in the binary tree contains the trajectory identifier of its corresponding trajectory segment. This approach transforms the process of determining trajectory segments from the offline trajectory set into a search for trajectory segments using a set and a binary tree.
[0049] Based on the construction of a binary tree, the present invention further includes the following specific process for determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set: comparing the initial motion data of the target ball's motion with the two-dimensional spatial data of the binary tree, determining the discrete point corresponding to the two-dimensional spatial data that matches the initial motion data as the target discrete point; and determining the trajectory segment to which the target discrete point belongs as the trajectory segment of the target ball's motion.
[0050] The aforementioned binary tree can be a KD-tree, which is a tree-like data structure for storing instance points in k-dimensional space for fast retrieval, primarily used for searching key data in multi-dimensional space. The KD-tree of this invention is a two-dimensional KD-tree. To facilitate understanding of the offline trajectory generation and KD-tree construction in this invention, Figure 3 A schematic diagram of offline trajectory preprocessing is provided. Figure 3 The process involves iterating through each initial state of the ball's motion in the initial state set, then determining whether that initial state is an aerial trajectory. If it is, the aerial trajectory is obtained based on the simulation formula for aerial trajectories; otherwise, the ground trajectory is obtained based on the simulation formula for ground trajectories. After obtaining the trajectory corresponding to each initial state of the ball's motion in the initial state set, all trajectories are saved to an offline trajectory set. Then, a KD-tree is generated based on the discrete points contained in each trajectory in the offline trajectory set.
[0051] In practical implementation, if the trajectory of the target ball is a ground trajectory, a target trajectory segment matching the initial velocity of the target ball can be determined from the offline trajectory set; then, this target trajectory segment is determined as the final trajectory of the target ball. Specifically, the target trajectory segment can also be determined through the following steps 20-21:
[0052] Step 20: Based on the initial velocity of the target ball, retrieve the discrete target point corresponding to the velocity closest to the initial velocity from the binary tree.
[0053] In its implementation, the binary tree is constructed using the horizontal and vertical components of the discrete point's velocity as its two dimensions. The binary tree is built based on these two-dimensional attributes of all discrete points in the discrete trajectory set, recording the trajectory identifier of each discrete point. Therefore, during retrieval, based on the initial or current velocity of the target ball, the horizontal and vertical velocity parameters can be separated. The closest discrete point in the binary tree is then retrieved, and the optimal trajectory, which is also the target trajectory, is found based on the trajectory identifier recorded at that discrete point.
[0054] Step 21: Determine the trajectory segment to which the target discrete point belongs as the target trajectory segment of the target ball's motion.
[0055] In practical implementation, if the trajectory of the target ball is an aerial trajectory, and the initial motion data also includes the starting point of motion, the target point of motion, and the trajectory stretching method, then step S206 can be implemented through the following steps 30-36:
[0056] Step 30: Determine the initial trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's motion.
[0057] In practical implementation, based on the initial velocity of the target ball, the binary tree corresponding to the offline trajectory set can be used to retrieve the discrete point corresponding to the velocity closest to the initial velocity, and then the trajectory segment to which the discrete point belongs is determined as the initial trajectory segment.
[0058] Step 31: Based on the trajectory stretching method, the starting point of the motion, and the target point of the motion, the initial trajectory segment is fitted and transformed to obtain the first trajectory segment of the target ball's motion; wherein, the endpoint of the first trajectory segment is the location of the target point of the target ball's motion.
[0059] The initial trajectory segment is combined with the starting point of the movement to construct the first trajectory segment, thus obtaining the landing point of the target ball. Specifically, the landing point can be scaled proportionally to the target point based on the trajectory stretching method and the starting point of the movement; if there is no need to stretch the initial trajectory segment, the initial trajectory segment is directly used as the first trajectory segment, and the endpoint of the initial trajectory segment is taken as the location of the target point. Specifically, the trajectory stretching method is determined by the type of trajectory to be used in the actual game combat. For example, long passes do not require stretching, but point-to-point passes do require stretching to ensure the ball reaches the target point.
[0060] Step 32: Calculate the rebound velocity of the target ball at the end position of the first trajectory segment.
[0061] When the giant sun is realized, the rebound speed of the target ball at the end position of the first trajectory segment can be calculated based on the ball's velocity at the end position of the first trajectory segment (that is, the velocity of the discrete point) and the preset rebound formula.
[0062] Step 33: Determine whether the rebound speed is greater than the preset rebound speed threshold; if not, proceed to step 34; otherwise, proceed to step 35.
[0063] The preset rebound speed threshold can be set according to research and development needs. When the rebound speed exceeds the preset rebound speed threshold, the ball can rebound; if it does not exceed the rebound speed threshold, the ball cannot rebound.
[0064] Step 34: Determine a second trajectory segment from the offline trajectory set that matches the rebound speed, so as to determine the first trajectory segment and the second trajectory segment as the trajectory segments of the target ball's motion; proceed to step 36.
[0065] If the rebound speed does not exceed the preset rebound speed threshold, the ball cannot rebound. The subsequent trajectory of the ball is a ground trajectory. The trajectory segment corresponding to the ground trajectory can be retrieved from the binary tree or offline trajectory set based on the rebound speed.
[0066] Step 35: Using the rebound speed as the new initial speed, continue with step 30.
[0067] When the rebound speed exceeds the preset rebound speed threshold, the ball rebounds. The subsequent trajectory of the ball is still an aerial trajectory. Therefore, it is necessary to obtain the trajectory segment through steps 30-32. That is, based on the rebound speed and the endpoint position of the first trajectory segment, the trajectory segment is retrieved from the binary tree or offline trajectory set.
[0068] Step 36: Piece together the determined first trajectory segment and the second trajectory segment to obtain the final trajectory of the target ball.
[0069] By splicing the obtained aerial trajectory and ground trajectory, the complete trajectory of the target ball's movement from the start of its motion to its stop can be obtained.
[0070] Step S208: Based on at least one of the above trajectory segments, the final trajectory of the target ball is obtained.
[0071] The ball trajectory generation method described above utilizes physical simulation formulas to generate trajectory segments from an offline trajectory set. This approach ensures high trajectory realism while reducing the performance overhead of real-time trajectory calculation, achieving both high realism and low energy consumption. Furthermore, based on the ball's initial motion state, this invention generates a complete ball trajectory route from the offline trajectory set, fulfilling the requirement of predictability.
[0072] This invention also provides another method for generating the trajectory of a ball's motion. This method is implemented based on the above embodiments. The method focuses on describing the specific process of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on initial motion data (implemented through steps S404-S406 below). Figure 4 As shown, the method includes the following specific steps:
[0073] Step S402: Obtain the initial motion data of the target ball; wherein, the initial motion data is used to indicate the initial motion state of the target ball.
[0074] Step S404: Determine the target discrete point that matches the initial motion data from the discrete points in the offline trajectory set; wherein, the offline trajectory set includes multiple trajectory segments, and each trajectory segment contains multiple discrete points.
[0075] Each trajectory segment in the offline trajectory set is obtained by simulating the initial state of the ball's motion, thus exhibiting a high degree of fitting. In specific implementation, step S404 above can be achieved through the following steps 40-41:
[0076] Step 40: Construct a binary tree based on the discrete points in the offline trajectory set, where each node in the binary tree represents a discrete point.
[0077] The specific construction process of the binary tree can be referred to the above method implementation examples, and will not be repeated here.
[0078] Step 41: Find the target discrete point in the binary tree that matches the initial motion data.
[0079] If there exists a discrete point in the binary tree that is completely consistent with the initial motion data, that discrete point is determined as the target discrete point. If there is no discrete point in the binary tree that is completely consistent with the initial motion data, the discrete point in the binary tree that is closest to the initial motion data is determined as the target discrete point.
[0080] Step S406: Determine the trajectory segment to which the target discrete point belongs as the trajectory segment of the target ball's motion.
[0081] Step S408: The trajectory segments of the target ball's motion are spliced together to obtain the final trajectory of the target ball's motion.
[0082] The above-mentioned trajectory generation method for the ball's motion utilizes an offline trajectory set to generate the final trajectory of the target ball's motion. While ensuring high trajectory realism, it reduces the performance consumption caused by real-time calculation, achieving the goal of high realism and low energy consumption.
[0083] In addition to the above-described method embodiments, this invention also provides a trajectory generation device for a ball's motion, such as... Figure 5 As shown, the device includes:
[0084] The data acquisition module 50 is used to acquire the initial motion data of the target ball; wherein, the initial motion data is used to indicate the initial motion state of the target ball.
[0085] The trajectory segment determination module 51 is used to determine at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data; wherein the offline trajectory set includes multiple trajectory segments, which are obtained by simulating the preset initial state of the ball's motion.
[0086] The final trajectory generation module 52 is used to obtain the final trajectory of the target ball's motion based on at least one trajectory segment.
[0087] The aforementioned trajectory generation device for a ball first acquires initial motion data of the target ball, which indicates the initial motion state of the target ball. Then, based on the initial motion data, it determines at least one trajectory segment of the target ball's motion from a preset offline trajectory set. This offline trajectory set includes multiple trajectory segments, which are obtained through simulation calculations based on the preset initial motion state of the ball. Finally, based on at least one trajectory segment, the final trajectory of the target ball is obtained. In this method, because the trajectories in the offline trajectory set are obtained through simulation calculations, the simulation degree of the trajectories in the offline trajectory set is high. This also results in a high simulation degree of the complete ball motion trajectory generated based on the initial motion data of the target ball from the offline trajectory set, and the performance consumption for real-time calculation of the complete ball motion trajectory is low. Therefore, this method can predict the ball's motion based on the complete ball motion trajectory while ensuring the simulation degree of the generated complete ball motion trajectory.
[0088] Specifically, each trajectory segment contains multiple discrete points; the trajectory segment determination module 51 is used to: determine the target discrete point that matches the initial motion data from the discrete points in the offline trajectory set; and determine the trajectory segment to which the target discrete point belongs as the trajectory segment of the target ball's motion.
[0089] In a specific implementation, the trajectory segment determination module 51 is also used to: construct a binary tree based on discrete points in the offline trajectory set, wherein each node in the binary tree represents a discrete point; and search for a target discrete point that matches the initial motion data from the binary tree.
[0090] Furthermore, the above-mentioned device also includes an offline trajectory set determination module, used for: obtaining a preset initial state set; wherein the initial state set includes multiple ball motion initial states; for each ball motion initial state in the initial state set, calculating the trajectory segment corresponding to the ball motion initial state according to the ball motion initial state and a preset simulation formula; and constructing an offline trajectory set based on each trajectory segment.
[0091] In practical applications, the aforementioned initial state of ball motion is used to indicate the initial velocity and initial angle of the ball motion; the aforementioned offline trajectory set determination module is also used to: determine the trajectory type of the initial state of ball motion based on the initial angle, wherein the trajectory type includes air trajectory and ground trajectory; and calculate the trajectory segment corresponding to the initial state of ball motion based on the initial velocity and the preset simulation formula corresponding to the trajectory type.
[0092] In an optional embodiment, the trajectory segment includes multiple discrete points, each with a corresponding velocity and position.
[0093] Furthermore, the above-mentioned device also includes a binary tree construction module, used for: extracting the velocity of discrete points contained in the offline trajectory set; constructing a binary tree based on the velocity components in the horizontal direction and the vertical direction of the discrete points; wherein the velocity components in the horizontal direction and the vertical direction of the discrete points are used as two-dimensional spatial data of the binary tree, and each discrete point in the binary tree contains the trajectory identifier of the trajectory segment to which it belongs.
[0094] Based on the construction of the binary tree, the trajectory segment determination module 51 is further used to: compare the initial motion data with the two-dimensional spatial data of the binary tree, determine the discrete point corresponding to the two-dimensional spatial data that matches the initial motion data as the target discrete point; and determine the trajectory segment to which the target discrete point belongs as the trajectory segment of the target ball's motion.
[0095] In a specific implementation, the aforementioned initial motion data includes the initial velocity and initial angle of the target ball's motion; the aforementioned trajectory segment determination module 51 is used to: determine the trajectory type of the target ball's motion based on the initial angle of the target ball's motion; wherein, the trajectory type includes air trajectory and ground trajectory; and determine at least one trajectory segment of the target ball's motion from the offline trajectory set according to the trajectory type and initial velocity of the target ball's motion.
[0096] Furthermore, if the trajectory type of the target ball is a ground trajectory; the trajectory segment determination module 51 is used to: determine the target trajectory segment that matches the initial velocity of the target ball from the offline trajectory set; the final trajectory generation module 52 is used to: determine the target trajectory segment as the final trajectory of the target ball.
[0097] Furthermore, if the trajectory type of the target ball is an aerial trajectory; the initial motion data also includes the starting point of motion, the target point of motion, and the trajectory stretching method; the aforementioned trajectory segment determination module 51 is used to: determine an initial trajectory segment that matches the initial velocity of the target ball from the offline trajectory set; perform fitting transformation processing on the initial trajectory segment based on the trajectory stretching method, the starting point of motion, and the target point of motion to obtain a first trajectory segment of the target ball's motion; wherein, the endpoint position of the first trajectory segment is the location of the target point of the target ball's motion; calculate the rebound velocity of the target ball at the endpoint position of the first trajectory segment; determine whether the rebound velocity is greater than a preset rebound velocity threshold; if it is not greater than the preset rebound velocity threshold, determine a second trajectory segment that matches the rebound velocity from the offline trajectory set, so as to determine the first trajectory segment and the second trajectory segment as the trajectory segments of the target ball's motion; if the rebound velocity is greater than the preset rebound velocity threshold, use the rebound velocity as the new initial velocity, and re-execute the step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set.
[0098] The trajectory generation device for ball motion provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0099] This invention also provides an electronic device, such as... Figure 6 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for generating the trajectory of the ball's motion.
[0100] Specifically, the above-mentioned method for generating the trajectory of the target ball includes: acquiring initial motion data of the target ball; wherein the initial motion data is used to indicate the initial motion state of the target ball; determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data; wherein the offline trajectory set includes multiple trajectory segments, and the trajectory segments are obtained by simulating the preset initial state of the ball's motion; and obtaining the final trajectory of the target ball's motion based on at least one trajectory segment.
[0101] In the above-mentioned method for generating the trajectory of the ball's motion, since the trajectories in the offline trajectory set are obtained through simulation calculation, the simulation degree of the trajectories in the offline trajectory set is high. This also results in a high simulation degree of the complete ball motion trajectory generated based on the initial motion data of the target ball's motion, and the performance consumption of real-time calculation of the complete ball motion trajectory is low. Therefore, this method can predict the ball's motion based on the complete ball motion trajectory while ensuring the simulation degree of the generated complete ball motion trajectory.
[0102] In an optional embodiment, each trajectory segment contains multiple discrete points; the above-mentioned determination of at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on initial motion data includes: determining a target discrete point that matches the initial motion data from the discrete points in the offline trajectory set; and determining the trajectory segment to which the target discrete point belongs as the trajectory segment of the target ball's motion.
[0103] In an optional embodiment, the above-mentioned determination of the target discrete point matching the initial motion data from the discrete points in the offline trajectory set includes: constructing a binary tree based on the discrete points in the offline trajectory set, wherein each node in the binary tree represents a discrete point; and searching for the target discrete point matching the initial motion data from the binary tree.
[0104] In an optional embodiment, the above-mentioned offline trajectory set is determined in the following manner: obtaining a preset initial state set; wherein the initial state set includes multiple initial states of ball movement; for each initial state of ball movement in the initial state set, calculating the trajectory segment corresponding to the initial state of ball movement according to the initial state of ball movement and a preset simulation formula; and constructing an offline trajectory set based on each trajectory segment.
[0105] In an optional embodiment, the aforementioned initial state of ball motion is used to indicate the initial velocity and initial angle of the ball motion; calculating the trajectory segment corresponding to the initial state of ball motion based on the initial state of ball motion and a preset simulation formula includes: determining the trajectory type of the initial state of ball motion based on the initial angle, wherein the trajectory type includes an air trajectory and a ground trajectory; and calculating the trajectory segment corresponding to the initial state of ball motion based on the initial velocity and a preset simulation formula corresponding to the trajectory type.
[0106] In an optional embodiment, the trajectory segment includes multiple discrete points, each with a corresponding velocity and position.
[0107] In an optional embodiment, the method further includes: extracting the velocities of discrete points contained in the offline trajectory set; constructing a binary tree based on the horizontal and vertical velocity components of the discrete points; wherein the horizontal and vertical velocity components of the discrete points serve as the two-dimensional spatial data of the binary tree, and each discrete point in the binary tree contains a trajectory identifier of its respective trajectory segment; determining at least one trajectory segment of the target ball's motion from the preset offline trajectory set based on the initial motion data, including: comparing the initial motion data with the two-dimensional spatial data of the binary tree, determining the discrete points corresponding to the two-dimensional spatial data matching the initial motion data as target discrete points; and determining the trajectory segment to which the target discrete points belong as the trajectory segment of the target ball's motion.
[0108] In an optional embodiment, the initial motion data includes the initial velocity and initial angle of the target ball's motion; the step of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data includes: determining the trajectory type of the target ball's motion based on the initial angle of the target ball's motion; wherein the trajectory type includes air trajectory and ground trajectory; and determining at least one trajectory segment of the target ball's motion from the offline trajectory set based on the trajectory type and initial velocity of the target ball's motion.
[0109] In an optional embodiment, the trajectory type of the target ball is a ground trajectory; the step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set based on the trajectory type and initial velocity of the target ball's motion includes: determining a target trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's motion; the step of obtaining the final trajectory of the target ball's motion based on at least one trajectory segment includes: determining the target trajectory segment as the final trajectory of the target ball's motion.
[0110] In an optional embodiment, the trajectory type of the target ball's movement is an aerial trajectory; the initial motion data also includes the starting point of the movement, the target point of the movement, and the trajectory stretching method; the step of determining at least one trajectory segment of the target ball's movement from the offline trajectory set based on the trajectory type and initial velocity of the target ball's movement includes: determining an initial trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's movement; performing a fitting transformation on the initial trajectory segment based on the trajectory stretching method, the starting point of the movement, and the target point of the movement to obtain a first trajectory segment of the target ball's movement; wherein, the endpoint position of the first trajectory segment is the location of the target point of the target ball's movement; calculating the rebound velocity of the target ball's movement at the endpoint position of the first trajectory segment; determining whether the rebound velocity is greater than a preset rebound velocity threshold; if it is not greater than the preset rebound velocity threshold, determining a second trajectory segment from the offline trajectory set that matches the rebound velocity, so as to determine the first trajectory segment and the second trajectory segment as trajectory segments of the target ball's movement.
[0111] In an optional embodiment, the method further includes: if the rebound speed is greater than a preset rebound speed threshold, using the rebound speed as a new initial speed, and re-executing the step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set.
[0112] Furthermore, Figure 6 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0113] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0114] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. Processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0115] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described method for generating the trajectory of the ball's motion. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0116] Specifically, the above-mentioned method for generating the trajectory of the target ball includes: acquiring initial motion data of the target ball; wherein the initial motion data is used to indicate the initial motion state of the target ball; determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data; wherein the offline trajectory set includes multiple trajectory segments, and the trajectory segments are obtained by simulating the preset initial state of the ball's motion; and obtaining the final trajectory of the target ball's motion based on at least one trajectory segment.
[0117] In the above-mentioned method for generating the trajectory of the ball's motion, since the trajectories in the offline trajectory set are obtained through simulation calculation, the simulation degree of the trajectories in the offline trajectory set is high. This also results in a high simulation degree of the complete ball motion trajectory generated based on the initial motion data of the target ball's motion, and the performance consumption of real-time calculation of the complete ball motion trajectory is low. Therefore, this method can predict the ball's motion based on the complete ball motion trajectory while ensuring the simulation degree of the generated complete ball motion trajectory.
[0118] In an optional embodiment, each trajectory segment contains multiple discrete points; the above-mentioned determination of at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on initial motion data includes: determining a target discrete point that matches the initial motion data from the discrete points in the offline trajectory set; and determining the trajectory segment to which the target discrete point belongs as the trajectory segment of the target ball's motion.
[0119] In an optional embodiment, the above-mentioned determination of the target discrete point matching the initial motion data from the discrete points in the offline trajectory set includes: constructing a binary tree based on the discrete points in the offline trajectory set, wherein each node in the binary tree represents a discrete point; and searching for the target discrete point matching the initial motion data from the binary tree.
[0120] In an optional embodiment, the above-mentioned offline trajectory set is determined in the following manner: obtaining a preset initial state set; wherein the initial state set includes multiple initial states of ball movement; for each initial state of ball movement in the initial state set, calculating the trajectory segment corresponding to the initial state of ball movement according to the initial state of ball movement and a preset simulation formula; and constructing an offline trajectory set based on each trajectory segment.
[0121] In an optional embodiment, the aforementioned initial state of ball motion is used to indicate the initial velocity and initial angle of the ball motion; calculating the trajectory segment corresponding to the initial state of ball motion based on the initial state of ball motion and a preset simulation formula includes: determining the trajectory type of the initial state of ball motion based on the initial angle, wherein the trajectory type includes an air trajectory and a ground trajectory; and calculating the trajectory segment corresponding to the initial state of ball motion based on the initial velocity and a preset simulation formula corresponding to the trajectory type.
[0122] In an optional embodiment, the trajectory segment includes multiple discrete points, each with a corresponding velocity and position.
[0123] In an optional embodiment, the method further includes: extracting the velocities of discrete points contained in the offline trajectory set; constructing a binary tree based on the horizontal and vertical velocity components of the discrete points; wherein the horizontal and vertical velocity components of the discrete points serve as the two-dimensional spatial data of the binary tree, and each discrete point in the binary tree contains a trajectory identifier of its respective trajectory segment; determining at least one trajectory segment of the target ball's motion from the preset offline trajectory set based on the initial motion data, including: comparing the initial motion data with the two-dimensional spatial data of the binary tree, determining the discrete points corresponding to the two-dimensional spatial data matching the initial motion data as target discrete points; and determining the trajectory segment to which the target discrete points belong as the trajectory segment of the target ball's motion.
[0124] In an optional embodiment, the initial motion data includes the initial velocity and initial angle of the target ball's motion; the step of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data includes: determining the trajectory type of the target ball's motion based on the initial angle of the target ball's motion; wherein the trajectory type includes air trajectory and ground trajectory; and determining at least one trajectory segment of the target ball's motion from the offline trajectory set based on the trajectory type and initial velocity of the target ball's motion.
[0125] In an optional embodiment, the trajectory type of the target ball is a ground trajectory; the step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set based on the trajectory type and initial velocity of the target ball's motion includes: determining a target trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's motion; the step of obtaining the final trajectory of the target ball's motion based on at least one trajectory segment includes: determining the target trajectory segment as the final trajectory of the target ball's motion.
[0126] In an optional embodiment, the trajectory type of the target ball's movement is an aerial trajectory; the initial motion data also includes the starting point of the movement, the target point of the movement, and the trajectory stretching method; the step of determining at least one trajectory segment of the target ball's movement from the offline trajectory set based on the trajectory type and initial velocity of the target ball's movement includes: determining an initial trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's movement; performing a fitting transformation on the initial trajectory segment based on the trajectory stretching method, the starting point of the movement, and the target point of the movement to obtain a first trajectory segment of the target ball's movement; wherein, the endpoint position of the first trajectory segment is the location of the target point of the target ball's movement; calculating the rebound velocity of the target ball's movement at the endpoint position of the first trajectory segment; determining whether the rebound velocity is greater than a preset rebound velocity threshold; if it is not greater than the preset rebound velocity threshold, determining a second trajectory segment from the offline trajectory set that matches the rebound velocity, so as to determine the first trajectory segment and the second trajectory segment as trajectory segments of the target ball's movement.
[0127] In an optional embodiment, the method further includes: if the rebound speed is greater than a preset rebound speed threshold, using the rebound speed as a new initial speed, and re-executing the step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set.
[0128] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0130] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating the trajectory of a ball, characterized in that, The method includes: Acquire initial motion data of the target ball; wherein, the initial motion data is used to indicate the initial motion state of the target ball; the initial motion data includes the initial velocity of the target ball, the starting point of motion, the target point of motion, and the trajectory stretching method; Based on the initial motion data, at least one trajectory segment of the target ball's motion is determined from a preset offline trajectory set; wherein, the offline trajectory set includes multiple trajectory segments, and the trajectory segments are obtained by simulating the preset initial state of the ball's motion; Based on the at least one trajectory segment, the final trajectory of the target ball is obtained; The step of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data includes: when the trajectory type of the target ball's motion is an aerial trajectory, determining an initial trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's motion; performing a fitting transformation on the initial trajectory segment based on the trajectory stretching method, the motion starting point, and the motion target point to obtain a first trajectory segment of the target ball's motion; wherein the endpoint position of the first trajectory segment is the location of the motion target point of the target ball's motion; calculating the rebound velocity of the target ball's motion at the endpoint position of the first trajectory segment; determining whether the rebound velocity is greater than a preset rebound velocity threshold; if it is not greater than the preset rebound velocity threshold, determining a second trajectory segment from the offline trajectory set that matches the rebound velocity, so as to determine the first trajectory segment and the second trajectory segment as trajectory segments of the target ball's motion.
2. The method according to claim 1, characterized in that, Each of the trajectory segments contains multiple discrete points; The step of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data includes: Determine the target discrete point that matches the initial motion data from the discrete points in the offline trajectory set; The trajectory segment to which the target discrete point belongs is determined as the trajectory segment of the target ball's motion.
3. The method according to claim 2, characterized in that, Determining the target discrete point that matches the initial motion data from the discrete points in the offline trajectory set includes: Based on the discrete points in the offline trajectory set, a binary tree is constructed, wherein each node in the binary tree represents one of the discrete points; Find the target discrete point in the binary tree that matches the initial motion data.
4. The method according to claim 1, characterized in that, The offline trajectory set is determined in the following manner: Obtain a preset initial state set; wherein, the initial state set includes multiple initial states of ball movement; For each initial state of the ball's motion in the initial state set, the trajectory segment corresponding to the initial state of the ball's motion is calculated according to the initial state of the ball's motion and a preset simulation formula; The offline trajectory set is constructed based on each of the trajectory segments.
5. The method according to claim 4, characterized in that, The initial state of the ball's motion is used to indicate the initial velocity and initial angle of the ball's motion; The step of calculating the trajectory segment corresponding to the initial state of the ball's motion based on the initial state of the ball's motion and a preset simulation formula includes: The trajectory type of the ball's initial motion is determined based on the initial angle, wherein the trajectory type includes an air trajectory and a ground trajectory; Based on the initial velocity and the preset simulation formula corresponding to the trajectory type, the trajectory segment corresponding to the initial state of the ball's motion is calculated.
6. The method according to claim 5, characterized in that, The trajectory segment includes multiple discrete points, each of which has a corresponding velocity and position.
7. The method according to claim 6, characterized in that, The method further includes: Extract the velocity of discrete points contained in the offline trajectory set; A binary tree is constructed based on the horizontal and vertical velocity components of the discrete points; wherein, the horizontal and vertical velocity components of the discrete points serve as the two-dimensional spatial data of the binary tree, and each discrete point in the binary tree contains the trajectory identifier of the trajectory segment to which it belongs. The step of determining at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data includes: The initial motion data is compared with the two-dimensional spatial data of the binary tree, and the discrete point corresponding to the two-dimensional spatial data that matches the initial motion data is determined as the target discrete point. The trajectory segment to which the target discrete point belongs is determined as the trajectory segment of the target ball's motion.
8. The method according to claim 1, characterized in that, The initial motion data also includes the initial angle of the target ball's motion; The trajectory type of the target ball is determined in the following way: Based on the initial angle of the target ball's motion, the trajectory type of the target ball's motion is determined; wherein, the trajectory type includes an aerial trajectory and a ground trajectory.
9. The method according to claim 8, characterized in that, The trajectory of the target ball is a ground trajectory; The step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set based on the trajectory type of the target ball's motion and the initial velocity includes: Determine the target trajectory segment that matches the initial velocity of the target ball's motion from the offline trajectory set; The step of obtaining the final trajectory of the target ball based on the at least one trajectory segment includes: determining the target trajectory segment as the final trajectory of the target ball.
10. The method according to claim 1, characterized in that, The method further includes: If the rebound speed is greater than the preset rebound speed threshold, the rebound speed is used as the new initial speed, and the step of determining at least one trajectory segment of the target ball's motion from the offline trajectory set is repeated.
11. A trajectory generation device for a ball, characterized in that, The device includes: The data acquisition module is used to acquire the initial motion data of the target ball; wherein, the initial motion data is used to indicate the initial motion state of the target ball; the initial motion data includes the initial velocity of the target ball, the starting point of the motion, the target point of the motion, and the trajectory stretching method; The trajectory segment determination module is used to determine at least one trajectory segment of the target ball's motion from a preset offline trajectory set based on the initial motion data; wherein, the offline trajectory set includes multiple trajectory segments, and the trajectory segment is obtained by simulating the preset initial state of the ball's motion; The final trajectory generation module is used to obtain the final trajectory of the target ball's motion based on the at least one trajectory segment; The trajectory segment determination module is further configured to: when the trajectory type of the target ball's motion is an aerial trajectory, determine an initial trajectory segment from the offline trajectory set that matches the initial velocity of the target ball's motion; perform fitting transformation processing on the initial trajectory segment based on the trajectory stretching method, the starting point of motion, and the target point of motion to obtain a first trajectory segment of the target ball's motion; wherein, the endpoint position of the first trajectory segment is the position of the target point of the target ball's motion; calculate the rebound velocity of the target ball's motion at the endpoint position of the first trajectory segment; determine whether the rebound velocity is greater than a preset rebound velocity threshold; if it is not greater than the preset rebound velocity threshold, determine a second trajectory segment from the offline trajectory set that matches the rebound velocity, so as to determine the first trajectory segment and the second trajectory segment as the trajectory segments of the target ball's motion.
12. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the trajectory generation method for ball motion according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the trajectory generation method for ball motion as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Unmanned aerial vehicle, flight path generation method thereof and computer readable storage medium
CN110703797A
Golf ball trajectory prediction method, golf ball trajectory prediction apparatus, and golf club selection method
US20160354632A1
