Real-Time Short-Term Pedestrian Trajectory Prediction Based on Gait Biomechanics

The short-term prediction of a person’s trajectory during normal walking becomes necessary in many environments shared by humans and robots. Physics-based approaches based on Newton’s laws of motion seem best suited for short-term predictions, but the intrinsic properties of human walking conflict with the foundations of the basic kinematical models compromising their performance. In this paper, we propose a short-time prediction method based on gait biomechanics for real-time applications. This method relays on a single biomechanical variable, and it has a low computational burden, turning it into a feasible solution to implement in low-cost portable devices. We evaluate its performance from an experimental benchmark where several subjects walked steadily over straight and curved paths. With this approach, the results indicate a performance good enough to be applicable to a wide range of human–robot interaction applications.


Introduction
Human motion trajectory prediction (HMTP) is a critical technology in applications where people share their workspace with autonomous moving machines. That is needed, for example, in collaborative robotics for obstacle avoidance [1,2], in automatic driving assistance systems for safety assurance [3,4], in prostheses or exoskeletons for better performance [5], or in virtual reality to improve the sensation of immersion perceived by the user [6]. The strong interest in all these application fields explains the exponential growth of scientific communications devoted to this problem in the last few years [7].
A basic instance of the problem of HMTP can be described as how to estimate the future location of a specific mark in the body of a walking human within a given short temporal window (see Figure 1). With that prediction, the possibilities of enhancing intelligent human-robot collaborative environments increase. Robots can plan their motion to adjust their actions better for more efficient and safe collaboration with humans [8]. The prediction is based on information coming from the monitorisation of the human with environmental sensors, or sensors mounted on the robot, or wearables [9][10][11]. A viable real-time prediction of human trajectory must consider the sensors and signals that will be available and whether it will be possible to achieve the reactivity or fast response that the application demands.
As will be discussed below, there are different proposals in the literature for shortrange anticipation of a walker's position in real-time. All of them differ in both the amount of sensory information that needs to be provided and the type of information processing needed to solve the problem. In this paper, we propose a method with the following characteristics: (1) it is designed for close-proximity applications, with prediction windows around 1 s, (2) it relays on a single biomechanical variable that can be measured with inexpensive wearable sensors, and (3) it has a low computational load and is therefore feasible to implement in low-cost portable devices. tion 4. We show that the main error source of the estimations has a specific biomechanical source: the left-to-right fluctuations of the position of the subject in the direction of the displacement induced by the alternation of the step. This effect is adequately compensated in our algorithm by introducing a sensor-based biomechanical compensation. The results in Section 5 indicate a performance good enough to be applicable to a wide range of human-robot interaction applications.

Related Work
Following the general taxonomy of HMTP tools proposed in [7], physics-based approaches based on Newton's laws of motion seem best suited for real-time sensor-based short-term predictions because they operate within a reactive sense-predict scheme, avoiding intermediate processing time. For that reason, together with simplicity, we have ruled out methods that involved a higher level of cognition, such as learning based on data [12] or planning based on reasoning about motion intent [13].
Physics-based estimators, however, being useful to predict the motion of vehicles, fall short of capturing the quite complex dynamics of human walking. This has been addressed by resorting to a blending of a mixture of multiple dynamic models, but no performance improvement was found [14].
A similar strategy is to combine dynamic models with other learning or planning algorithms, even if, in principle, it goes against the speed of response of dynamic methods. A learning approach in [15] conveys promising results, but its performance on ambulatory motions such as walking has not been evaluated.
A third approach is to combine dynamic models with other information coming from the target agent himself. In [16], the short-term trajectory prediction is improved by tracking the user's head in the context of virtual reality applications. Head orientation anticipates the trajectory, but it is also heavily influenced by other ambient-related impulses or distractions [17]. The authors suggest the use of eye trackers to overcome this problem, but this technology is too expensive to be used in more general intelligent environments. Our work is framed in this line but seeks to improve the prediction with the measurement of biomechanical signals that are easily implementable in practice.

