Multi-person redirection walking and position prediction method based on artificial potential field
By optimizing the repulsive force vectors between the user and obstacles and other users using an artificial potential field-based method and multi-layer LSTM and attention mechanism, the collision risk and prediction accuracy problems in multi-user dynamic scenarios are solved, achieving efficient and safe virtual reality navigation.
Patent Information
- Application Number
- CN202510478562.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-04-16
AI Technical Summary
Existing redirection algorithms have fixed repulsion force weights in multi-user dynamic scenarios, resulting in high collision risk, frequent resets, and insufficient short-term position prediction accuracy in predictive redirection.
An artificial potential field-based approach is adopted. By calculating the repulsive force vectors between the user and obstacles and other users, a Gaussian decay function and a relative head orientation factor are introduced to dynamically adjust the repulsive force weights. Combined with user density and safety distance, the resultant force vector is optimized to avoid collisions. At the same time, a multi-layer LSTM and attention mechanism are used for position prediction.
It significantly reduces the reset frequency, improves navigation efficiency and location prediction accuracy in high-density scenarios, and achieves near-zero reset in large spaces, enhancing the naturalness and accuracy of user movement.
Smart Images

Figure CN120407997B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of virtual reality and robot navigation, and particularly relates to a multi-person redirection walking and position prediction method based on artificial potential field. BACKGROUND
[0002] In recent years, with the development of virtual reality and augmented reality technologies, the fusion of virtual and real spaces has become an important trend. In virtual reality, users are allowed to explore a computer-simulated virtual environment so that virtual reality users can immerse themselves in a completely artificial virtual world and interact with any virtual object. Immersive virtual reality systems combined with head-mounted displays and large-area position tracking systems enable users to move naturally in virtual environments as they do in the physical world. Natural walking, the most common movement technique in the real world, has been proven to enhance presence and help users perform better in search tasks. This is more intuitive than navigating through joysticks or specialized hardware such as treadmills, and precise redirection navigation has become an important part of virtual reality exploration.
[0003] However, limited physical tracking space often limits the exploration of large virtual spaces, and the size of the virtual world cannot be larger than the physical tracking area to avoid collisions with the tracking area boundary. In order to simulate an infinite size world, the correspondence between physical and virtual motion can be manipulated to facilitate navigation in a larger range. Reactive algorithms and predictive methods are considered effective means to effectively solve virtual reality redirection. However, existing reactive algorithms for redirection technology in dynamic multi-user environments still have the problem that the repulsive force weight between the environment and the user is fixed and difficult to adapt to changes in high-density scenarios; predictive methods predict the user's next movement by analyzing the physical and virtual environments to develop more effective redirection strategies, and accurate short-term position prediction is particularly important for predictive algorithms. SUMMARY
[0004] In view of the problems of fixed repulsive force weight, high collision risk, frequent resetting of traditional redirection walking algorithms in multi-user dynamic scenarios, and insufficient short-term position prediction accuracy leading to collision problems of predictive redirection, the present application provides a multi-person redirection walking and position prediction method based on artificial potential field.
[0005] In order to achieve the above purpose, the present application adopts the following technical solutions:
[0006] A multi-person redirection walking and position prediction method based on artificial potential field, the method comprising the following steps:
[0007] Step 1, calculate the repulsive force vector of the environment acting on the user;
[0008] Further, the specific steps of step 1 are:
[0009] First, the shortest distance between the user and each environmental obstacle is calculated to obtain a vector d pointing to the nearest point of the obstacle k :
[0010] d k = p - l k
[0011] where p is the user center position, and l is the nearest point of the obstacle on the corresponding boundary line segment k , the vector d k indicates the direction between the user and the nearest point of the obstacle, and the length ||d k || reflects the distance between the user and the obstacle.
[0012] Subsequently, the vector d k is normalized, and a Gaussian decay function is introduced according to the distance between the user and each environmental obstacle:
[0013]
[0014] where σ is an environmental scale parameter, which ensures that the weight increases when the user approaches the obstacle, and the repulsive force vector acting on the user is defined as:
[0015]
[0016] where D is the sum of the distances from the user to all obstacles and other users:
[0017]
[0018] where n represents the total number of obstacles, k represents the obstacle variable, m represents the total number of users, i represents the user variable, and ||h i || represents the distance between the user and other users.
[0019] The repulsive force generated by each obstacle is weighted by this method. That is, the closer the distance, the stronger the repulsive effect, and the influence of distant obstacles decays rapidly. Unlike the original algorithm which only uses distance ratio scaling, this method adds a weight factor when calculating, thereby strengthening the redirection signal in the case of near obstacles and ensuring that the user can avoid collision hazards in time.
[0020] Step 2, calculate the repulsive force vector of other users acting on the current user;
[0021] Further, the specific steps of step 2 are:
[0022] For user interaction, this algorithm uses a similar idea. For each pair of users, first calculate the difference vector h i :
[0023] h i = p - c k
[0024] where c k is the position of another user, and the relative angle is determined by the respective moving directions, and the normalized relative heading factor k i is obtained accordingly:
[0025]
[0026] where θ1 and θ2 are the angles between the moving directions and the line connecting the current user and the other user, respectively. The factor takes a higher value when the users are facing each other, thereby amplifying the repulsive force between them. Conversely, when the moving directions are parallel or opposite, the repulsive force is weaker.
[0027] On this basis, a minimum distance mechanism is introduced, and a safety threshold s is set. When d < s, an additional safety repulsive force F safety is calculated:
[0028]
[0029] Finally, the repulsive force vector generated by the other users acting on the current user is defined as:
[0030]
[0031] where k i represents the relative heading factor.
[0032] An additional weight regulation is introduced to smoothly adjust the redirection strength in a user-dense scenario, thereby improving the naturalness and accuracy of the overall motion.
[0033] Step 3: Calculate the resultant repulsive force vector. The physical space and the boundaries of other users are used as obstacles to calculate the repulsive force vector. Finally, the resultant repulsive force vector is obtained by weighted summation of the environmental repulsive force and the user repulsive force. The direction of the resultant repulsive force vector is extracted as the turning direction of the user, and the user's motion trajectory is obtained by guiding the user to walk.
[0034] Further, the specific steps of step 3 are as follows:
[0035] The concept of user density is introduced to dynamically reflect the distribution of users in the environment. The formula is as follows:
[0036]
[0037] where N represents the number of users, and radius represents the radius.
[0038] The weights of the environment and user repulsion forces are defined according to the user density:
[0039]
[0040] wherein a represents the weight of the environment repulsion force; and β represents the weight of the user repulsion force;
[0041] In the case of a high user density, the influence of the environment repulsion force is automatically reduced, while the repulsion force between users is enhanced, so as to more accurately adjust the user motion trajectory. The total synthesized repulsion force vector is obtained through the following formula:
[0042]
[0043] wherein t represents the total synthesized repulsion force vector.
[0044] In the synthesis, the environment repulsion force is given a greater weight, so as to give priority to collision avoidance safety when approaching the wall. After such dynamic weighting and fusion, the total force vector not only reflects the relative action of each component, but also can flexibly adjust the redirection strategy according to the actual situation, so as to realize more concealed and smooth steering operation between the virtual and real worlds.
[0045] Step 4: When the user approaches the obstacle or other user in the virtual environment and has a risk of collision, a reset as an emergency strategy is introduced, and the target is the safe operation of virtual navigation, which provides safety protection for immersive virtual walking. The system uses the total guide force vector at the beginning of the reset as the target direction of the user after the reset, ensuring that the user is consistent with the virtual path in the physical space while avoiding physical collision;
[0046] Further, the specific steps of the step 4 are as follows:
[0047] The Euclidean distance between the user and the environment vector and the other user vector is calculated:
[0048]
[0049] wherein v i =(v ix ,v iy ) is the vector of the environment obstacle or other user, and when the norm of any vector is greater than a set safety threshold, there is a risk of collision; and the angle difference between the current travel direction and the environment and other user guide force vectors is calculated:
[0050] Δθ=|θ u -θ v |=|(θ u -θ v +π)mod2π-π|
[0051] wherein θ uθ is the angle between the current user's movement direction and the x-axis. v The angle between the obstacle's direction and the x-axis is Δθ. When the angle difference Δθ is less than 90°, the vector is considered to be likely to cause a collision.
[0052] In a multi-user environment, the guiding forces of environment vectors and user vectors have different impacts on user behavior. Different weights, w, are assigned to the environment and user vectors respectively. env and w user When the weighted distance satisfies the following relationship, the system will determine that there is a collision risk and trigger a reset:
[0053] d i ×w≥threshold
[0054] Where threshold is the collision safety threshold; w represents the weights set by the environment and the user.
[0055] During the reset process, the system locks the total guiding force vector at the start of the reset to prevent the target's orientation from changing during rotation. The selection of the rotation direction follows the "maximum angle principle," meaning that between the user's current direction and the guiding force vector, the direction requiring the largest rotation angle is selected. The rotation angle is calculated as follows:
[0056] Δθ rotate =min(|θ t -θ u |,2π-|θ t -θ u |)
[0057] Where, θ t The direction of the total guiding force is defined. The rotation gain is determined by the rotation angle (a larger rotation angle ensures a smaller rotation gain, meaning less impact on the user). The rotation gain calculation formula is as follows:
[0058]
[0059] Step 5: Standardize the user application trajectory used for redirection. Use MinMaxScaler to normalize the data, scale all input data to between 0 and 1, and divide the dataset into training and test sets at a ratio of 80%. The data will be used to predict the user's short-term motion trajectory using the prediction model.
[0060] Step 6, in the process of predicting the short-term motion trajectory of the user using the prediction model, the prediction model adopts a multi-layer long short-term memory network (LSTM) as an encoder and a decoder, the encoder maps the original space-time trajectory data to a high-dimensional context space, and the decoder generates accurate future position prediction based on the context space; the encoder adopts a three-layer stacked LSTM structure, and a plurality of LSTM layers are stacked to capture different features in the time sequence from multiple levels and enhance the expression ability of the complex data, and the specific steps are as follows:
[0061] The input sequence of the encoder is X={x1, x2,...,x T Each is a d-dimensional feature at the t time. For the lth layer of the LSTM, the state update formula at the time step t is:
[0062]
[0063] Where, sigma(·) is a sigmoid activation function, tanh(·) is a hyperbolic tangent activation function, and represents element-wise multiplication; W i l , , respectively, represent the input weight matrix of the input gate, the forgetting gate, the output gate and the candidate cell state update in the lth layer of the LSTM, which acts on the input vector x t of the current time, for learning the influence of the input feature on the update of each gate and cell state; , respectively, represent the cycle (hidden) weight matrix of the input gate, the forgetting gate, the output gate and the candidate cell state update in the lth layer of the LSTM, which acts on the hidden state vector of the last time, for learning the influence of the historical hidden state on the update of the current gate and cell state; , respectively, represent the bias vectors of the input gate, the forgetting gate, the output gate and the candidate cell state update in the lth layer of the LSTM, for adjusting the activation threshold of the update of each gate and cell state; in order, the input gate The forgetting gate f t l , the output gate The cell state update And the hidden state update
[0064] The task of the decoder is to predict the position of the future time step based on the context vector generated by the encoder, and the decoder adopts a RepeatVector operation and a multi-layer LSTM structure to dynamically generate the future trajectory sequence, and the specific steps are as follows:
[0065] The target of the decoder is to generate a trajectory future of n The output of each time step depends on the hidden state and cell state of the previous time step, and the decoder updates the hidden state and cell state in the same way as the encoder:
[0066]
[0067] where, denotes the hidden state vector of the decoder at the t-th time step; denotes the cell state vector of the decoder at the t-th time step; y t-1 denotes the previous time step output input by the decoder at the t-th time step;
[0068] The prediction value of each subsequent time step is mapped through a fully connected layer:
[0069]
[0070] where, W y denotes the weight matrix of the output layer; b y denotes the bias vector of the output layer; and respectively control the linear transformation and bias of the hidden state to the final prediction value.
[0071] The RepeatVector operation repeats the output of the encoder (hidden state and cell state) n future times, and gradually generates the future trajectory through the LSTM layer of the decoder, finally outputting
[0072] This not only effectively deals with variable environments and user behavior, but also improves the model's prediction ability over a long time span. In particular, in a multi-user interaction scenario, the ability to generate sequences helps to predict future trends, thereby achieving more accurate spatiotemporal location prediction.
[0073] Step 7: Introduce an attention mechanism between the encoder and the decoder, so that the model can dynamically focus on the most important historical data for future trajectory prediction.
[0074] Further, the specific steps of step 7 are:
[0075] At each time step, calculate the correlation e t between the current state s j of the decoder and the encoder output h tj :
[0076]
[0077] where, denotes the transpose of the hidden state vector s t of the decoder at the t-th time step; W aThis represents the attention weight matrix in the attention mechanism, and its function is to adjust the attention weights of s. t and h j A linear transformation is performed to capture their interrelationships and importance in attention computation.
[0078] Then, the attention weights are calculated:
[0079]
[0080] Calculate the weighted context vector c using attention weights. t :
[0081]
[0082] The final output is the attention-enhanced decoder output:
[0083]
[0084] Attention mechanisms are particularly important in complex spatiotemporal trajectory prediction tasks, especially when user behavior changes significantly or the environment is complex. Attention mechanisms help the model focus on key time steps, thereby improving the accuracy of predictions.
[0085] Compared with the prior art, the present invention has the following advantages:
[0086] By employing mechanisms such as dynamic potential field weight optimization and direction awareness, this algorithm effectively addresses the insufficient adaptability of traditional algorithms in high-density scenarios due to fixed repulsion force weights. It significantly reduces reset frequency in both single-user and multi-user environments, achieving near-zero reset in large spaces, thus validating the algorithm's adaptability to complex environments. Through safe distance constraints and a repulsion force nonlinearity enhancement strategy, it effectively balances user interaction conflicts with navigation efficiency, providing a new paradigm for solving dynamic obstacle avoidance problems in virtual-real space mapping. Furthermore, by fusing temporal features with a spatial attention mechanism, it significantly improves the accuracy of short-term position prediction. Particularly in large spaces with high user freedom of movement, the model's ability to capture long-term trajectory trends is more prominent. This phenomenon aligns with sequence modeling theory, where attention mechanisms, through dynamic weight allocation, can effectively alleviate information decay in long-sequence dependencies. Attached Figure Description
[0087] Figure 1 A diagram illustrating the process of guiding and resetting a multi-user redirection algorithm;
[0088] Figure 2 A schematic diagram illustrating the process of predicting location information using short-term location prediction methods;
[0089] Figure 3 Schematic diagram of prediction performance under different space sizes;
[0090] Figure 4 The prediction method and the GRU local amplification contrast chart. DETAILED DESCRIPTION
[0091] For a further understanding of the application, we will now describe it in further detail. The application, however, is susceptible to modifications and alternative forms, and specific embodiments are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that there is no intent to limit the application to the particular embodiments described or illustrated.
[0092] A multi-person redirection walking and position prediction method based on artificial potential field, the method comprising the following steps:
[0093] Step 1, calculate the repulsive force vector of the environment acting on the user;
[0094] Further, the specific steps of step 1 are:
[0095] First, the shortest distance between the user and each environmental obstacle is calculated to obtain the vector d k :
[0096] d k = p - l k
[0097] wherein the user center position is p, and the point on the boundary line segment of the obstacle closest to the user center position p is denoted as l k , the vector d k indicates the direction between the user and the closest point of the obstacle, and the modulus ||d k || reflects the distance between the user and the obstacle;
[0098] Subsequently, the vector d k is normalized, and a Gaussian decay function is introduced according to the distance from the user to each environmental obstacle:
[0099]
[0100] wherein σ is an environmental scale parameter, which ensures that the weight increases when the user approaches the obstacle, and the final repulsive force vector of the environment acting on the user is defined as:
[0101]
[0102] wherein D is the sum of the distances from the user to all obstacles and other users:
[0103]
[0104] wherein n represents the total number of obstacles; k represents the obstacle variable; m represents the total number of users; i represents the user variable; and ||h iThe distance between the user and other users is represented by ||.
[0105] The repulsion force generated by each obstacle is weighted by this method. That is, the closer the distance, the stronger the repulsion effect, and the influence of distant obstacles decays rapidly. Unlike the original algorithm, which only uses distance ratio scaling, this method adds a weight factor when calculating, thereby strengthening the redirection signal in the case of near obstacles and ensuring that the user can avoid collision hazards in time.
[0106] Step 2, calculate the repulsion vector of other users acting on the current user;
[0107] Further, the specific steps of step 2 are:
[0108] For user interaction, this algorithm uses a similar idea. For each pair of users, first calculate the difference vector h i between them
[0109] h i = p-c k
[0110] where c k is the position of the other user, and then determine the relative angle using the respective motion direction, and accordingly find the normalized relative heading factor k i :
[0111]
[0112] where θ1 and θ2 are the angles between the motion direction and the connecting line between the current user and the other user, respectively. This factor takes a higher value when the users are facing each other, thereby amplifying the repulsion between them; conversely, when the motion direction is parallel or away, the repulsion is weaker.
[0113] On this basis, the minimum distance mechanism is introduced, and a safety threshold s is set. When d < s, an additional safety repulsion force F safety is calculated:
[0114]
[0115] Finally, the repulsion vector of other users acting on the current user is defined as:
[0116]
[0117] where k i represents the relative heading factor.
[0118] An additional weight is introduced to regulate the redirection force in a dense user scenario, improving the naturalness and accuracy of overall motion.
[0119] Step 3, calculate the resultant repulsion vector, calculate the repulsion vector with the physical space and the boundaries of other users as obstacles, and finally the resultant repulsion vector is obtained by weighted summation of the environmental repulsion and the user repulsion, extract the direction of the resultant repulsion vector as the steering direction of the user, guide the user to walk to obtain the user motion trajectory;
[0120] Further, the specific steps of step 3 are:
[0121] The concept of user density is introduced, so that the synthesis result dynamically reflects the distribution of users in the environment, and the formula is:
[0122]
[0123] Wherein, N represents the number of users, and radius represents the radius;
[0124] According to the size of the user density, the weights of the environmental and user repulsion are defined respectively:
[0125]
[0126] Wherein, α represents the weight of the environmental repulsion; β represents the weight of the user repulsion;
[0127] In the case of user concentration, the influence of environmental repulsion is automatically reduced, and the repulsion between users is enhanced, so as to more accurately adjust the user motion trajectory. The synthesized total repulsion vector is obtained by the following formula:
[0128]
[0129] Wherein, t represents the synthesized total repulsion vector.
[0130] In the synthesis, the environmental repulsion is given a greater weight, so as to preferentially ensure collision avoidance safety when approaching the wall. After such dynamic weighted fusion, the obtained total force vector not only reflects the relative action of each component, but also can flexibly adjust the redirection strategy according to the actual situation, so as to realize more concealed and smooth steering operation between the virtual and real world.
[0131] Step 4, when the user approaches the obstacle or other users in the virtual environment and has the risk of collision, the reset as an emergency strategy is introduced, and the target is the safe operation of virtual navigation, which provides safety guarantee for immersive virtual walking. The system uses the total guide force vector at the beginning of the reset as the target direction of the user after the reset, ensures that the user is consistent with the virtual path in the physical space, and avoids physical collision at the same time;
[0132] Further, the specific steps of step 4 are:
[0133] Calculate the Euclidean distance between the user and the environmental vector and the other user vector:
[0134]
[0135] where, v i = (v ix , v iy ) is the vector of environmental obstacles or other users, when the norm of any vector is greater than the set safety threshold, there is a risk of collision; and then calculate the angle difference between the current direction of travel and the environmental and other user guidance force vectors:
[0136] Δθ = |θ u - θ v | = | (θ u - θ v + π) mod 2π - π|
[0137] where, θ u is the angle between the current user movement direction and the x-axis, and θ v is the angle between the obstacle direction and the x-axis, when the angle difference Δθ is less than 90°, the vector is considered to be possible to cause a collision.
[0138] In a multi-user environment, the influence of environmental vectors and user vectors on user behavior is different, and different weights are set for the environment and users, w env and w user , when the weighted distance satisfies the following relationship, the system will determine that there is a risk of collision and trigger a reset:
[0139] d i x w ≥ threshold
[0140] where, threshold collision safety threshold; w represents the weight set for the environment and users;
[0141] During the reset process, the system will lock the total guidance force vector at the start of the reset to prevent changes in the target orientation during rotation. The selection of the rotation direction follows the "maximum angle principle", that is, between the user's current direction and the guidance force vector, the direction that needs to be rotated is selected. The rotation angle is calculated as follows:
[0142] Δθ rotate = min(|θ t - θ u |, 2π - |θ t - θ u |)
[0143] where, θ t is the direction of the total guidance force. The rotation gain is determined by the rotation angle (a larger rotation angle ensures a smaller rotation gain, that is, a smaller impact on the user), and the rotation gain calculation formula is as follows:
[0144]
[0145] Step 5, the user trajectory of the redirection is standardized, the data is normalized using MinMaxScaler, all data is scaled to 0 to 1, and the data set is divided into a training set and a test set in a ratio of 80%, which is used to predict the user's short-term motion trajectory by the prediction model;
[0146] Step 6, in the process of predicting the user's short-term motion trajectory by using the prediction model, the prediction model adopts a multi-layer long short-term memory network LSTM as an encoder and a decoder, the encoder maps the original spatio-temporal trajectory data to a high-dimensional context space, and the decoder generates accurate future position prediction based on the context space; the encoder adopts a three-layer stacked LSTM structure, and a plurality of LSTM layers are stacked to capture different features in the time series from multiple levels and enhance the expression ability of the complex data, and the specific steps are as follows:
[0147] The input sequence of the encoder is X = {x1, x2,..., xT}, where each x T is a d-dimensional feature at time t. For the lth layer of LSTM, the state update formula at time step t is:
[0148]
[0149] Where, σ(·) is a sigmoid activation function, tanh(·) is a hyperbolic tangent activation function, and represents an element-wise multiplication;
[0150] W i l , , respectively, represent the input weight matrices of the input gate, the forget gate, the output gate, and the candidate cell state update in the lth layer of LSTM, which act on the input vector x t at the current time, for learning the influence of the input feature on the update of each gate and cell state; , respectively, represent the recurrent (hidden) weight matrices of the input gate, the forget gate, the output gate, and the candidate cell state update in the lth layer of LSTM, which act on the hidden state vector at the previous time, for learning the influence of the historical hidden state on the update of the current gate and cell state; , respectively, represent the bias vectors of the input gate, the forget gate, the output gate, and the candidate cell state update in the lth layer of LSTM, for adjusting the activation threshold of the update of each gate and cell state; in order, they are the input gate the forget gate f t l , the output gate the cell state update and the hidden state update
[0151] The task of the decoder is to predict the position of the future time step based on the context vector generated by the encoder. The decoder uses the RepeatVector operation and a multi-layer LSTM structure to dynamically generate the future trajectory sequence. The specific steps are as follows:
[0152] The goal of the decoder is to generate a trajectory of n future future time steps The output of each time step depends on the hidden state and cell state of the previous time step. The decoder updates the hidden state and cell state in the same way as the encoder:
[0153]
[0154] where, st represents the hidden state vector of the decoder at the tth time step; ct represents the cell state vector of the decoder at the tth time step; y t-1 yt-1 represents the output of the previous time step input to the decoder at the tth time step;
[0155] The predicted value of each subsequent time step is mapped through a fully connected layer:
[0156]
[0157] where, y W represents the weight matrix of the output layer; b y b represents the bias vector of the output layer; respectively control the linear transformation and bias of the hidden state to the final predicted value.
[0158] The RepeatVector operation repeats the output of the encoder (hidden state and cell state) n future times, and gradually generates the future trajectory through the LSTM layer of the decoder, finally outputting
[0159] This not only effectively deals with variable environments and user behavior, but also improves the model's prediction ability over a long time span. In particular, in a multi-user interaction scenario, the ability to generate sequences helps to predict future trends, thereby achieving more accurate spatio-temporal position prediction.
[0160] Step 7: Introduce an attention mechanism between the encoder and the decoder, so that the model can dynamically focus on the most important historical data for future trajectory prediction.
[0161] Further, the specific steps of step 7 are as follows:
[0162] At each time step, the current state st and the encoder output h j between the relevance e tj :
[0163]
[0164] where, denotes the hidden state vector s t of the decoder at the t-th time step; W a denotes the attention weight matrix in the attention mechanism, which serves to linearly transform s t and h j , thereby capturing their mutual relationship and importance in attention calculation.
[0165] The attention weight is then calculated as:
[0166]
[0167] The weighted context vector c t is calculated using the attention weight:
[0168]
[0169] The final output is the attention-enhanced decoder output:
[0170]
[0171] The attention mechanism is particularly important in complex spatio-temporal trajectory prediction tasks, especially when user behavior changes significantly or the environment is complex. The attention mechanism helps the model focus on key time steps, thereby improving the accuracy of prediction.
[0172] Simulation is a common method for studying redirected walking. The redirected method APF-WPR and the position prediction method proposed in the invention are evaluated on a simulation dataset. The simulation dataset consists of user motion trajectories generated by simulation, and each user's motion trajectory includes physical position and virtual position.
[0173] Table 1 Comparison of results of different redirected methods for a single user on a simulation dataset
[0174]
[0175] Table 1 shows the evaluation index comparison results of the proposed method and some mainstream single-user redirection methods on the simulation data set. The proposed method is better than the recent method APF-S2T and the previously proven best-performing algorithm S2C in such tasks, which shows that the minimum safety distance mechanism strengthens the role of environmental repulsion when approaching the boundary, making the user adjust the route earlier, reducing the need for emergency reset, and effectively improving the redirection performance. Compared with the S2C method that guides the user to turn to the center, the proposed method has a significant improvement in rooms of different sizes; compared with APF-RDW, the number of user resets is reduced by 20% in small spaces, and the average distance between resets is increased by 25%, and the method is better than the method in the remaining scenarios; compared with the recent APF-S2T method, the method is slightly lower than APF-S2T in medium-sized spaces, but has a significant improvement in small and large spaces, indicating the applicability of the method to rooms of different sizes.
[0176] Table 2 shows the results of different redirection methods for multiple users on the simulation data set.
[0177]
[0178]
[0179] Multiple-user experiments were conducted on the simulation data set, as shown in Table 2, and the proposed method is better than the APF-RDW method in terms of reset times and distances between resets. In small and medium-sized spaces with fewer people, it is slightly lower than APF-S2T, and is better than APF-S2T in other conditions. Experimental data further proves that in most test scenarios, the proposed algorithm can further reduce the number of resets, especially in larger physical spaces, with a reset frequency close to 0, which greatly improves the walking experience.
[0180] To verify the performance of the prediction method, the prediction accuracy of the proposed method, the traditional LSTM model, and the GRU model was compared in different physical space scales (5x5m, 10x10m, 20x20m, 30x30m). Figure 3 The performance of the three models in mean square error is shown. The results further show that the proposed method is significantly better than the commonly used LSTM and GRU models in the virtual reality field in all space scales. In small spaces, the user's movement is limited, resulting in high repeatability of the trajectory, and the attention mechanism can accurately capture periodic patterns, significantly reducing the prediction error and making the error smaller and more concentrated.
[0181] Figure 4The local amplification comparison between the proposed method and the GRU method is shown. It is worth noting that in large space, the prediction error of the proposed method does not rise with the expansion of space, but because of the increase of user's freedom degree and the enhancement of path continuity, the model's ability to capture long-term trends is more prominent, so the prediction error is smaller and more stable, which is significantly better than the other two methods. This verifies the effectiveness of the attention mechanism in dynamically adjusting the weight of historical information in the decoder, especially in sparse scenarios, the model can suppress local noise interference by enhancing the attention weight of long-distance time steps.
[0182] The contents not described in detail in the specification of the present application belong to the prior art known to those skilled in the art. Although the above describes the specific embodiments of the present application for the purpose of facilitating the understanding of the present application by those skilled in the art, it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, it is obvious that various changes are within the spirit and scope of the present application defined and determined by the appended claims, and all the inventions utilizing the concept of the present application are within the scope of protection.
Claims
1. A multi-person redirection walking and position prediction method based on artificial potential field, characterized in that, The method comprises the following steps: Step 1, calculate the repulsion vector of the user acted by the environment; Step 2, calculate the repulsion vector of the user acted by other users; Step 3, calculate the resultant repulsion vector, take the boundary of the physical space and other users as obstacles to calculate the repulsion vector, finally the resultant repulsion vector is obtained by weighted sum of the environmental repulsion and user repulsion, extract the direction of the resultant repulsion vector as the steering direction of the user, guide the user to walk to obtain the user motion trajectory; Step 4, when the user approaches the obstacle or other users in the virtual environment and has the risk of collision, reset as an emergency strategy is introduced, the total guiding force vector at the beginning of the reset is used as the target direction of the user after reset by the redirection system, to ensure that the user is consistent with the virtual path in the physical space, while avoiding physical collision; Step 5, standardize the user motion trajectory used by the redirection system, normalize the data using MinMaxScaler, scale all data to 0 to 1, divide the data set into training set and test set according to 80% proportion, the data is used to predict the short-term motion trajectory of the user by the prediction model; Step 6, in the process of predicting the short-term motion trajectory of the user by the prediction model, the prediction model adopts multi-layer long short-term memory network LSTM as the encoder and decoder, the encoder maps the original space-time trajectory data to a high-dimensional context space, and the decoder generates accurate future position prediction based on the context space; Step 7, introduce attention mechanism between the encoder and the decoder, so that the prediction model dynamically focuses on the historical data of future trajectory prediction, and accurately predicts the short-term motion trajectory of the user.
2. The multi-person redirected walking and position prediction method based on artificial potential field according to claim 1, characterized in that, The specific operation of calculating the repulsion vector of the user acted by the environment in step 1 is: First, the shortest distance between the user and each environmental obstacle is calculated to obtain a vector d pointing to the closest point of the obstacle k : d k = p - l k Wherein, the user center position is p, and the point on the boundary line segment corresponding to the obstacle closest to the user center position p is denoted as l k , the vector d k Indicates the direction between the user and the closest point of the obstacle, and the modulus ||d k || reflects the distance between the user and the obstacle; Subsequently, the vector d k is normalized and a Gaussian attenuation function is introduced depending on the distance of the user to each environmental obstacle: Wherein, σ is the environmental scale parameter, which ensures that the weight increases when the user approaches the obstacle, and the final environmental repulsion vector acting on the user is defined as: Wherein, D is the sum of the distances from the user to all obstacles and other users: wherein n represents the total amount of obstacles; k represents the obstacle variable; m represents the total amount of users; i represents the user variable; ||h i represents the distance of a user from other users.
3. The method of claim 2, wherein, The specific operation of calculating the repulsion vector of the user acted by other users in step 2 is: For each pair of users, first compute the difference vector h between the two i : h i = p-c k where c k is the position of another user, the module length ||h i reflects the distance between the user and the obstacle, and the relative angle is determined by the respective moving directions, and the normalized relative heading factor k i is calculated accordingly. Where θ1 and θ2 are the angles between the moving direction of the current user and the connecting line of the current user and other users, respectively. The minimum distance mechanism is introduced, and a safety threshold s is set. When d < s, the additional safety repulsion force F is calculated safety : Finally, the repulsion vector of the user acted by other users is defined as: where k i represents a relative head factor.
4. The multi-person redirected walking and position prediction method based on artificial potential field according to claim 3, characterized in that, The specific operation of calculating the resultant repulsion vector in step 3 is: Introduce the concept of user density to dynamically reflect the distribution of users in the environment, the formula is: Wherein, N represents the number of users, and radius represents the radius; According to the size of the user density, the weights of the environmental and user repulsion are defined respectively: Wherein, α represents the weight of the environmental repulsion; β represents the weight of the user repulsion; The total repulsion vector is obtained by the following formula: Wherein, t represents the total repulsion vector.
5. The multi-person redirected walking and position prediction method based on artificial potential field according to claim 4, characterized in that, The step 4, when the user approaches the obstacle or other users in the virtual environment and has the risk of collision, will reset as an emergency strategy. The system uses the total guiding force vector at the beginning of the reset as the target direction of the user after the reset, ensuring that the user is consistent with the virtual path in the physical space while avoiding physical collision. The specific process is as follows: Calculate the Euclidean distance between the user and the environment vector and the other user vector: where v i = (v ix ,v iy ) is the vector of environmental obstacles or other users, when the norm of any vector is greater than a set safety threshold, there is a risk of collision; and further calculating the angle difference between the current travel direction and the environmental and other user guidance force vectors: Δθ = |θ u -θ v | = |(θ u -θ v + π) mod 2π - π | where θ u is the angle between the current user movement direction and the x-axis, and θ v is the angle between the obstacle direction and the x-axis. When the angle difference Δθ is less than 90°, the vector is considered to be a possible cause of collision. Different weights are set to the environment and user, respectively, as w env and w user When the weighted distance satisfies the following relationship, the system will determine that there is a collision risk and trigger a reset: d i xw ≥ threshold Where threshold is the collision safety threshold; w represents the weight set for the environment and the user; During the reset process, the selection of the rotation direction follows the "maximum angle principle". The rotation angle is calculated as follows: Δθ rotate = min(|θ t - θ u |, 2π - |θ t - θ u |) where θ t is the direction of the total guidance force; the rotation gain is determined by the rotation angle, and the rotation gain calculation formula is as follows:
6. The multi-person redirected walking and position prediction method based on artificial potential field according to claim 5, wherein, The step 6, in the process of predicting the short-term motion trajectory of the user using the prediction model, the prediction model uses a multi-layer long short-term memory network LSTM as the encoder and the decoder. The encoder maps the original spatio-temporal trajectory data to a high-dimensional context space, and the decoder generates accurate future position prediction based on the context space. In the prediction model, the encoder uses a three-layer stacked LSTM structure. Stacking multiple LSTM layers captures different features in the time series from multiple levels, enhancing the encoder's ability to express complex data. The specific steps are as follows: The input sequence is X = {x1, x2,..., x T} each is the d-dimensional feature at the t time, for the LSTM of the l layer, its state update formula at the time step t is: where σ(·) is a sigmoid activation function, tanh(·) is a hyperbolic tangent activation function, and ⊙ denotes element-wise multiplication. respectively denote the input weight matrix for input gate, forget gate, output gate and candidate cell state update in the l-th layer LSTM, which acts on the input vector x t at the current time step, for learning the influence of input features on each gate and cell state update; respectively denote the recurrent weight matrix for input gate, forget gate, output gate and candidate cell state update in the l-th layer LSTM, which acts on the hidden state vector at the previous time step, for learning the influence of historical hidden state on the current gate and cell state update; respectively denote the bias vector for input gate, forget gate, output gate and candidate cell state update in the l-th layer LSTM, for adjusting the activation threshold of each gate and cell state update; in order, they are input gate forget gate f t l , output gate cell state update and hidden state update The task of the decoder is to predict the position of the future time step based on the context vector generated by the encoder. The decoder uses the RepeatVector operation and multi-layer LSTM structure to dynamically generate future trajectory sequences. The specific steps are as follows: The goal of the decoder is to generate the trajectory of the future n future time steps The output of each time step depends on the previous time's hidden and cell states, and the decoder updates the hidden and cell states in the same way as the encoder: wherein, denotes the decoder's hidden state vector at time step t; denotes the decoder's cell state vector at time step t;y t-1 denotes the decoder's previous time step output input at time step t; Subsequent prediction values for each time step Mapping through a fully connected layer: where W y denotes the weight matrix of the output layer; b y denotes the bias vector of the output layer; respectively control the linear transformation and bias of the hidden state to the final prediction value; The RepeatVector operation repeats the output of the encoder n times future and generates the future trajectory step by step through the LSTM layer of the decoder, finally outputs 7. The multi-person redirected walking and position prediction method based on artificial potential field according to claim 6, wherein, The step 7, an attention mechanism is introduced between the encoder and the decoder, which makes the prediction model dynamically focus on the historical data for future trajectory prediction, accurately predicting the short-term motion trajectory of the user. The specific steps are as follows: At each time step, the correlation e between the current state s of the decoder t and the encoder output h j is computed tj : wherein, denotes the hidden state vector s of the decoder at time step t t denotes the transpose of W a denotes the attention weight matrix in the attention mechanism; Then calculate the attention weight: calculating a weighted context vector c using attention weights t : The final output is the attention-enhanced decoder output:
Citation Information
Patent Citations
Mechanical arm trajectory planning and collision detection method based on augmented reality
CN118155107A
Seq2Seq-AM model construction method and pedestrian trajectory prediction and safety risk early warning method
CN119599208A