Track prediction and self-adaptive hitting method and table tennis robot system
By using visual sensors and high-fidelity physical models, the continuous motion trajectory of the ping-pong ball is generated and the swing angle of the ball is calculated. This solves the problems of insufficient trajectory prediction and poor adaptability of hitting strategies in existing ping-pong robot systems, and achieves high-precision and high-stability adaptive hitting.
Patent Information
- Application Number
- CN202511250027.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-11-28
AI Technical Summary
Existing table tennis robot systems suffer from insufficient trajectory prediction accuracy, poor adaptability to hitting strategies, and weak coordination between perception and execution, which limits their application in dynamic, high-speed, and highly competitive human-computer interaction scenarios.
The system collects the three-dimensional coordinates of the ping-pong ball using a visual sensor, generates a continuous motion trajectory, and combines a high-fidelity physical dynamics model to predict the hitting point and time. It then dynamically calculates the swing angle of the robotic arm and executes a synchronous adaptive hitting action. Cubic spline interpolation and Gaussian filtering are used for noise reduction, and air resistance and inelastic recovery effects are taken into account.
It improves trajectory prediction accuracy and hitting success rate, achieves high-precision and highly adaptable adaptive hitting, and enhances the performance of the robotic table tennis system.
Smart Images

Figure CN121018554A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of robotics and artificial intelligence, and in particular to a trajectory prediction and adaptive hitting method and a table tennis robot system. Background Technology
[0002] Currently, robotic systems applied to dynamic ball sports such as table tennis generally face technical bottlenecks. Existing trajectory prediction methods mostly rely on simplified physical models, such as pure parabolic models, neglecting physical factors such as air resistance, the Magnus effect caused by ball rotation, and energy loss and recovery coefficient upon collision with the table surface. This leads to significant errors between the predicted and actual landing points when dealing with high-speed, long-distance, or spin-based ball trajectories, contributing to missed shots.
[0003] Most robotic systems use fixed hitting parameters, such as fixed swing angle and force, or simple linear feedback control. This strategy is difficult to adapt to when facing balls with varying trajectories and scattered landing points, resulting in inconsistent return quality.
[0004] There is a lack of precise time synchronization mechanisms between visual detection, trajectory fitting, motion planning, and robotic arm execution. Trajectory fitting methods, such as simple linear interpolation, struggle to smoothly handle non-uniform sampling points that may occur during high-speed motion. The control of the timing of the shot is also rather coarse, often employing a fixed delay, which can cause the system to fail to complete the shot at the right time and position, making it difficult to guarantee a high success rate.
[0005] These shortcomings collectively limit the application of robots in dynamic, high-speed, and highly adversarial human-computer interaction scenarios, and fail to meet the automation requirements of high precision, high adaptability, and high success rate.
[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0007] In view of this, the present invention provides a trajectory prediction and adaptive hitting method and a table tennis robot system, aiming to solve the problems of insufficient trajectory prediction accuracy, poor adaptability of hitting strategy, and weak coordination between perception and execution in existing robot table tennis systems. By high-fidelity trajectory reconstruction, enhanced physical model prediction, nonlinear adaptive hitting decision-making, and high-precision segmented synchronous execution, the accuracy of trajectory prediction, hitting success rate, and return quality are improved.
[0008] This invention provides a trajectory prediction and adaptive hitting method, applied to a table tennis robot system including a vision sensor and a multi-joint robotic arm, comprising:
[0009] A series of discrete three-dimensional coordinate points of a moving ping-pong ball are collected using a visual sensor;
[0010] A series of discrete three-dimensional coordinate points are processed to generate the continuous trajectory of a ping-pong ball;
[0011] Based on a pre-set physical dynamics model, the continuous motion trajectory is extrapolated to predict the coordinates of the hitting point and the arrival time of the ping-pong ball when it reaches the pre-set hitting plane.
[0012] Based on the lateral coordinates in the predicted hitting point coordinates, the required hitting swing angle of the robotic arm's hitting joint is dynamically calculated.
[0013] Based on the predicted arrival time and the calculated swing angle, the robotic arm is controlled to perform a synchronous adaptive hitting motion at the hitting plane.
[0014] Optionally, the steps for generating the continuous motion trajectory of the ping-pong ball include:
[0015] A series of discrete three-dimensional coordinate points are processed by cubic spline interpolation to obtain a piecewise continuous trajectory function;
[0016] A cubic polynomial fit is performed on the piecewise continuous trajectory function to obtain a unified analytical expression for the continuous motion trajectory.
[0017] Optionally, before processing a series of discrete three-dimensional coordinate points, the following steps are also included:
[0018] Gaussian filtering is performed on a series of discrete 3D coordinate points to remove noisy data.
[0019] Optionally, the physical dynamics model incorporates the effects of gravity and air resistance, which is proportional to the square of the speed of the ping-pong ball.
[0020] Optionally, the physical dynamics model also incorporates the inelastic recovery effect when the ping-pong ball collides with the table surface.
[0021] Optionally, the inelastic recovery effect is characterized by the horizontal recovery coefficient and the vertical recovery coefficient, wherein the value of the horizontal recovery coefficient is greater than the value of the vertical recovery coefficient.
[0022] Optional steps for dynamically calculating the swing angle of the ball include:
[0023] Calculate the base swing angle proportionally based on the absolute value of the horizontal coordinate;
[0024] The basic swing angle is constrained between a preset minimum angle threshold and a preset maximum angle threshold to obtain the hitting swing angle.
[0025] Optionally, the minimum angle threshold is 0.5 radians and the maximum angle threshold is 0.8 radians.
[0026] Optionally, the steps for performing the adaptive hitting motion may also include:
[0027] The direction of the swing angle is determined by the sign of the horizontal coordinate.
[0028] Optionally, the steps for controlling the robotic arm to perform synchronized adaptive hitting motions include:
[0029] Calculate the time difference between the predicted arrival time and the time required for the robotic arm to complete its preparation actions to determine the waiting time;
[0030] When the waiting time exceeds the preset switching threshold, the first timing mode is used for waiting.
[0031] When the remaining waiting time is less than or equal to the preset switching threshold, the system switches to the second timing mode with higher accuracy than the first timing mode to wait, so as to ensure that the synchronization error between the execution time of the hitting action and the predicted arrival time is less than the preset accuracy threshold.
[0032] Optionally, the preset switching threshold is 0.1 seconds, and the preset precision threshold is 0.001 seconds.
[0033] Optionally, before controlling the robotic arm to perform synchronized adaptive hitting actions, the following steps are also included:
[0034] Based on the predicted striking point coordinates, the target angles of all joints of the robotic arm, except the striking joint, are calculated using inverse kinematics analytical formulas to generate the robotic arm's ready pose.
[0035] Optionally, in the inverse kinematics analytical formula, the target angle of the base joint of the robotic arm is proportional to the lateral coordinate, and the target angle of the shoulder joint is proportional to the height coordinate of the hitting point.
[0036] Optionally, the step of controlling the robotic arm to perform synchronized adaptive hitting motions also includes:
[0037] When planning the path for the robotic arm to move from its current pose to its ready pose, a trapezoidal velocity curve is used to control the angular velocity of each joint.
[0038] Optionally, after performing the synchronized adaptive hitting motion, it also includes:
[0039] The robotic arm maintains its position for a preset time after hitting the ball, and then resets to its initial ready position.
[0040] Optional, the preset duration is 0.08 seconds.
[0041] This invention provides a table tennis robot system for trajectory prediction and adaptive hitting, comprising:
[0042] The vision acquisition module is configured to acquire a series of discrete three-dimensional coordinate points of a moving ping-pong ball;
[0043] The trajectory generation module, connected to the vision acquisition module, is configured to process a series of discrete three-dimensional coordinate points to generate the continuous motion trajectory of the ping-pong ball.
[0044] The prediction module, connected to the trajectory generation module, is configured to extrapolate the continuous motion trajectory based on a preset physical dynamics model in order to predict the coordinates of the hitting point and the arrival time of the ping-pong ball when it reaches the preset hitting plane.
[0045] The decision module, connected to the prediction module, is configured to dynamically calculate the required swing angle of the hitting joint based on the lateral coordinate in the predicted hitting point coordinates.
[0046] The motion control module, connected to the prediction and decision modules, is configured to control the multi-joint robotic arm to perform synchronized adaptive hitting motions on the hitting plane based on the predicted arrival time and the calculated hitting swing angle.
[0047] Optionally, the trajectory generation module is further configured as follows:
[0048] A series of discrete three-dimensional coordinate points are processed by cubic spline interpolation to obtain a piecewise continuous trajectory function;
[0049] A cubic polynomial fit is performed on the piecewise continuous trajectory function to obtain a unified analytical expression for the continuous motion trajectory.
[0050] Optionally, the physical dynamics model used in the prediction module takes into account the effects of gravity, air resistance which is proportional to the square of the speed of the ping-pong ball, and the inelastic recovery effect when the ping-pong ball collides with the table surface.
[0051] Optionally, the decision module is further configured as follows:
[0052] Calculate the base swing angle proportionally based on the absolute value of the horizontal coordinate;
[0053] The basic swing angle is constrained between a preset minimum angle threshold and a preset maximum angle threshold to obtain the hitting swing angle;
[0054] The direction of the swing angle is determined based on the sign of the horizontal coordinate.
[0055] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention.
[0056] The trajectory prediction and adaptive hitting method and the table tennis robot system of the present invention have the following beneficial effects:
[0057] The above technical solution enables the reconstruction of the continuous trajectory of a ping-pong ball using motion data acquired by a visual sensor. Based on this trajectory, a pre-defined physical dynamics model can predict the coordinates and time of the ball's arrival at a predetermined striking plane. This lateral coordinate is used to dynamically calculate the robotic arm's striking swing angle, and this swing angle, along with the predicted arrival time, is used to control the robotic arm to execute synchronized adaptive striking actions. Compared to existing technologies, this method can be applied to ping-pong robot systems to achieve more precise and adaptive striking. Attached Figure Description
[0058] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.
[0059] Figure 1 This is a flowchart of a trajectory prediction and adaptive striking method according to an embodiment of the present invention;
[0060] Figure 2 This is a schematic diagram of the structure of a table tennis robot system according to an embodiment of the present invention. Detailed Implementation
[0061] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the invention will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0062] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0063] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined. Therefore, the actual execution order may change depending on the specific circumstances.
[0064] This invention relates to a robot trajectory prediction and control method that utilizes a multidisciplinary approach, including visual perception, dynamic modeling, and motion control. Visual perception provides real-time state estimation of dynamic targets, dynamic modeling predicts the target's future trajectory, and motion control drives the actuators to perform precise interactive actions. In a table tennis robot system, accurately predicting the ball's trajectory is fundamental to achieving stable shots. By acquiring the table tennis ball's position information through visual sensors and extrapolating it using a dynamic model, its future position can be predicted. However, due to the high speed and complexity of table tennis motion, simple models cannot provide sufficient prediction accuracy; therefore, factors such as air resistance and collision recovery need to be considered to establish a more accurate dynamic model. Furthermore, to cope with different ball trajectories, the hitting strategy needs to be dynamically adjusted based on the predicted landing point. This requires designing a reasonable decision-making algorithm to convert the predicted information into motion parameters for the robotic arm. Finally, precise motion control is essential for stable shots; the robotic arm's trajectory needs to be planned and controlled to ensure it reaches the target position at the correct time and completes the hitting action.
[0065] like Figure 1 As shown, this embodiment of the invention provides a trajectory prediction and adaptive striking method, which includes the following steps:
[0066] Step S100: Acquire a series of discrete three-dimensional coordinate points of the moving ping-pong ball using a vision sensor. For example, a vision sensor such as a high-speed camera or depth camera can be used to capture the position information of the ping-pong ball in space at a certain frame rate (e.g., 60Hz, 120Hz, or 240Hz). The vision sensor can provide three-dimensional coordinate data of the ball's center in the world coordinate system. In some other optional implementations, the vision sensor can be a monocular camera, a binocular camera, or a structured light camera.
[0067] Step S200: Process a series of discrete 3D coordinate points to generate a continuous trajectory of the ping-pong ball. One implementation involves first smoothing the acquired raw data to reduce noise, and then using various curve or surface fitting methods, such as Bézier curves, B-spline curves, or NURBS surfaces, to fit the discrete points into a continuous trajectory. This continuous trajectory describes the motion of the ping-pong ball in space and provides a data basis for subsequent predictions. In other alternative implementations, Kalman filtering or other time-series data processing algorithms can also be used to smooth and reconstruct the trajectory.
[0068] Step S300: Based on a preset physical dynamics model, extrapolate the continuous motion trajectory to predict the coordinates of the hitting point and the arrival time of the ping-pong ball when it reaches the preset hitting plane. For example, establish a physical model that includes factors such as gravity, air resistance, and spin, and combine it with the continuous trajectory generated in step S200. Use a numerical integration method (e.g., the Runge-Kutta method) to extrapolate the trajectory and calculate the position and velocity of the ping-pong ball at future moments. Set a hitting plane (e.g., a horizontal plane at a certain height above the table). When the predicted trajectory intersects with this plane, record the intersection coordinates and arrival time as predicted values for the hitting point coordinates and arrival time. In some other optional implementations, a machine learning-based prediction model can also be used to predict the ball's trajectory by training on historical data.
[0069] Step S400: Based on the predicted lateral coordinates of the hitting point, dynamically calculate the required hitting swing angle of the robotic arm's hitting joint. One implementation method is to design a function that takes the lateral coordinates of the hitting point as input and outputs a hitting swing angle. This function can be linear or non-linear, used to implement different hitting strategies. For example, when the lateral coordinates deviate significantly from the center position, the hitting swing angle can be increased to achieve a larger return angle. In other alternative implementations, methods such as lookup tables or neural networks can also be used to determine the hitting swing angle.
[0070] Step S500: Based on the predicted arrival time and calculated ball swing angle, control the robotic arm to perform a synchronized adaptive hitting motion at the hitting plane. One implementation method is to pre-plan the robotic arm's trajectory according to the predicted arrival time, ensuring that the robotic arm's hitting joint can complete the hitting motion at the calculated ball swing angle when the ping-pong ball arrives at the hitting plane. To achieve precise synchronization, a high-precision timer or real-time control system can be used to control the robotic arm's movement. Furthermore, the robotic arm's trajectory can be fine-tuned according to actual conditions to improve hitting accuracy. In other optional implementations, force / torque sensors can be used to implement force feedback control, thereby better adapting to the ball's movement.
[0071] Through the above steps, the vision sensor collects the motion data of the ping-pong ball, generates a continuous motion trajectory, the physical dynamics model predicts the hitting point and arrival time, the ball swing angle is dynamically determined based on the lateral coordinates of the hitting point, and finally the robotic arm is controlled to synchronously execute adaptive hitting actions. These steps work together to form a complete closed-loop control system, which solves the shortcomings of existing robotic ping-pong systems in terms of trajectory prediction accuracy, hitting strategy adaptability, and spatiotemporal synchronization accuracy, thereby improving the robot's hitting success rate and return quality of high-speed ping-pong balls.
[0072] Through the above solution, this embodiment can achieve accurate prediction and adaptive hitting of high-speed ping-pong balls, thereby improving the performance of the robotic ping-pong system. Compared with the prior art, the beneficial effects of this embodiment are: it can more accurately predict the trajectory of the ping-pong ball and dynamically adjust the hitting strategy according to the characteristics of the incoming ball, ultimately achieving high-precision and high-stability hitting.
[0073] In one specific implementation, based on the above embodiments, the process of generating a continuous motion trajectory is as follows:
[0074] First, after receiving the discrete 3D coordinate point set from the vision sensor, the system determines the number of data points. If the number of data points is less than a preset minimum value, such as 3 points, the system determines that there is insufficient data and abandons the current processing. Otherwise, it proceeds to the subsequent trajectory generation process.
[0075] Specifically, cubic spline interpolation is used to interpolate the coordinate point set. The core of cubic spline interpolation is to determine a piecewise cubic polynomial function that passes through all data points and is continuous in both its first and second derivatives. To uniquely determine this function, the value of the second derivative at each data point needs to be solved. This can be achieved by solving a tridiagonal linear equation system.
[0076] Suppose that the data point set P can be represented as:
[0077]
[0078] in:
[0079] Usually represents time .
[0080] Represents time The coordinate value at that time (for example, it can be a single coordinate value in the X, Y or Z direction, and the process needs to be performed separately in the three coordinate directions).
[0081] n is the total number of data points minus one.
[0082] This system of linear equations can be represented in standard matrix form:
[0083]
[0084] in:
[0085] It is a known A tridiagonal coefficient matrix. Its elements consist of the time intervals between data points. Decide. is an unknown vector to be solved, whose elements are the values of the second derivative at the internal data points, i.e. For natural spline interpolation, the boundary conditions are: .
[0086] It is a known constant vector whose elements are the coordinates of the data points. and time interval The calculation yielded the result.
[0087] and The operation between them is matrix-vector multiplication.
[0088] The i-th row of this system of equations (corresponding to the point) ,in The specific form of ) is:
[0089]
[0090] By solving this system of equations (for example, using an efficient catching-up method), the second derivative values for all interior points can be obtained. This uniquely determined the specific expression of the piecewise cubic spline function.
[0091] Then, a cubic polynomial fit is performed on the obtained piecewise cubic spline function. Specifically, the least squares method can be chosen for fitting. Assume the piecewise cubic spline function is... The fitting objective is a cubic polynomial:
[0092]
[0093] in:
[0094] It is the global cubic polynomial to be determined. These are the coefficients of the optimal polynomial to be solved. The objective of the least squares method is to minimize the following sum of squared errors. :
[0095]
[0096] in: It is the total error of the fit. A series of uniformly sampled data within the domain of the spline function One point. At the sampling point The value is obtained from the cubic spline interpolation. At the sampling point The value of the function is calculated from the cubic polynomial to be determined.
[0097] By analyzing the error function Find the information about each The partial derivatives of , and set each partial derivative to zero ( ), can obtain a result about This is a system of four linear equations. Solving this system of equations will yield the optimal coefficients of the cubic polynomial.
[0098] Through the above scheme, this embodiment can transform discrete three-dimensional coordinate points into continuous trajectories with unified analytical expressions, which facilitates subsequent physical model prediction and can adapt to data with different sampling frequencies and noise levels.
[0099] In one specific implementation, based on the above embodiments, before processing a series of discrete three-dimensional coordinate points to generate the continuous trajectory of the ping-pong ball, Gaussian filtering is first performed on the series of discrete three-dimensional coordinate points to filter out noise data.
[0100] Specifically, the vision acquisition module is configured such that its output 3D coordinate point cloud data stream first passes through a Gaussian filter. This filter uses a Gaussian kernel function of the following form:
[0101]
[0102] in: It is a three-dimensional Gaussian kernel function used to calculate weights. It is the relative coordinate of a neighboring point with respect to the center point. It is the amplitude coefficient, which is a positive constant. This represents the natural exponential function. It is the standard deviation of the Gaussian distribution, which controls the smoothness of the filter.
[0103] Then, for each coordinate point to be processed The new coordinates after filtering It is calculated using the following weighted average formula:
[0104]
[0105]
[0106]
[0107] in: It is the center point currently being filtered. It is a point The set of neighborhood points, including itself. It is a neighborhood set Any point in the array.
[0108] It is based on neighboring points Relative to the center point The Gaussian weights are calculated based on the relative positions.
[0109] Represents the neighborhood set Summing is performed on all points within the range.
[0110] In the above formula, since the filtered coordinates are the ratio of the weighted sum to the weighted sum, the constant amplitude coefficient... It will be canceled out in both the numerator and denominator, and its specific value does not affect the final filtering result. In one implementation, the neighborhood range... It can be set to All data points within a 3x3x3 cube region centered at the center. Standard deviation Adjustments are made based on the noise level of the visual sensor, for example, for the Intel RealSense D435 camera. It can be set to 0.01 meters.
[0111] Next, the filtered data points As input to the subsequent trajectory generation module.
[0112] In some alternative implementations, the Gaussian filter can be replaced with other types of filters, such as a median filter or a Kalman filter. The median filter, by selecting the median of the coordinates in the neighborhood instead of the original values, has a good suppression effect on salt-and-pepper noise. The Kalman filter, on the other hand, is a recursive filter that makes an optimal estimate of the system's state based on the system's dynamic model and the statistical characteristics of the measurement noise.
[0113] Through the above solution, this embodiment can effectively reduce the impact of visual sensor noise on trajectory prediction accuracy, improve data quality, and provide a more reliable data foundation for subsequent steps.
[0114] In one specific implementation, based on the above embodiments, the physical dynamics model specifically describes the motion state of the ping-pong ball through the following set of differential equations:
[0115] First, define the position vector of the ping-pong ball as... The velocity vector is .
[0116] Then, the system of differential equations describing the acceleration of the ping-pong ball can be expressed as:
[0117]
[0118]
[0119]
[0120] in:
[0121] It is the air drag coefficient, measured in kg / m. This coefficient characterizes the air resistance coefficient. In the quadratic drag model, the drag force experienced by the ping-pong ball is represented by this coefficient. This coefficient can be obtained experimentally, for example, by measuring the drag of the ping-pong ball at different speeds through wind tunnel experiments and then fitting the data. For a standard ping-pong ball of 40+ mm, this value is typically between 0.001 kg / m and 0.003 kg / m. In a specific implementation, It was set to 0.0022 kg / m. This refers to the mass of a ping-pong ball, expressed in kg. A standard ping-pong ball with a diameter of 40+ mm weighs 2.7g, or 0.0027kg. It is the acceleration due to gravity, with a value of 9.81 m / s². It is a velocity vector The Euclidean norm (modulus) of a ping-pong ball represents its instantaneous speed, and its formula is: .
[0122] These are the acceleration components of the ping-pong ball along the three coordinate axes.
[0123] Next, the above system of differential equations is solved using numerical integration methods. In one implementation, the fourth-order Runge-Kutta (RK4) method is used for numerical integration. Given at the initial time... Location It is possible to calculate within a very short time interval. The position after and speed By repeating this iterative process, the position and velocity of the ping-pong ball at any given moment can be extrapolated, thus predicting its trajectory. (Time interval) It can be adjusted according to actual needs, and is usually set between 0.001 seconds and 0.01 seconds.
[0124] In some other alternative implementations, the air resistance term can also be expressed as a function of the first power of the velocity (Stokes drag), in which case the drag... ,in This is the drag coefficient, which is a linear relationship with velocity. This coefficient can also be obtained by fitting experimental data, and the solution method for the differential equation is similar.
[0125] Through the above-described scheme, this embodiment can more accurately simulate the impact of air resistance on a ping-pong ball during flight, thereby improving the accuracy of trajectory prediction. Compared with a simplified model that ignores air resistance, the dynamic model provided in this embodiment can more realistically reflect the trajectory of the ping-pong ball, especially under high-speed and long-distance flight conditions, where the improvement in prediction accuracy is more significant.
[0126] In one specific implementation, based on the above embodiments, the physics and dynamics model further incorporates the inelastic recovery effect when the ping-pong ball collides with the table surface. Specifically, when the prediction module predicts that the ping-pong ball will collide with the striking plane or other planes (such as the table) during its motion, the physics and dynamics model not only considers gravity and air resistance but also introduces a velocity correction step for the collision. First, the velocity vector of the ping-pong ball at the time of the collision is detected and decomposed into a normal velocity component perpendicular to the collision surface and a tangential velocity component located within the collision surface. Then, the normal velocity component is multiplied by a recovery coefficient less than 1 to simulate energy loss during the collision. Next, the tangential velocity component is corrected according to the material properties of the collision surface to reflect the influence of friction on the ball's motion. In some other optional implementations, the correction of the tangential velocity component can use a kinetic friction coefficient model or be ignored. Finally, the corrected normal velocity component and tangential velocity component are recombined into the velocity vector after the collision, which serves as the initial condition for subsequent trajectory prediction.
[0127] Through the above scheme, this embodiment can more realistically simulate the trajectory of a ping-pong ball, improve the accuracy of trajectory prediction after collision, and thus provide a more reliable data foundation for subsequent adaptive hitting decisions.
[0128] In one specific implementation, based on the above embodiments, when the physical dynamics model predicts a collision between the ping-pong ball and the table, the inelastic recovery effect is specifically modeled as follows:
[0129] First, obtain the velocity vector before the collision. The velocity is then decomposed into horizontal and vertical velocity components. Then, using pre-calibrated horizontal and vertical restitution coefficients, the velocity components are corrected to calculate the post-collision velocity vector. .
[0130] Specifically, the formulas for calculating each velocity component after the collision are as follows:
[0131]
[0132]
[0133]
[0134] in: These are the velocity vectors before the collision. Components in the X, Y, and Z directions. These are the velocity vectors after the collision. Components in the X, Y, and Z directions. It is the horizontal restitution coefficient, a dimensionless constant whose value ranges from 0 to 1. It is the vertical restitution coefficient, a dimensionless constant with a value between 0 and 1. The negative sign before the vertical velocity component indicates a reversal of the velocity direction.
[0135] In this model, the key lies in setting .For example, It can be set to 0.8, and Set to 0.7. The coefficient of restitution is the ratio of the relative velocity after the collision to the velocity before the collision, not the percentage of kinetic energy retained. The different coefficient values mentioned above reflect that when a ping-pong ball collides with the table, the horizontal direction is mainly affected by sliding friction, while the vertical direction includes more elastic deformation and energy loss, which is consistent with actual physical phenomena.
[0136] In some alternative implementations, the horizontal and vertical coefficients of restitution can also be obtained using a lookup table. First, a two-dimensional lookup table is created, storing the coefficients of restitution measured in advance under different collision conditions, based on the collision angle and the ball's rotational speed. Then, at each collision, the system retrieves the corresponding coefficient of restitution from the lookup table based on the current collision angle and the ball's rotational speed. and The values are used for velocity correction. To more accurately reflect the actual physical processes, the data in the lookup table can be trained and optimized using machine learning methods based on a large amount of experimental data.
[0137] Through the above scheme, this embodiment can more accurately simulate the energy loss and velocity change process when a ping-pong ball collides with the table, thereby significantly improving the prediction accuracy of the physical model.
[0138] In one specific implementation, based on the above embodiments, regarding the step of dynamically calculating the swing angle of the shot, firstly, the absolute value of the predicted lateral coordinates of the shot point is calculated. Specifically, an absolute value function can be used to process the lateral coordinates to obtain a non-negative scalar, which represents the distance of the shot point from the center line of the table. Then, this absolute value is multiplied by a preset scaling factor to obtain a base swing angle value. The scaling factor is used to map the offset of the lateral coordinates to the change in angle in the joint space, and this scaling factor can be adjusted according to the kinematic parameters of the robotic arm and the size of the table.
[0139] Next, the base swing angle value is constrained, limiting it to a preset minimum angle threshold and a preset maximum angle threshold. Specifically, a limiting function can be used, which takes the base swing angle value, the minimum angle threshold, and the maximum angle threshold as input. If the base swing angle value is less than the minimum angle threshold, the minimum angle threshold is output; if the base swing angle value is greater than the maximum angle threshold, the maximum angle threshold is output; otherwise, the base swing angle value itself is output. In this way, it is ensured that the final hitting swing angle is neither too small, resulting in a weak return, nor too large, causing the swing motion to exceed the working range of the robotic arm.
[0140] In some alternative implementations, the scaling factor can be a constant or a variable related to the predicted speed of the ping-pong ball. For example, a smaller scaling factor can be used for high-speed balls to reduce the swing amplitude and thus improve the stability of the shot. Furthermore, the minimum and maximum angle thresholds can be preset fixed values or variables that are dynamically adjusted based on the trajectory of the ball.
[0141] Through the above solution, this embodiment can dynamically adjust the swing angle of the ball according to the lateral position of the incoming ball, while limiting the range of the swing angle, ensuring that the return ball has a certain amount of power, but does not exceed the working range of the robotic arm, thereby improving the stability and adaptability of the shot.
[0142] In one specific implementation, based on the above embodiments, when dynamically calculating the ball-swing angle, specific values constraining the basic swing angle are set. First, the minimum angle threshold is set to 0.5 radians. This parameter limits the minimum value of the robotic arm's ball-swing angle, ensuring that even if the incoming ball's trajectory is relatively centered, the robotic arm can return it with a sufficient angle, thereby guaranteeing the power of the return and avoiding situations where the ball fails to clear the net due to insufficient power. Then, the maximum angle threshold is set to 0.8 radians. This parameter limits the maximum value of the robotic arm's ball-swing angle, preventing ball-swing errors due to excessively large swing angles, such as exceeding the table's range. By constraining the maximum angle threshold, the stability of the shot can be improved. In some other optional implementations, the minimum angle threshold can be set to any value between 0.4 radians and 0.6 radians, and the maximum angle threshold can be set to any value between 0.7 radians and 0.9 radians.
[0143] Through the above solution, this embodiment can ensure the power of the return shot while preventing excessive swinging, thereby further improving the stability and success rate of the shot.
[0144] In one specific implementation, based on the above embodiments, the sign of the lateral coordinate xs is considered. Specifically, a sign function sign(xs) is introduced to determine the execution direction of the ball-swinging angle Δθ5. First, when xs is greater than 0, sign(xs) is defined as 1, representing that the ball is on the right side of the robot, and the robotic arm swings to the left. Then, when xs is less than 0, sign(xs) is defined as -1, representing that the ball is on the left side of the robot, and the robotic arm swings to the right. Next, this sign function is integrated into the calculation formula for the ball-swinging angle to ensure that the ball-swinging direction effectively counters the ball-swinging direction. For example, if the basic swinging angle calculated in the above embodiments is 0.6 radians and xs is positive, then the final Δθ5 is -0.6 radians, representing a 0.6 radian swing to the left. Conversely, if xs is negative, then the final Δθ5 is 0.6 radians, representing a 0.6 radian swing to the right. In some other alternative implementations, lookup tables or neural networks can be used instead of the sign function to determine the direction of the shot, but the idea remains the same: to determine the return direction based on the lateral position of the incoming ball.
[0145] Through the above solution, this embodiment enables the robot to perform a conditioned reflex-like counterattack based on the direction of the incoming ball, achieving a more intelligent adaptive strike.
[0146] In one specific implementation, based on the above embodiments, the steps for controlling the robotic arm to perform synchronized adaptive hitting actions are further refined. First, the system determines the waiting time. This waiting time is determined by calculating the time difference between the predicted arrival time of the ping-pong ball and the time required for the robotic arm to complete its preparation action. The time required for the robotic arm to complete its preparation action is calculated by the motion planning module based on the current state of the robotic arm and the target ready pose.
[0147] Then, the system employs a phased timing method based on the calculated waiting time. Specifically, the system presets a switching threshold. When the calculated waiting time exceeds this preset threshold, the system adopts the first timing mode for waiting. This first timing mode is characterized by its simplicity and low resource consumption; for example, it can be implemented by calling the thread sleep function provided by the operating system.
[0148] Next, when the remaining waiting time is less than or equal to a preset switching threshold, the system switches to the second timing mode. This second timing mode has higher precision than the first timing mode and can control the waiting time more accurately. For example, the second timing mode can be implemented using a high-precision timer or by querying a hardware clock to ensure that the synchronization error between the execution time of the hitting action and the predicted arrival time of the ping-pong ball is less than a preset precision threshold.
[0149] In some alternative implementations, the first timing mode can be implemented based on the operating system's thread sleep function, while in other alternative implementations, it can be implemented based on a low-precision timer interrupt. The second timing mode can be implemented based on a high-precision hardware clock polling function or a high-precision programmable timer. The switching threshold can be adjusted according to specific system performance and accuracy requirements.
[0150] Through the above solution, this embodiment can achieve high-precision synchronization between the robotic arm's striking action and the arrival time of the ping-pong ball with low system resource overhead, thereby improving the accuracy and stability of the strike.
[0151] In one specific implementation, based on the above embodiments, the preset switching threshold is set to 0.1 seconds, and the preset precision threshold is set to 0.001 seconds. First, the system calculates the waiting time tw, as in the aforementioned embodiments. Specifically, if the calculated tw is greater than 0.1 seconds, the system adopts the first timing mode, that is, calling the operating system thread sleep function sleep(tw - 0.1). This mode uses the operating system's underlying clock for timing, resulting in low resource consumption. Then, after the sleep ends, or if tw was originally less than or equal to 0.1 seconds, the system switches to the second timing mode. Next, this mode continuously queries the system's high-precision clock in a high-frequency loop until the difference between the current time and the target execution time is less than or equal to 0.001 seconds.
[0152] Through the above scheme, this embodiment can use 0.1 seconds as the switching point between coarse precision timing and micro precision timing. While ensuring that the overall time synchronization error does not exceed 0.001 seconds, it minimizes the occupation of CPU resources and optimizes system performance.
[0153] In one specific implementation, based on the above embodiments, before controlling the robotic arm to perform a synchronized adaptive hitting action, firstly, according to the hitting point coordinates (xs, 0.15, zs) output by the prediction module, the target angles of each joint of the robotic arm are calculated through inverse kinematics to generate a suitable ready pose.
[0154] Specifically, the inverse kinematics solution process converts the target point in the Cartesian coordinate system into angle values in the joint space of the robotic arm. This process takes into account the robotic arm's geometry and kinematic constraints, solving for multiple joint angle combinations that satisfy the target point's position and orientation. For robotic arms with redundant degrees of freedom, multiple solutions may exist. The system can select an optimal solution from these, for example, choosing a solution near the middle of the joint's range of motion to avoid the joint reaching its limit position and optimize the robotic arm's motion performance. The inverse kinematics solution process can use numerical or analytical methods. For example, mature robot kinematics libraries (such as KDL and ROS) can be used for inverse kinematics calculations.
[0155] Then, the target angles of each joint are sent to the motion controller of the robotic arm. The motion controller receives the target angles and plans a motion trajectory from the current pose to the ready pose.
[0156] Next, the motion controller drives each joint of the robotic arm to move to the corresponding target angle, so that the robotic arm reaches the ready pose. In some other alternative implementations, the posture of the robotic arm end effector can be preset according to the task requirements before the inverse kinematics solution, thereby affecting the target angle of each joint; or different inverse kinematics algorithms can be used to adapt to different robotic arm structures.
[0157] Through the above solution, this embodiment enables the robotic arm to reach a ready posture before hitting the ball, thereby improving the stability and accuracy of the shot.
[0158] In one specific implementation, based on the above embodiments, firstly, an inverse kinematics analytical formula is defined to convert the target hitting point position in the Cartesian coordinate system into the target angles of each joint of the robotic arm.
[0159] Specifically, the target angle of the robotic arm's base joint (joint 1) and the predicted lateral coordinates of the striking point satisfy a linear relationship, calculated as follows:
[0160]
[0161] in: It is the target angle of the base joint (joint 1), in radians. It is a proportionality coefficient, with units of radians per meter, and its value ranges from 0.1 to 0.3. This is the predicted horizontal coordinate of the hitting point, in meters. When When it is a positive value, When the value is positive, the base rotates to the right; when... When it is negative, If the value is negative, the base rotates to the left.
[0162] Then, a linear relationship is defined between the target angle of the shoulder joint (joint 2) and the predicted height coordinates of the hitting point, calculated as follows:
[0163]
[0164] in: It is the target angle of the shoulder joint (joint 2), in radians. It is a constant offset, in radians, with a value range of [value missing]. to This is used to ensure that the shoulder joint is always within a suitable initial angle range.
[0165] It is a proportionality coefficient, with units of radians per meter, and a value range of -0.2 to -0.1. It is used to dynamically adjust the shoulder angle according to the height of the hitting point.
[0166] These are the predicted height coordinates of the hitting point, in meters.
[0167] It is a height reference standard, with the unit being meters, and the set range is 0.2 to 0.4.
[0168] Next, to prevent the joint angles from exceeding the physical range of motion of the robotic arm, the calculated... and Amplitude limiting is applied. Final joint target angle. and The calculation is as follows:
[0169]
[0170]
[0171] in: and These are the final joint target angles after amplitude limiting processing.
[0172] and These are the minimum and maximum angle limits for the base joint, for example, the range of values is from -1.57 radians to 1.57 radians.
[0173] and These are the minimum and maximum angle limits for the shoulder joint, for example, with values ranging from -1.57 radians to 1.57 radians.
[0174] In other alternative implementations, the relationship between the target angle of the base joint and the lateral coordinate can also be non-linear, for example, using an sigmoid function or a piecewise linear function. The relationship between the target angle of the shoulder joint and the height coordinate can also incorporate quadratic or higher-order terms to achieve more complex angle adjustment strategies. (Scale factor) and It can also be dynamically adjusted using fuzzy control or neural networks to adapt to different users' hitting habits and the kinematic characteristics of the robot system.
[0175] Through the above scheme, this embodiment can simplify the inverse kinematics solution process, reduce computational complexity, and at the same time ensure that the robotic arm can quickly and accurately adjust to the appropriate ready pose, thereby improving the real-time performance and response speed of the system.
[0176] In one specific implementation, based on the above embodiments, when planning the path for the robotic arm to move from its current pose to its ready pose, firstly, the target position of each joint is determined. The target position can be calculated through inverse kinematics or through teaching and playback. Specifically, after determining the starting position and the target position, the motion time of each joint needs to be determined. All joints can complete their motion within the same time frame, or different motion times can be allocated according to the different ranges of motion of the joints. Then, velocity planning is performed for the motion of each joint. The robotic arm accelerates from rest to a preset maximum speed, moves at a constant speed for a period of time, and then decelerates to rest, thereby ensuring the smoothness of the robotic arm's motion. Next, the desired speed at each moment is calculated, and the control quantity is calculated based on the actual speed of the current joint and the desired speed to control the movement of the robotic arm.
[0177] Through the above solution, this embodiment can avoid impact and vibration during the movement of the robotic arm, and improve the positioning accuracy and movement stability of the robotic arm.
[0178] In one specific implementation, based on the above embodiments, after completing the synchronized adaptive hitting action, the system does not immediately control the robotic arm to reset. Instead, it first controls the robotic arm to maintain the posture after the hitting action. Specifically, it maintains the posture of the robotic arm's end effector (e.g., the racket) after the collision with the ping-pong ball and holds it in that posture for a period of time. Then, after a period of time, it controls the robotic arm to smoothly reset from the posture after the hitting action to the initial ready posture. This reset action should be as fast as possible to shorten the robot's reaction time, but at the same time, it should avoid generating excessive acceleration to ensure the smoothness of the movement and the lifespan of the robotic arm.
[0179] In other alternative implementations, different pose-holding strategies can be employed. For example, the post-hit pose can be partially maintained, allowing the end effector to make minor adjustments within a certain range to better adapt to balls with different spins and speeds. Alternatively, the pose-holding time can be dynamically adjusted based on the type of ball and the robot's hitting strategy to optimize the hitting effect. Different reset trajectory planning algorithms, such as fifth-order polynomial interpolation, can also be used to achieve a smoother reset process.
[0180] Through the above solution, this embodiment can ensure that the ping-pong ball gains sufficient momentum and flight posture after separating from the racket, avoiding the impact on the return quality due to premature retraction of the robotic arm, and improving the stability and consistency of the shot.
[0181] In one specific implementation, based on the above embodiments, the robotic arm maintains its posture for a preset duration after hitting the ball, and then quickly and smoothly resets to an initial, ready posture to respond to the next ball. Specifically, the preset duration is set to 0.08 seconds. First, at the instant the racket separates from the ping-pong ball after the robotic arm completes the hitting action, the control system locks the drive motors of all joints of the robotic arm, keeping the end effector (i.e., the racket) in the posture after contact with the ball for a duration accurate to 0.08 seconds. Then, after this 0.08-second holding phase, the motion control module initiates a pre-planned reset trajectory, smoothly accelerates to maximum speed, then moves at a constant speed, and finally decelerates to zero, driving each joint of the robotic arm to the initial ready posture to await the next ball. In other optional implementations, this preset duration can be adjusted according to the racket material, the force of the hit, and the overall response speed of the system. For example, for rackets with good elasticity, the holding time can be appropriately shortened; for scenarios requiring powerful shots, the holding time can be appropriately extended.
[0182] Through the above solution, this embodiment can ensure that the ping-pong ball obtains sufficient initial flight conditions after separating from the racket, avoiding the impact on the flight trajectory and quality of the ball's return due to premature resetting of the robotic arm, thereby improving the stability and control accuracy of the return.
[0183] like Figure 2 As shown, this embodiment of the invention provides a table tennis robot system for implementing the trajectory prediction and adaptive hitting method of any of the above embodiments. The system includes:
[0184] The visual acquisition module M100 is configured to acquire a series of discrete three-dimensional coordinate points of a moving ping-pong ball. In one embodiment, the visual acquisition module M100 includes one or more cameras, such as industrial cameras or depth cameras. These cameras may be part of a passive or active stereo vision system capable of capturing the positional information of the ping-pong ball in three-dimensional space. In one implementation, the visual acquisition module M100 also includes an image processing unit, which preprocesses the raw image data, such as correcting lens distortion and removing background noise, to provide high-quality image data for subsequent coordinate extraction. In other alternative embodiments, the visual acquisition module M100 may also use radar or lidar scanning to obtain the three-dimensional coordinate points.
[0185] A trajectory generation module M200, connected to a vision acquisition module M100, is configured to process a series of discrete 3D coordinate points to generate a continuous trajectory of a ping-pong ball. In one embodiment, the trajectory generation module M200 includes a data smoother. This data smoother can employ a Kalman filter algorithm to smooth the original 3D coordinate points output by the vision acquisition module M100, reducing the impact of measurement noise on trajectory reconstruction. In one implementation, the trajectory generation module M200 also includes a curve fitter for fitting the smoothed discrete points into a continuous mathematical curve, such as a Bézier curve or a B-spline curve. The curve fitter can select the least squares method as the fitting criterion to minimize the fitting error. In other alternative implementations, the trajectory generation module M200 can learn the motion pattern of the ping-pong ball through a neural network and directly output a continuous trajectory.
[0186] The prediction module M300, connected to the trajectory generation module M200, is configured to extrapolate a continuous motion trajectory based on a preset physical dynamics model to predict the coordinates of the hitting point and the arrival time of the ping-pong ball upon reaching a preset hitting plane. In one embodiment, the prediction module M300 includes a dynamics modeling unit for establishing a mathematical model describing the motion state of the ping-pong ball. This dynamics model may include the effects of factors such as gravity and air resistance. In one implementation, the prediction module M300 also includes a numerical solver for solving the equations of the dynamics model to obtain the position and velocity of the ping-pong ball at future moments. This numerical solver may use the Runge-Kutta method for solving the equations. In other optional embodiments, the prediction module M300 can predict the coordinates of the hitting point and the arrival time by consulting a pre-established motion trajectory database.
[0187] The decision module M400, connected to the prediction module M300, is configured to dynamically calculate the required swing angle of the striking joint based on the lateral coordinates of the predicted striking point. In one embodiment, the decision module M400 includes a striking strategy generator, which generates a corresponding striking strategy based on the predicted striking point information. In one implementation, the striking strategy generator may employ a fuzzy logic algorithm to determine the striking angle and force based on the lateral and longitudinal coordinates of the striking point. In other alternative implementations, the decision module M400 may learn the optimal striking strategy using a reinforcement learning algorithm.
[0188] A motion control module M500, connected to a prediction module M300 and a decision module M400, is configured to control a multi-joint robotic arm to perform synchronized adaptive hitting actions on the hitting plane based on the predicted arrival time and calculated hitting swing angle. In one embodiment, the motion control module M500 includes a motion planner for generating the robotic arm's motion trajectory, ensuring it reaches the target position and completes the hitting action within a predetermined time. In another implementation, the motion control module M500 further includes a servo controller for precisely controlling the individual joints of the robotic arm, achieving high-precision motion control. In other alternative embodiments, the motion control module M500 can acquire the impact force between the racket and the ping-pong ball using a force / torque sensor, thereby adjusting the robotic arm's movement to achieve more precise hitting.
[0189] In the aforementioned system, the vision acquisition module M100 is responsible for accurately capturing the motion state of the ping-pong ball, providing a data foundation for subsequent trajectory prediction; the trajectory generation module M200 processes the acquired data to generate a continuous motion trajectory, providing a basis for the establishment of a physical model; the prediction module M300 predicts the motion trajectory of the ping-pong ball based on the physical dynamics model, obtaining the coordinates of the hitting point and the arrival time, providing a basis for hitting decisions; the decision-making module M400 generates a hitting strategy based on the prediction results, providing target parameters for the motion control of the robotic arm; and the motion control module M500 controls the robotic arm to complete precise hitting actions according to the hitting strategy. The collaborative work of these modules enables accurate prediction of the ping-pong ball's trajectory and control of the robotic arm to complete adaptive hitting actions, thereby solving problems such as insufficient trajectory prediction accuracy, rigid hitting strategies, and weak coordination between perception and execution in existing technologies.
[0190] Through the above solution, this embodiment can achieve accurate trajectory prediction of a high-speed ping-pong ball, thereby enabling the robot to adaptively hit the ball. Compared with the prior art, the advantages of this embodiment are: a reasonable overall system architecture, clearly defined functions of each module, high collaborative work efficiency, and the ability to effectively improve the hitting success rate and intelligence level of the ping-pong robot system.
[0191] In one specific implementation, based on the above embodiments, the trajectory generation module M200 includes: a spline interpolation unit configured to receive a series of discrete three-dimensional coordinate points from the vision acquisition module M100, and to generate a piecewise continuous three-dimensional trajectory function using a cubic spline interpolation algorithm; and a polynomial fitting unit connected to the spline interpolation unit, configured to receive the piecewise continuous three-dimensional trajectory function, and to generate a three-dimensional motion trajectory with a unified analytical expression using a cubic polynomial fitting algorithm.
[0192] The spline interpolation unit is further configured to perform cubic spline interpolation using natural boundary conditions. For example, in the algorithm implementation, it can be initialized using the `gsl_spline_init` function from the open-source GSL (GNU Scientific Library) library, and the coordinate values at any time can be calculated using the `gsl_spline_eval` function.
[0193] Polynomial fitting units can be fitted using the least squares method. For example, first construct a matrix containing t, t², t³, and a target vector containing the coordinates of each sampling point. Then, by solving the pseudo-inverse of this matrix, the coefficients of the cubic polynomial are obtained. In practice, the polyfit function in the NumPy library can be used to directly perform cubic polynomial fitting.
[0194] In other alternative implementations, the spline interpolation unit can employ other types of spline interpolation, such as Akima spline interpolation or Hermite spline interpolation, to accommodate data with different noise levels. The polynomial fitting unit can also employ higher-order polynomial fitting, or choose radial basis functions (RBF) for fitting.
[0195] Through the above approach, this embodiment provides a clear and modular trajectory generation scheme. By combining spline interpolation and polynomial fitting, it ensures both the local accuracy of the trajectory and the global uniformity of the trajectory, providing a high-quality data foundation for subsequent physical model prediction.
[0196] In one specific implementation, based on the above embodiments, the prediction module M300 is configured to implement an enhanced physics and dynamics model that simultaneously considers gravity, air resistance proportional to the square of the ping-pong ball's velocity, and the inelastic recovery effect when the ping-pong ball collides with the table. The prediction module M300 includes the following sub-modules: a gravity calculation unit, an air resistance calculation unit, and a collision processing unit.
[0197] The gravity calculation unit is configured to provide a constant gravitational acceleration value, which is set to 9.81 m / s² and points in the negative Z-axis direction.
[0198] The air resistance calculation unit is configured to calculate air resistance that is opposite in direction to the velocity vector of the ping-pong ball and whose magnitude is proportional to the square of the velocity. This unit calculates the air resistance vector using the following formula:
[0199]
[0200] in: It is the air resistance vector, and its unit is Newton (N). It is the secondary air drag coefficient, with units of kg / m. Its value is determined experimentally and set to 0.02 kg / m in this implementation. It is the velocity vector of the ping-pong ball, with the unit being m / s. It is a velocity vector The modulus represents the instantaneous velocity of the ping-pong ball. The air resistance calculation unit transmits the calculated air resistance value to the motion state update unit to influence the trajectory prediction of the ping-pong ball.
[0201] The collision handling unit is configured to detect collisions between the ping-pong ball and the table, and modify the velocity components of the ping-pong ball according to the inelastic restitution coefficient when a collision occurs. The unit first determines whether the Z-coordinate of the ping-pong ball is less than or equal to 0; if this condition is met, a collision is determined to have occurred. Then, the unit updates the velocity components after the collision according to the following formula:
[0202]
[0203]
[0204]
[0205] in: These are the velocity components before the collision. These are the velocity components after the collision. It is the horizontal restitution coefficient, which is a dimensionless constant. It is the vertical restitution coefficient, which is a dimensionless constant.
[0206] In one implementation, It was set to 0.8. It is set to 0.7. In some other alternative implementations, and Adjustments can be made based on different table tennis table materials and types of ping pong balls. For example, for tables with higher friction, It can be set to 0.75; for more elastic ping-pong balls, It can be set to 0.78.
[0207] The various units of the prediction module M300 work together to more accurately predict the trajectory of the ping-pong ball.
[0208] Through the above solution, this embodiment can more accurately simulate the actual trajectory of a ping-pong ball, reduce prediction errors, and thus improve the performance of the entire ping-pong robot system.
[0209] In one specific implementation, based on the above embodiments, the decision module M400 includes an angle calculation unit, an angle constraint unit, and a direction determination unit.
[0210] The angle calculation unit receives the lateral coordinates of the hitting point output by the prediction module M300. The basic swing angle is calculated using the following formula:
[0211]
[0212] in: It is the value of the basic swing angle, in radians.
[0213] This is a proportionality coefficient, the value of which is calibrated based on the kinematic parameters of the robotic arm and the size of the ball table. For example, The range of values can be The unit is radians per meter.
[0214] It is the horizontal coordinate. The absolute value of.
[0215] The angle constraint unit receives the basic swing angle output by the angle calculation unit. The angle is then constrained between preset minimum and maximum angle thresholds to obtain the final swing angle value. .
[0216]
[0217] in: It is the final swing angle value after constraint. It is a preset minimum angle threshold, for example, its value can be 0.5 radians. It is a preset maximum angle threshold, for example, its value can be 0.8 radians.
[0218] The direction determination unit receives the lateral coordinates of the hitting point output by the prediction module M300. and according to The positive or negative sign of the sign determines the direction of the swing angle. Specifically, when When the ball is on the right side of the table, the direction of the shot is negative, meaning the ball swings to the left; when... When the ball is on the left side of the table, the direction of the shot is positive, that is, to the right.
[0219] Finally, the angle value is combined with the direction to obtain the marked ball swing angle that is sent to the motion control module. :
[0220]
[0221] in: It is a sign function, when Its value is +1 when Its value is -1 at that time.
[0222] The minus sign "-" at the beginning implements the control logic of "attack from the left when it comes from the right, and attack from the right when it comes from the left".
[0223] In some other alternative implementations, the angle constraint unit can use different limiting functions, such as the sigmoid function or the tanh function, to smoothly constrain the base swing angle.
[0224] Through the above-described scheme, this embodiment can adaptively adjust the hitting swing angle according to the lateral position of the incoming ball, and ensure that the hitting swing angle is within a reasonable range, thereby improving the stability and accuracy of the shot. Compared with the prior art, the beneficial effect of this embodiment is that it can provide differentiated hitting strategies for balls with different trajectories, enhancing the adaptability of the robot system.
[0225] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A trajectory prediction and adaptive striking method, applied to a table tennis robot system including a vision sensor and a multi-joint robotic arm, characterized in that, include: The visual sensor acquires a series of discrete three-dimensional coordinate points of a moving ping-pong ball; The series of discrete three-dimensional coordinate points are processed to generate the continuous trajectory of the ping-pong ball; Based on a preset physical dynamics model, the continuous motion trajectory is extrapolated to predict the coordinates of the hitting point and the arrival time of the ping-pong ball when it reaches the preset hitting plane. Based on the lateral coordinates in the predicted hitting point coordinates, the required hitting swing angle of the robotic arm's hitting joint is dynamically calculated. Based on the predicted arrival time and the calculated ball swing angle, the robotic arm is controlled to perform a synchronous adaptive ball-hitting action at the hitting plane.
2. The method according to claim 1, characterized in that, The steps for generating the continuous trajectory of the ping-pong ball include: Cubic spline interpolation is used to process the series of discrete three-dimensional coordinate points to obtain a piecewise continuous trajectory function. A cubic polynomial fit is performed on the piecewise continuous trajectory function to obtain a unified analytical expression for the continuous motion trajectory.
3. The method according to claim 1 or 2, characterized in that, Before processing the series of discrete three-dimensional coordinate points, the method further includes: Gaussian filtering is performed on the series of discrete three-dimensional coordinate points to filter out noisy data.
4. The method according to claim 1, characterized in that, The physical dynamics model takes into account the effects of gravity and air resistance, which is proportional to the square of the speed of the ping-pong ball.
5. The method according to claim 4, characterized in that, The physical dynamics model also takes into account the inelastic recovery effect when the ping-pong ball collides with the table surface.
6. The method according to claim 5, characterized in that, The inelastic recovery effect is characterized by the horizontal recovery coefficient and the vertical recovery coefficient, wherein the value of the horizontal recovery coefficient is greater than the value of the vertical recovery coefficient.
7. The method according to claim 1, characterized in that, The step of dynamically calculating the ball swing angle includes: The base swing angle is calculated proportionally based on the absolute value of the horizontal coordinate. The basic swing angle is constrained between a preset minimum angle threshold and a preset maximum angle threshold to obtain the ball swing angle.
8. The method according to claim 7, characterized in that, The minimum angle threshold is 0.5 radians, and the maximum angle threshold is 0.8 radians.
9. The method according to claim 7 or 8, characterized in that, The steps for performing the adaptive hitting action also include: The direction of execution of the ball-swinging angle is determined based on the positive or negative sign of the horizontal coordinate.
10. A table tennis robot system, applied to trajectory prediction and adaptive hitting, characterized in that, include: The vision acquisition module is configured to acquire a series of discrete three-dimensional coordinate points of a moving ping-pong ball; The trajectory generation module, connected to the vision acquisition module, is configured to process the series of discrete three-dimensional coordinate points to generate the continuous motion trajectory of the ping-pong ball. The prediction module, connected to the trajectory generation module, is configured to extrapolate the continuous motion trajectory based on a preset physical dynamics model to predict the coordinates of the hitting point and the arrival time of the ping-pong ball when it reaches the preset hitting plane. The decision module, connected to the prediction module, is configured to dynamically calculate the required swing angle of the hitting joint based on the lateral coordinate in the predicted hitting point coordinates. The motion control module, connected to the prediction module and the decision module, is configured to control the multi-joint robotic arm to perform synchronous adaptive hitting motions at the hitting plane based on the predicted arrival time and the calculated hitting swing angle.