Formulation of the Prediction Method
For the short-term prediction of the pedestrian, we will adopt a kinematic model and a sensor-based biomechanical compensation method as described below. In the following section, we will present the relevant state-of-the-art. After describing the method details in Section 3, we evaluate its performance from an experimental benchmark where several subjects walked steadily over straight and curved paths, Section 4. We show that the main error source of the estimations has a specific biomechanical source: the left-to-right fluctuations of the position of the subject in the direction of the displacement induced by the alternation of the step. This effect is adequately compensated in our algorithm by introducing a sensor-based biomechanical compensation. The results in Section 5 indicate a performance good enough to be applicable to a wide range of human-robot interaction applications.

Related Work
Following the general taxonomy of HMTP tools proposed in [7], physics-based approaches based on Newton's laws of motion seem best suited for real-time sensor-based short-term predictions because they operate within a reactive sense-predict scheme, avoiding intermediate processing time. For that reason, together with simplicity, we have ruled out methods that involved a higher level of cognition, such as learning based on data [12] or planning based on reasoning about motion intent [13].
Physics-based estimators, however, being useful to predict the motion of vehicles, fall short of capturing the quite complex dynamics of human walking. This has been addressed by resorting to a blending of a mixture of multiple dynamic models, but no performance improvement was found [14].
A similar strategy is to combine dynamic models with other learning or planning algorithms, even if, in principle, it goes against the speed of response of dynamic methods. A learning approach in [15] conveys promising results, but its performance on ambulatory motions such as walking has not been evaluated.
A third approach is to combine dynamic models with other information coming from the target agent himself. In [16], the short-term trajectory prediction is improved by tracking the user's head in the context of virtual reality applications. Head orientation anticipates the trajectory, but it is also heavily influenced by other ambient-related impulses or distractions [17]. The authors suggest the use of eye trackers to overcome this problem, but this technology is too expensive to be used in more general intelligent environments. Our work is framed in this line but seeks to improve the prediction with the measurement of biomechanical signals that are easily implementable in practice.

Formulation of the Prediction Method
For the short-term prediction of the pedestrian, we will adopt a kinematic model and a sensor-based biomechanical compensation method as described below.

Kinematical Trajectory Prediction Models
Kinematical models are a good approach for the short-term prediction of the position of moving objects [18,19]. They are derived by applying the Newton laws from an initial position (x, y) (see Figure 2), considering a set of initial conditions defined by the orientation of the displacement φ, the linear velocity v, the angular velocity w and the tangential acceleration a t as follows: . . . .

Kinematical Trajectory Prediction Models
Kinematical models are a good approach for the short-term prediction of the position of moving objects [18,19]. They are derived by applying the Newton laws from an initial position ( , ) (see Figure 2), considering a set of initial conditions defined by the orientation of the displacement , the linear velocity , the angular velocity and the tangential acceleration as follows:  Defining the model state space vector as , , , v, , ', which includes the velocity vector , ′, we can obtain the discrete version of the kinematical Equations (1)-(4). Assuming that in the time interval ∆ , the rotational velocity and the translational acceleration are constant (CTRA model) and results in: Depending on the assumptions taken about the translational and rotational velocities and the accelerations of the moving object, several particularisations can be formulated [18] (see Figure 3):

Kinematical Trajectory Prediction Models
Kinematical models are a good approach for the short-term prediction of the position of moving objects [18,19]. They are derived by applying the Newton laws from an initial position ( , ) (see Figure 2), considering a set of initial conditions defined by the orientation of the displacement , the linear velocity , the angular velocity and the tangential acceleration as follows:  Defining the model state space vector as , , , v, , ', which includes the velocity vector , ′, we can obtain the discrete version of the kinematical Equations (1)-(4). Assuming that in the time interval ∆ , the rotational velocity and the translational acceleration are constant (CTRA model) and results in: Defining the model state space vector as [x, y, φ, v, a, w] , which includes the velocity vector [v, φ] , we can obtain the discrete version of the kinematical Equations (1)-(4). Assuming that in the time interval ∆t, the rotational velocity and the translational acceleration are constant (CTRA model) and results in: From this discrete CTRA model, the equations of the other three can be calculated by substituting their respective values of translational and rotational velocities and the accelerations: At every sampling time, k, the model state vector [x k , y k , φ k , v k , a k , w k ], must be computed to apply it to the model. The actual orientation of the displacement (φ r k ) and the translational (v r k ) are estimated from the position (x r k , y r k ): The rotational velocities (w r k ) and translational acceleration (a r k ) of the displacement are estimated from φ r k , v r k : In the following, we will refer to the sequence x r k , y r k , φ r k , v r k , a r k , w r k as the raw trajectory since its variables are obtained recursively directly from the kinematic models, without any other consideration of the biomechanics of human walking. As discussed above, the predictive power of these equations alone can be expected to be unsatisfactory.

Offline Compensations
To correct the predictable limitations of the model discussed above, we will resort to studying the effects induced in it by gait biomechanics. It is known that in normal walking, the pelvis moves from side to side once per cycle, the trunk being over each leg to maintain balance. Similarly, the forward movement is not constant, and it produces variations in velocity according to the phase of the step. The resulting velocity and orientation signals corresponding to the pelvis have a sinusoidal shape [20,21].
To include that fact in the model, we propose offline filtering of the whole raw trajectory signals x r k , y r k to remove their waviness. We applied a polynomial regression, defining the offline estimated trajectories x b k , y b k for each of the experiments. From the corrected position x b k , y b k , we calculated the orientation of the displacement (φ b k ), the translational and rotational velocities (v b k and w b k , respectively), and translational acceleration (a b k ) of the displacement with previous Equations (9)- (12). By removing the undulations from the positions x b k , y b k , the undulations will, in turn, be removed from the In the following, we will refer to the sequence k as the offline trajectory since its variables cannot be computed in real-time conditions. However, they could be taken as an instrumental way to test the utility of the proposed compensation.

Real-Time Sensor-Based Biomechanical Compensations
Assuming that the previous compensation will produce better estimations, it has the disadvantage of requiring filtering that induces time lags. We propose a real-time alternative to the offline compensation, which modifies the translational velocity and orientation signals v r k , φ r k considering previous knowledge about gait biomechanics. The global velocity of the centre-of-mass velocity of the body, v r k , is an oscillatory signal whose average value coincides approximately with the value it takes in the initial and final contacts of the feet, as described in gait studies [22]. Therefore, the displacement velocity can be better computed from signals taken from the initial contact of the ipsilateral foot ( Figure 4(A)) to the subsequent final contact of the contralateral foot (Figure 4(B)), and then to the subsequent initial contact of the contralateral foot (Figure 4(C)).
jectory signals ( , ) to remove their waviness. We applied a polynomial regression, defining the offline estimated trajectories , for each of the experiments. From the corrected position , , we calculated the orientation of the displacement ( ), the translational and rotational velocities ( and , respectively), and translational acceleration ( ) of the displacement with previous Equations (9)- (12). By removing the undulations from the positions , , the undulations will, in turn, be removed from the signals ( , , , ).
In the following, we will refer to the sequence ( , , , , , ) as the offline trajectory since its variables cannot be computed in real-time conditions. However, they could be taken as an instrumental way to test the utility of the proposed compensation.

Real-Time Sensor-Based Biomechanical Compensations
Assuming that the previous compensation will produce better estimations, it has the disadvantage of requiring filtering that induces time lags. We propose a real-time alternative to the offline compensation, which modifies the translational velocity and orientation signals , considering previous knowledge about gait biomechanics. The global velocity of the centre-of-mass velocity of the body, , is an oscillatory signal whose average value coincides approximately with the value it takes in the initial and final contacts of the feet, as described in gait studies [22]. Therefore, the displacement velocity can be better computed from signals taken from the initial contact of the ipsilateral foot (Figure 4(A)) to the subsequent final contact of the contralateral foot (Figure 4(B)), and then to the subsequent initial contact of the contralateral foot ( Figure  4(C)). This way, we can fix the raw displacement velocity, (Equation (10)), measured between initial and final contact foot events. We will refer to this sequence, , as the real-time estimated velocity. Notice that the initial and final foot contacts can be detected from local maximums and minimums of the derivative of the raw velocity [23,24], so this correction does not require specific new sensors. The acceleration in these segments, , can also be corrected and computed as the increment of velocity between consecutive events.
A B C This way, we can fix the raw displacement velocity, v r k (Equation (10)), measured between initial and final contact foot events. We will refer to this sequence, v k , as the real-time estimated velocity. Notice that the initial and final foot contacts can be detected from local maximums and minimums of the derivative of the raw velocity [23,24], so this correction does not require specific new sensors. The acceleration in these segments, a k , can also be corrected and computed as the increment of velocity between consecutive events.
Regarding the orientation of the displacement φ k , it is known in gait biomechanics that the body trunk and the pelvis orientation evolve in counter-phase [21] (see Figure 5). Therefore, the raw position signal, φ r k , can be corrected by measuring the pelvis orientation φ h k . A proportional average can cancel the oscillations [25] and return the basic signal trend, φ k , closer to the actual forward orientation: The calibration gain K has to be experimentally calculated for each subjec mise the least square error between the raw and the baseline trajectories. From mated orientation, , we can compute the corresponding rotational velocity: /Δ From the point of view of the real-time implementation, we have introd need for a sensor that measures hip orientation. As in the previous case of trun ty, it is possible to make this estimate with an IMU sensor placed on the hip [26] In the following, we will refer to the sequence ( , , , , , ) as the e trajectory. This sequence defines the initial conditions for the application of the ical models in real time to forecast the position of the walking subject. From th sion above, it is expected that this model will produce a better trajectory estima the raw trajectory and close to the offline trajectory.
In the following, we will test this proposed method to evaluate and com performance of the raw, offline estimated and real-time estimated trajectories.

Experimental Setup
For the evaluation of the models, an experimental benchmark was designe ing five adult subjects aged between 21 and 52. Two types of trajectories, str curved, were defined (see Figure 6). For the straight trajectories, participants wa straight line 5.4 m in length. Participants were instructed to perform a normal g maintaining a constant walking velocity. This trajectory was repeated five tim dividual. For the curved trajectories, participants walk in circles around a cent 1.5 m radius, again five repetitions. They were instructed to keep the turning constant as possible with the help of a guide painted on the floor, increasing the the experiment progressed. The calibration gain K has to be experimentally calculated for each subject to minimise the least square error between the raw and the baseline trajectories. From the estimated orientation, φ k , we can compute the corresponding rotational velocity: From the point of view of the real-time implementation, we have introduced the need for a sensor that measures hip orientation. As in the previous case of trunk velocity, it is possible to make this estimate with an IMU sensor placed on the hip [26].
In the following, we will refer to the sequence x r k , y r k , φ k , v k , a k , w k as the estimated trajectory. This sequence defines the initial conditions for the application of the kinematical models in real time to forecast the position of the walking subject. From the discussion above, it is expected that this model will produce a better trajectory estimation than the raw trajectory and close to the offline trajectory.
In the following, we will test this proposed method to evaluate and compare the performance of the raw, offline estimated and real-time estimated trajectories.

Experimental Setup
For the evaluation of the models, an experimental benchmark was designed involving five adult subjects aged between 21 and 52. Two types of trajectories, straight and curved, were defined (see Figure 6). For the straight trajectories, participants walked in a straight line 5.4 m in length. Participants were instructed to perform a normal gait while maintaining a constant walking velocity. This trajectory was repeated five times per individual. For the curved trajectories, participants walk in circles around a central point, 1.5 m radius, again five repetitions. They were instructed to keep the turning radius as constant as possible with the help of a guide painted on the floor, increasing the speed as the experiment progressed.
An Optitrack system composed of 10 Flex3 cameras was used to monitor the experiments with a sampling frequency of 100 Hz. Calibration of the system was performed following the recommendations of the manufacturer, and the nominal residual errors achieved were 1.4 mm (mean). Following [27] (see Figure 7), we used the bidimensional raw position (x k , y k ) of the centroid of the rigid body formed from five markers placed around the waist as the subject position. Pelvis orientation, φ h k , was estimated from the actual orientation of the rigid body from the defined reference system. A 3rd-order low-pass Butterworth filter with a cut-off frequency of 6 Hz was applied during the acquisition to remove frequential components above those pertinent for the human gait. An Optitrack system composed of 10 Flex3 cameras was used to monitor the experiments with a sampling frequency of 100 Hz. Calibration of the system was performed following the recommendations of the manufacturer, and the nominal residual errors achieved were 1.4 mm (mean). Following [27] (see Figure 7), we used the bidimensional raw position ( , ) of the centroid of the rigid body formed from five markers placed around the waist as the subject position. Pelvis orientation, , was estimated from the actual orientation of the rigid body from the defined reference system. A 3rd-order lowpass Butterworth filter with a cut-off frequency of 6 Hz was applied during the acquisition to remove frequential components above those pertinent for the human gait.

Model Application and Error Analysis
Data from the curved experiment was divided into five trajectory segments corresponding to each of the individual turns. This way, we defined for each subject five straight trajectory segments and five curved trajectory segments (each corresponding to a whole turn). To form the offline estimated trajectories, we use linear regression for straight segments and for the curved segments, a grade 8 polynomial regression.
The four prediction models (CV, CA, CTRV, CTRA) were then sequentially applied to the sequence ( , , , , , ) starting at every sample from 1 to 100, being N the length of the current trajectory data. Each sample is predicted to have a horizon of 1 s (100 samples) (see Figure 8). For this purpose, the models are applied recursively by introducing as input the output of the previous iteration until the 1-s horizon is raised.
Similarly, these models are applied directly to the signals without removing the wavelets ( , , , , , ) and on the post-processed signal with offline compensation ( , , , , , ).  An Optitrack system composed of 10 Flex3 cameras was used to monitor the experiments with a sampling frequency of 100 Hz. Calibration of the system was performed following the recommendations of the manufacturer, and the nominal residual errors achieved were 1.4 mm (mean). Following [27] (see Figure 7), we used the bidimensional raw position ( , ) of the centroid of the rigid body formed from five markers placed around the waist as the subject position. Pelvis orientation, , was estimated from the actual orientation of the rigid body from the defined reference system. A 3rd-order lowpass Butterworth filter with a cut-off frequency of 6 Hz was applied during the acquisition to remove frequential components above those pertinent for the human gait.

Model Application and Error Analysis
Data from the curved experiment was divided into five trajectory segments corresponding to each of the individual turns. This way, we defined for each subject five straight trajectory segments and five curved trajectory segments (each corresponding to a whole turn). To form the offline estimated trajectories, we use linear regression for straight segments and for the curved segments, a grade 8 polynomial regression.
The four prediction models (CV, CA, CTRV, CTRA) were then sequentially applied to the sequence ( , , , , , ) starting at every sample from 1 to 100, being N the length of the current trajectory data. Each sample is predicted to have a horizon of 1 s (100 samples) (see Figure 8). For this purpose, the models are applied recursively by introducing as input the output of the previous iteration until the 1-s horizon is raised.
Similarly, these models are applied directly to the signals without removing the wavelets ( , , , , , ) and on the post-processed signal with offline compensation ( , , , , , ).

Model Application and Error Analysis
Data from the curved experiment was divided into five trajectory segments corresponding to each of the individual turns. This way, we defined for each subject five straight trajectory segments and five curved trajectory segments (each corresponding to a whole turn). To form the offline estimated trajectories, we use linear regression for straight segments and for the curved segments, a grade 8 polynomial regression.
The four prediction models (CV, CA, CTRV, CTRA) were then sequentially applied to the sequence x r k , y r k , φ k , v k , a k , w k starting at every sample from k = 1 to k = N − 100, being N the length of the current trajectory data. Each sample is predicted to have a horizon of 1 s (100 samples) (see Figure 8). For this purpose, the models are applied recursively by introducing as input the output of the previous iteration until the 1-s horizon is raised.
Similarly, these models are applied directly to the signals without removing the wavelets x r k , y r k , φ r k , v r k , a r k , w r k and on the post-processed signal with offline compensa- For every application of a model starting at sample k, the prediction error sequence e k was defined as the sequence of Euclidean distances between the predicted (x k...k+99 ,ŷ k...k+99 ) and actual position values x r k...k+99 , y r k...k+99 of the raw trajectory. For every application of a model starting at sample , the prediction error seq was defined as the sequence of Euclidean distances between the pred ( … , … ) and actual position values ( ... , ... ) of the raw trajectory.  Figure 9 shows the Root Mean Square of the error sequences (predictions from sample to one hundred samples, i.e., 0.01 s to 1 s) for each model (CV, CA, C CTRA) for the raw trajectories (top), offline estimated trajectories (centre), and rea estimated trajectories (bottom).

Results
We have found that prediction errors present an exponential growth with characteristic of the usual drift present in estimations based on integral procedures different growth rates for the different models. RMS prediction error at 1-s length biggest for predictions from the raw trajectories, with RMS error of predictions fro fline estimated trajectories the lowest in general.
. Figure 8. The figure describes the application of a prediction model starting at the third sample (k = 3) of a raw trajectory x r k , y r k , φ r k , v r k , a r k , w r k . Predictions are sequentially extended for one second (100 samples, k = 3 . . . 102) using the initial state vector highlighted in the blue column (left). The prediction error sequence is then defined from the Euclidean distance of predicted and actual positions of the subject (k = 3 . . . 102). Figure 9 shows the Root Mean Square of the error sequences (predictions from one sample to one hundred samples, i.e., 0.01 s to 1 s) for each model (CV, CA, CTRV, CTRA) for the raw trajectories (top), offline estimated trajectories (centre), and real-time estimated trajectories (bottom).

Results
We have found that prediction errors present an exponential growth with time, characteristic of the usual drift present in estimations based on integral procedures, with different growth rates for the different models. RMS prediction error at 1-s length is the biggest for predictions from the raw trajectories, with RMS error of predictions from offline estimated trajectories the lowest in general.
was defined as the sequence of Euclidean distances between the predicted ( … , … ) and actual position values ( ... , ... ) of the raw trajectory.  Figure 9 shows the Root Mean Square of the error sequences (predictions from one sample to one hundred samples, i.e., 0.01 s to 1 s) for each model (CV, CA, CTRV, CTRA) for the raw trajectories (top), offline estimated trajectories (centre), and real-time estimated trajectories (bottom).

Results
We have found that prediction errors present an exponential growth with time, characteristic of the usual drift present in estimations based on integral procedures, with different growth rates for the different models. RMS prediction error at 1-s length is the biggest for predictions from the raw trajectories, with RMS error of predictions from offline estimated trajectories the lowest in general.
.  Table 1 contains the RMS error at a one-second prediction length from each trajectory (raw, offline estimated, and real-time estimated) and each prediction model. In general, as could be expected, curved models (CTRV, CTRA) perform better for curved trajectories, and straight models (CV, CA) perform better for straight trajectories. We found an exception in predictions from offline estimated trajectories, where there was no difference between the four prediction models for the straight trajectories. The translational acceleration and rotational velocity estimated for these trajectories were almost zero, as planned with the design of the experiment, which implies that all models adopted the behaviour of the CV model. Results also show that accelerated models perform in general worse than non-accelerated models, especially in the raw trajectories. In aggregated terms, the CTRV performs the best in all situations. Considering the type of path (straight, curved), the CTRV still performs the best except for prediction for straight realtime estimated trajectories, where straight models (CV, CA) perform better than the CTRV model.   Table 1 contains the RMS error at a one-second prediction length from each trajectory (raw, offline estimated, and real-time estimated) and each prediction model. In general, as could be expected, curved models (CTRV, CTRA) perform better for curved trajectories, and straight models (CV, CA) perform better for straight trajectories. We found an exception in predictions from offline estimated trajectories, where there was no difference between the four prediction models for the straight trajectories. The translational acceleration and rotational velocity estimated for these trajectories were almost zero, as planned with the design of the experiment, which implies that all models adopted the behaviour of the CV model. Results also show that accelerated models perform in general worse than non-accelerated models, especially in the raw trajectories. In aggregated terms, the CTRV performs the best in all situations. Considering the type of path (straight, curved), the CTRV still performs the best except for prediction for straight real-time estimated trajectories, where straight models (CV, CA) perform better than the CTRV model.
To further analyse the performance of the prediction models, a multiway analysis of the variance (ANOVA) was carried out using MATLAB ® R2020b from MathWorks to check if the mean prediction at a horizon of prediction of 1 s was affected by the intervening factors: the subject performing the test, the type of path (straight or curved), and the model applied for the prediction (CV, CA, CTRV, CTRA). The subject factor was treated as a random effect, while the type of path and model factors were treated as a fixed effect.
The results showed that mean prediction errors were not affected by the subject performing the test (p-value > 0.01) for the raw, offline estimated, and real-time estimated trajectories. On the contrary, the type of path and the prediction model significantly affected the mean prediction error for the raw, offline estimated, and real-time estimated trajectories (p-value < 0.01). A multiple comparison test was then carried out to analyse significant differences in the mean prediction error for pairs of type of trajectory/model. For the offline estimated trajectories, we found four groups with mean prediction errors that were not significantly different among them and were significantly different from errors from the other three groups. These groups, expressed in ascending order or the averaged prediction error, were: Regarding the raw trajectories, the test showed that the mean prediction error was significantly different for all type of trajectory/model pairs.

Experiments Design
Experiments were designed to evaluate the performance of the proposed model during normal walking and, therefore, they comprised walks in straight and curved trajectories. We designed experiments for the extreme cases, straight trajectories at a constant velocity and circular trajectories with increasing velocity of displacement. The prediction results of the proposed model are compared with those obtained by applying the kinematic models directly to the raw data and to the post-processed data to be able to quantify the improvement achieved.

Impact of Velocity and Orientation on Predictions
Kinematical models based on the well-known Newton Laws have been used in the state-of-the-art as a general approach to forecasting the position of general moving objects. For instance, in [28], the authors perform a comparative study of several dynamical models (CV, CA, CTRV) and a multi-model algorithm combining such basic models. Particularly in terms of single motion models, they observe benefits for the CV model in some scenes and CTRV in others, making complex models inefficient. Similarly, we have observed that these models have usually been applied as a complement to other advanced techniques [15]. For our proposal prediction method, we chose to use the four models describing four types of trajectories where the occurrence of translational accelerations and angular velocities are combined.
The results of applying these models to our raw data confirm how the left-to-right fluctuations of the position of the subject in the direction of the displacement induced by the alternation of the step affect the performance of the basic kinematical models. Prediction on the raw data has the worst performance. On these, we can distinguish two effects. Firstly, the RMS of the accelerated models is significantly higher than that of the non-accelerated models for both curves and straight lines, in contrast to the offline prediction. This is the result of the influence of using the sinusoidal velocity in the kinematic models. A similar effect can also be found for straight versus curved models on straight trajectories. While in the offline prediction, all models have the same mean error, with the raw data, the CTRV model outperforms the RMS of the CV and the CTRA of the CA. This is due to the oscillation of the orientation, which is picked up by the curvilinear models.

Impact of Basic Kinematic Models on Predictions
The best model to apply in a general situation is the CTRV model. It shows the best prediction errors in aggregated terms. We have also found that the use of accelerated models supposes a concern. On the one side, we have found that for offline curved trajectories, curved models, accelerated and non-accelerated (CTRV, CTRA) performed equally. This finding was unexpected, as subjects were told to accelerate during the development of the curved experiments to analyse the performance of accelerated models (CA, CTRA) compared to non-accelerated models (CV, CTRV). However, we found that the acceleration estimated from the curved baseline trajectories (a b k ) was on average 0.04 ± 0.09 m/s 2 , coherent with reference data for normal walking reported in the literature [9]. This value was possibly too small to make a difference in performance between the two groups of models, as confirmed by the multiple comparison test. Therefore, this finding supports the idea that accelerated models do not provide a real improved performance over nonaccelerated models in the context of predicting position during human walking. Moreover, the use of the acceleration in the models may suppose an issue, as the estimated prediction seems to present a higher error to this parameter, even with the velocity compensation.
In general terms, for the reasons stated above, the CTRV performs the best for unconstrained trajectories. We provide a statistical analysis that reveals the model most efficient for each type of path. In case the type of path is known in advance, the taxonomy of models may help to choose the most appropriate for a given application framework.

Performance of Real-Time Sensor-Based Compensation Method
The increased performance of predictions from offline filtered trajectories compared to predictions from raw trajectories confirms the necessity of a technique to remove the fluctuations from the raw signals before applying the prediction kinematical models. For this work, we have made batch filtering considering the whole raw signals to define the offline filtered trajectories. However, in a real application scenario of prediction of the subject position, such undulations should be removed in real-time, considering only the signal sampled to the actual moment. Future positions of the subject would not be available, and processing like the one performed to define the baseline trajectories would not be possible.
Classical frequential filters would be an option to remove the gait-induced undulations found in the sampled signals. In certain situations, these filters could perform properly. For instance, if the trajectory is essentially straight or the velocity is essentially constant, a low pass filter of a few seconds in length could be adequate. However, they may present some drawbacks, as the low step frequencies of human gait (between 0.74 and 1.3 two-step/s [29]) would require slow filters that would introduce a delay too high for a short-time prediction (a four-pole Butterworth filter with a cutting frequency of 1 Hz is expected to add a delay about 0.5 s [30]). So, for changing orientations and eventually changing velocities, these filters could not be very efficient. Recent results [25] confirm that this approach may lead to erroneous results and that a different approach is needed for a general solution to the problem.
In this paper, we propose to address the elimination of the undulations in the orientation and the velocity from the consideration of the biomechanical characteristics of human gait. We aimed to provide a general approach applicable to unconstrained trajectories mixing straight and curved paths and eventually different linear and rotational velocities and accelerations. With this approach, we show how prediction errors are considerably reduced from predictions from raw trajectories, making them comparable to the prediction from baseline estimations. Anyway, there is still room for improvement. Regarding the use of the acceleration in the models, it is true that the biomechanical inspired corrections made over the acceleration reduce the neglecting effect they present of the prediction from the raw trajectories. However, as acceleration makes a big impact on error and acceleration in human walking is low, the use of accelerated models may not be very profitable.
Comparing the results with those of other works, we find results in the same range of values. An example is the case of [15], where the proposed prediction method achieves an average error between 100 and 200 mm for predictions at a horizon of 0.5 s. The result obtained by individually applying a CV model (called as Velocity-Based Position Projection Method) gives a mean error of 250 mm. In our case, the RMS for the four kinematic models at a prediction horizon of 0.5 s is between 50 and 100 mm, as opposed to an RMS of ≈120 mm by the CV model applied to the raw data.

Conclusions
In a human-robot collaborative space, the short-term prediction of a person's walking position becomes necessary from a real and perceived safety point of view. In this paper, we propose a human trajectory prediction method for real-time application based on the biomechanical characteristics of human gait. This approach can be applied with inexpensive wearable sensors, and it has a low computational load. Experiments were designed to evaluate the performance of the proposed method during normal walking, comprising straight and curved paths. The results confirm how the left-to-right fluctuations of the position of the subject in the direction of the displacement induced by the alternation of the step affect the performance of the basic kinematical models to predict by themselves. We have found that if such undulations are removed, prediction performance would be improved and propose a prediction method that compensates the body swing by correcting velocity and orientation based on the initial and final contacts of the feet and the pelvic motion. The results show that, as acceleration makes a big impact on error and acceleration in human walking is low, the use of accelerated models may not be very profitable. Despite this, the performance of the proposed prediction method improves the use of basic kinematical models and produces results compatible with real-time applications.