Anticipatory detection of turning in humans for intuitive control of robotic mobility assistance

Many wearable lower-limb robots for walking assistance have been developed in recent years. However, it remains unclear how they can be commanded in an intuitive and efficient way by their user. In particular, providing robotic assistance to neurologically impaired individuals in turning remains a significant challenge. The control should be safe to the users and their environment, yet yield sufficient performance and enable natural human-machine interaction. Here, we propose using the head and trunk anticipatory behaviour in order to detect the intention to turn in a natural, non-intrusive way, and use it for triggering turning movement in a robot for walking assistance. We therefore study head and trunk orientation during locomotion of healthy adults, and investigate upper body anticipatory behaviour during turning. The collected walking and turning kinematics data are clustered using the k-means algorithm and cross-validation tests and k-nearest neighbours method are used to evaluate the performance of turning detection during locomotion. Tests with seven subjects exhibited accurate turning detection. Head anticipated turning by more than 400–500 ms in average across all subjects. Overall, the proposed method detected turning 300 ms after its initiation and 1230 ms before the turning movement was completed. Using head anticipatory behaviour enabled to detect turning faster by about 100 ms, compared to turning detection using only pelvis orientation measurements. Finally, it was demonstrated that the proposed turning detection can improve the quality of human–robot interaction by improving the control accuracy and transparency.


Introduction
Designing the control of robots for walking assistance is a challenging task, as it is not clear how they should be controlled by the user [7,22,29,32,33]. Ideally, the control should be safe, efficient and enable an intuitive and natural human-machine interaction. The recent Cybathlon 2016 competition illustrated the importance of having an easy to use control interface, and the challenges to develop intuitive control interfaces for walking assistance robots [27].
Various strategies were proposed to control wearable lower limb robots and exoskeletons. For instance, the rex bionics exoskeleton (Auckland, New Zealand) is controlled over a joystick that enables the user to select the activity and walking speed. While this joystick based control is simple and robust, it increases the mental load and may not be fast to learn. Some robots use a non-invasive BCI to select actions [22,33], which currently enables only slow control not compatible with real-time walking control. Other control approaches include body weight shifting detection for motion initiation [7,29] and real-time interaction force and kinematics tracking [32] which is suitable for healthy subjects walking assistance, and can also be used for neurologically impaired users by generating patient-specific stable locomotion trajectories [5,18,34].
Existing exoskeleton control systems assume that the human-user is able to perform the turning action or to rely on joystick based input. This lets the robot to follow the turn when it is mechanically transparent and its mechanical structure does not constraint natural human movements. However, many current systems have kinematics constraining the movement to straight walking thus do not allow natural steer-Anticipatory detection of turning in humans for intuitive control of robotic mobility assistance 2 I Farkhatdinov et al ing. On the other hand, several studies have shown how the upper body can be used to control powered wheelchairs, using gaze tracking [21,23] or head movement based on face tracking [20]. However, such tracking systems require significant attention and concentration, and the gaze-based control interface may interfere with the users' natural eye-head-body coordination.
While these previous works have proposed various ways to control walking interfaces, to our knowledge no dedicated turning detection algorithm has been proposed that enables intuitive and efficient control of the mechanically coupled human-exoskeleton turning movements. Turning during locomotion is a relatively complex motor task [13,30,31], and careful human-robot coordination is required to perform the task safely and efficiently. The present paper investigates a natural human-robot interaction method for turning during locomotion based on actual human body movements. Neurologically injured individuals such as stroke and spinal cord injury are often unable to control their lower body but have better control of the upper body including the head and trunk [2,9,10]. Therefore the upper body may be used to control a gait assistance exoskeleton, by detecting the intention to turn and subsequently assisting the turning movement.
Indeed, it is well known that during natural locomotion upper body movement precedes the actual turn. The head and gaze react first by steering the eyes and head towards the turning direction. In [11] the head behaviour during walking along curvy paths was studied in healthy humans. The results showed that head direction systematically anticipated changes in direction of locomotion by about 200 ms. This anticipatory behaviour was observed in gaze as well, as it was shown that the gaze is reoriented towards the change of direction of locomotion before the head. The eyehead anticipatory coordination was recorded for 90° turns both in eyes closed and natural conditions and the anticipation lead time was up to 1 s [12]. The head anticipatory behaviour is an essential part of the walking and steering behaviour in humans. It was shown in [15] that head rotation immobilisation resulted in anticipatory trunk rotations and reduction of stability in trunk orientation during turning. Similar results were reported on gaze-head-trunk turning anticipatory behaviour in walking and standing [1,4,[14][15][16][17]19].
A few studies proposed to use anticipatory properties of upper body movements to control robotic systems. In [24,28] it was shown that head anticipatory behaviour can be observed during controlling robotic systems. Specifically, the head was observed to anticipate the hand joystick movement in mobile robot teleoperation, video game and robotic tool control. However, to our knowledge no systematic investigation of the behaviour and its application to robot control was presented yet. Furthermore, the robot control tasks described in [24,28] did not involve locomotion with an assistive device co-moving with the user. In [2,8] it was demonstrated that spinal cord injured patients can learn to use the residual upper body movements in order to control assistive devices such as a wheelchair, or perform computer tasks, using a pre-defined body to task mapping. However movement intention prediction based on typical anticipatory behaviour was not investigated.
In this paper we investigate the use of the natural anticipatory behaviour of upper body to detect the intention to turn during locomotion, and to command turning with a lower limb assistive robot. This natural behaviour of the upper body may make human-robot interaction more intuitive than previous control methods, and improve the performance of robotic rehabilitation and prostheses applications. First, we record and characterise the head anticipatory behaviour in locomotion in healthy participants. Then, we use the recorded data to develop a method to detect a turning movement before it is started based on the head anticipatory behaviour. We suggest that the turning anticipatory behaviour of the upper body can be efficiently used to control lower limb assistive robotic devices based on real time head and pelvis motion measurements and provide user with a natural human-robot control interface. To support our findings we demonstrate in a simple turning example that faster activity detection improves the quality of the robot control.

Methods
This section describes the experimental protocol, the proposed turning detection algorithm and a set of validation methods used to evaluate the algorithm's performance. Sections 2.1 and 2.2 describe the experiment which was used to collect human turning data. These data was then used for generating turning behavior clusters for the proposed head-based turning detection method described in section 2.3. A simple pelvis yaw threshold based method is described in section 2.4 which was used as an alternative turning detection approach for performance comparison with the proposed method. Sections 2.5-2.7 describe performance evaluation tests for different turning angles, multiple turns and for anticipatory turning control of an assistive robotic system, respectively.

Experimental setup and protocol
Seven healthy human-subjects (age 25-31, all males) were asked to walk straight and turn during which the orientation of the pelvis and head were recorded. Yaw angle orientation was recorded at 75 Hz sampling rate using wireless wearable inertial measurement units (IMUs -MTw XSens, Enschede, the Netherlands). Figure 1 shows a top view of the experimental setup. Each subject was asked to walk under three conditions: straight-ahead, straight-ahead followed by a 90° left turn, and straight-ahead followed by a 90° right turn. In the beginning of a trial a subject was asked to stay straight with head and body aligned along the direction of walking. IMUs were re-aligned before each trial to improve motion tracking accuracy. Computer generated voice command first gave a command to start walking straight-ahead. An infrared proximity sensor (placed approximately 1.5 m away from the starting point) was used to detect subject and to trigger one of recorded voice commands: 'walk straight', 'turn left' or 'turn right'. The sequence of commands was randomised for each subject. After hearing the voice command, a subject was expected to continue walking straight for 1-1.5 m and then to follow the requested walking trajectory. Subjects were instructed to stop movement after they had walked for about 8 m in total. Each walking command was repeated 10 times for each subject, thus each subject performed 30 walking tasks during the experiment. Additionally, each subject performed six initial testing trials which helped them to understand the task better. Average walking speed in all trials was about 1-1.5 m − s 1 . The experimental protocol was approved by the imperial college london research ethics committee and the participants have written and signed informed consent.
Additionally, two subjects (from the same participants group) carried out a control experiment to test if the proposed turning detection algorithm will be able to distinguish between the real whole body turning motion and head only turning during walking. The same experimental setup as for the main experiment was used in this case. These subjects were asked to perform walking trials when only their head was turned left or right during straight locomotion. The random voice commands were: 'turn head left', 'turn head right', 'keep head straight'. Each subject performed 10 trials for each command.

Data analysis
The recorded time history of head and pelvis yaw were first analysed to identify the start and end of the turning movement for the head and pelvis during locomotion. Figure 2 shows the time history plots for head and pelvis yaw of a typical subject. In figure 2(a), we observe that the head turns earlier than the pelvis during left or right turning, and these results are in accordance with previous findings on head anticipatory behaviour [11,12]. To determine the time instants when turning starts head and pelvis yaw behaviour was modelled as a time-delayed second order system described with the following transfer function: where ω is the natural frequency, ξ damping ratio, and T time delay. Identification of the transfer function parameters was done using the MATLAB identification toolbox (Mathworks, Natick, MA, US) for each trial of each subject.
Step signal starting at time = t 0 (90° step, positive for left, negative for right turns) was used as input for ( ) W s , while the yaw measurements were used as delayed output of ( ) W s . We were specifically interested in the identified values of time delays, T , which defined when head and pelvis turning started and permitted the analysis of the anticipatory behaviour. Therefore, the identification precision for time delay parameter of ( ) W s was set to 10 ms. The total turning time was determined by using the 10%-settling time which corresponded to the approximate range of turns based on the recorded data, as the subjects were not able to perform exact 90° turns.

Anticipatory head based turning detection
Let us now describe how the head turning anticipatory behaviour during locomotion can be used to detect turning before it actually happens. Head yaw and pelvis yaw measurements collected during the experiment with the different subjects and plotted against each other are shown in figure 3. Five relatively clear sets of data can be obtained: walking straight when head is straight, walking straight with head turned left, walking straight with head turned right, walking after turning left and walking after turning right. We aimed to develop a method to distinguish between all these sets and detect turning as fast as possible after it has been initiated. It is important to note here that the data points located between left and right turning activities are not located along the { = y x} diagonal line which corresponds to head anticipatory behaviour. This anticipatory behaviour provides additional information about turning action and can be used to detect turning early. Clustering head and pelvis data is used to define the data sets that correspond to walking straight, turning left and turning right behaviours during locomotion. Then, Bioinspir. Biomim. 12 (2017) 055004 by assigning a given point of head and pelvis yaw to one of the clusters we can identify if turning has started or not.
We used k-means clustering (with = k 3) to define three behaviours: walking straight, turning left and turning right. In order to obtain improved clustering results we applied the following transformation to each measured pelvis-head yaw point: where vector ( ) x y , is pelvis and head yaw vector φ φ , p p ( ) in the transformed space; k h and c the scaling constants; Θ an angle between the measurement vector φ φ , p p ( ) and horizontal axis, and r its length. First, the yaw points along the head-axis were scaled k h -times, because in our approach the head behaviour as a valuable feature for turning detection. Then each point was scaled with respect to the corresponding vector's angular orientation by multiplying it by ( ) Θ sin 2 . This keeps the points { = y x} along the main diagonal, but moves points corresponding to headonly rotation closer to the origin. Finally, the scaling by /( ) + c r 1 moves the points of interest away from the origin.
The parameters for space transformations were: = k 4 h (it should be more than 1 in order to scale the head yaw) and = c 35. The parameter = c 35 was selected as follows. Clustered over the data set of figure 4(b) will not group the data into required behaviours, as the three centroids of the data are not clearly split due to significant amount of data liaising the centroids (central, bottom left and upper right centroids). Therefore, division by ( ) + c r was required, so that the walking straight data centroid (central centroid in figure 4(b)) will be distinct from turning centroids. To do that, we defined a disk with radius = R 23 containing all data points corresponding to walking straight with head straight as shown in figure 3. We considered a point A in the first quadrant as the intersection of the circle and the identity line and point B with the coordinates (90°, 90°) as presented in figure 3. The points A and B lie on the identity line, therefore the transformation ( ) Θ sin 2 does not influence their location. The clustering procedure after the final transformation (figure 4(c)) should take into account that the transformed points A' and B' represent the element of the maximal boundary for straight walking and the centroid of walking to the left after turning was completed, correspondingly. To assure this it is required that the distance between the origin (0,0) to A' equals to A'B'. This distance equality condition suffices when ≈ c 35. The transformed data set of measured head and pelvis yaw was clustered into three groups: {walking  straight, turning right, turning left}-using k-means clustering shown in figure 4(c). Once clustered the data points can be mapped back to the original space as shown in figure 4(d).
These clusters were used for off-line detection of turning during locomotion for each subject using cross-validation tests and the k-nearest neighbours method ( = k 5) to classify the tested data points. Offline testing was used to evaluate the performance of the proposed algorithm, as it enabled easy parameter setup and testing condition modifications. Importantly, once the turning detection is tested off-line and suitable parameters are determined it can be transferred to online testing. The turning detection algorithm was realized in MATLAB (Mathworks, Natick, MA, USA), which used the recorded during experiments timehistory of head and pelvis yaw for a given subject as an input and calculated the turning detection time for the recorded data. Each walking data for a given subject which was being used for turning detection, was not used for forming the clusters. That was done in order to test the robustness of the proposed detection method and to demonstrate that the method is not subjectspecific and can efficiently work with the data sets of different subjects. The turning was detected when the identified class of the tested point changed from walking straight to turning.

Pelvis based turning detection
A simple way to understand whether a subject is turning during walking is to observe the pelvis yaw movements and detect the instances when the pelvis yaw angle exceeds the predefined orientation threshold ϕ th . This pelvis based method is the simplest upper body based turning detection method and it will be used to evaluate the efficiency of the proposed method which is based on the head anticipatory behaviour. The angular orientation thresholds can be set as maximal pelvis yaw angles of the specific subject if available or as the maximal possible pelvis yaw during straight walking of a group of subjects as done in this paper. Some implementations of threshold based methods for turning detection can be found in [6,25] where it was also suggested that monitoring body's angular velocity improves the turning detection. In our study we do not take angular velocity into consideration for the pelvis based methods, as well as for the proposed head based method, hence performance comparison of both approaches is fair.

Multiple turns detection
The turning detection method described in previous sections was extended to a multiple turns detection algorithm. Additionally to applying the k-nearest search method to the turning data, we need to determine when each turning is completed and straight walking is initiated. To detect straight walking we employ a simple threshold based method that observes the pelvis yaw time history and triggers straight walking event. Once turning is completed and walking straight is detected we need to reset the coordinate frame for the clusters ( figure 4(d)). This was done by translating the origin to (90°, 90°) if the last detected turning was 'left' or to ( −90 , −90 ) when the last turning was 'right'.
Three subjects took part in the testing multiple turning detection experiment, who had not participated in the initial single turning trials. They were asked to walk indoors and follow the turning commands of the experimenter. The same set of IMU measurements was used as in the initial experiments. The data set used for cross validation tests for turning detection was based on the yaw angles collected in the single turn trials described above.

Testing turning to different angles
To test the efficiency of the proposed algorithm to detect turning to different angles a series of numerical simulations were performed. We simulated a participant walking straight, and then turning to 30°, 45° and 60°. A set of 70 head and yaw turning trajectories was generated for each turning angle. In testing, the simulated head and pelvis trajectories were used as inputs to the proposed turning detection algorithm which is based on the clustering from the 90°-turning left/right real participants data. Hence we can assume that the proposed turning detection method is efficient, if it is shown that turning to other angles can be detected with the 90°-turning clusters only.
To simulate natural dynamic behaviour of the pelvis and the head the averaged results of the system identification from all subjects' data in section 2.2 were employed. Turning behavior was modelled with step responses of the second order transfer function (1) with the head parameters ω = 4.03 h rad − s 1 and ξ = 1.17 h , and the pelvis parameters ω = 3.00 p rad − s 1 and ξ = 0.83 p . Anticipatory behaviour of the head was modelled by delaying the pelvis turning by averaged anticipatory time calculated from all subjects data ( ± 528 385 ms). For our simulation the turning initiation time was set to = t 3 s. To emulate natural pelvis and head oscillations in horizontal plane during straight walking before the turning is initiated a sinusoidal signal was added to the head and the pelvis yaw trajectories: for the pelvis with amplitude 12° and frequency 0.74 Hz, and for the head with amplitude 3° and frequency 0.60 Hz. These values for amplitude and frequency were obtained as averaged parameters from the fast Fourier transform analysis of the straight walking data of all subjects. The phase difference for the head and the pelvis oscillations was set to π ±25% as similar behaviour was observed in the experimental data. To model the variation between the trials, Gaussian random noise was added to the signal parameters such as straight walking oscillation amplitudes, phase difference and anticipation time when each simulated walking trajectory was generated. The amplitudes of the added noise for maximal pelvis and head oscillation amplitudes, phase difference and turning anticipation time corresponded to the signals standard deviation values: ≈ 2 , ≈ 1 , ≈ / π 4 rad, 358 ms, respectively.

Using turning detection for human-robot co-control
This section describes how anticipatory control of turning based on above detection method can be implemented to provide robotic assistance. Demonstration of the control is achieved through simple human-exoskeleton robot interaction model consisting of coupled masses corresponding to human turning during locomotion. A human's head and pelvis and the assistive robot connected to the pelvis were modelled using simple second order linear models: ( ) = f f t , m, b and k define the angle, control force, inertia, damping and stiffness, respectively; the lower indices h, b, r indicate the head, body (pelvis) and the wearable robot parameters, respectively. In the model, the head was connected to the rest of the body through viscous coupling b h . The viscous coupling between the body and the robot was neglected, however the connection with the robot was modelled as stiffness, k rb , and the robots' friction was modelled as damping b r . The human turning motor inputs were modelled as linear controllers: where k and d are control gains, x ref is the desired turning angle, and t a is the time specifying the delay in the body turn following the head anticipatory movements. To model the robot control, a simple linear compensator was used that tracks the human body movements by minimising the difference in the robot and the body orientation: (5) where f ac is the anticipatory control law which we introduced to improve turning assistance using additional head movements information. The f ac was defined as (6) where t d is the turning detection time. In the head-based turning detection method the anticipatory control was activated once the turning had been detected. The anticipatory control component of the model was not used ( = f 0 ac ) when the pelvis only turning detection method was tested. The tracking control error (difference between robot and human motion) for two turning detection methods were compared. In this paper we introduced the basic anticipatory control law, but the control is not necessarily limited to simple linear relations and more efficient designs are left for future research.
The values of the model's parameters were selected so that the time responses of the head and the pelvis movements corresponded to the average response of the experimentally identified second order systems (1) Nm · s − rad 1 ; sampling time was set to 0.001 s. In the simulation Gaussian random noise with standard deviation 0.05 rad was added to the angular positions of the head and the pelvis in equations (4)-(6).

Head anticipatory behavior
First, we determined the starting and ending turning times for the head and the pelvis of each subject in each trial using second order transfer function fitting as described by equation (1). The turning times for seven subjects (s1-s7) are shown in figure 5. In the first row of the figure the height of each bar plot represents the turning time of the head (black bars) and of the pelvis (grey bars). The bar plots representing starting and ending turning times were aligned such that time = t 0 corresponds to the pelvis turn starting time. In all cases head turning was initiated before the pelvis turn ( ⩽ t 0). The middle row shows the turning anticipation time for all subjects in left and right turns. The bar plots in the bottom shows the normalised anticipation time where the mean anticipation time for each subject was divided by the total turning time. The mean results of turning duration and head turning anticipation time for all subjects are presented in table 1. In average the subjects' head turned 528 ms earlier than the pelvis which corresponds to 27.5% of total turning time. There was no significant difference in turning and anticipation times for left and right walking trajectories. Figure 6(a) presents the comparative results of turning detection using the proposed head anticipatory turning method and pelvis threshold based method for all subjects in left and right walking trajectories. The pelvis turning detection threshold was set to 17.25°, the maximal pelvis yaw angular deviation during straight walking among all subjects. In average, detection was faster with the proposed head anticipatory method. The average turning detection time reported in table 1, is 300 ms for head based method and 407 ms for pelvis based method. The second row of figure 6(a) shows the proportion of cases when the proposed detection method performed better in each individual turn. The proposed anticipatory detection method performed better at least in 80% of cases except for subject s5 for turning left. Overall in more than 87% of the tests the turning was detected earlier with the proposed head based anticipatory method. The bottom row   Bioinspir. Biomim. 12 (2017) 055004 of figure 6(a) shows the percentage of misdetections for the pelvis based detection method. We defined misdetection as the case when turning was predicted, but the data following this prediction did not match the turning activity. As shown in figure 6(a) (third row) and reported in table 1, there were no cases for misdetections when the pelvis yaw threshold was set to maximal possible deviation, 17.25°. There were no misdetection cases when the proposed detection method was used.

Turning detection
We have tested the detection when a lower pelvis yaw threshold was used, as it may improve the detection results for the pelvis threshold method. Possible disadvantage of lowering the threshold is a potential increase of the number of misdetections. The pelvis yaw threshold was set to 6.02° which corresponds to the value of two standard deviations of the pelvis yaw during straight walking (more than 95% of yaw points were considered). Figure 6(b) shows the comparative results for this threshold and the proposed head anticipatory based method. As expected this time, the pelvis based method detected turnings faster than the proposed head based method. Mean detection time with the pelvis based method was 283 ms, which is still larger than the head based anticipatory method (see table 1). Importantly, the pelvis based method could not to detect turning correctly in most of the cases, as there was significant number of misdetections: 81% of all trials were identified turning action for straight walking. In both cross validation tests there were no misdetections observed when the proposed head based anticipatory methods was used.
To further compare the performance of the proposed turning detection method to pelvis threshold based method, we run a set of cross-validation tests for different values of pelvis thresholds. In summary of results for all subjects and trials presented in figure 7, each data point corresponds to 140 trials (7 subjects × 20 trials for left and right trajectories). The left bar plot presents the percentage of cases when turning detection was successful, i.e. when the detection event was followed by actual turning movement. While all detection tests with the proposed head based anticipatory method were always successful, the turning detection with the pelvis method was always successful only when the threshold was more than 17.25° which corresponds to maximal absolute pelvis oscillation during straight walking among all subjects. The detection success rate was decreased for lower threshold values and it was less than 50% for the threshold values below 7.5°. The right plot of figure 7 shows the percentage of cases when the proposed head anitcipation based method was detecting the turns faster than the pelvis based method. Based on the two plots of figure 7 the pelvis method detected the turning faster than the head based method with a success rate more than 50% for the pelvis yaw thresholds in the range of ≈ 7.5°.. 11.9°. Once the pelvis yaw threshold was set to ⩾11.9° the head based method was better than the pelvis based method providing 100% detection success rate. At the same threshold point, the pelvis based method reached the success rate of 90%, 10% less than with the proposed detection technique.
We have also tested if the proposed head anticipatory based method is capable of discriminating the steering during locomotion and from head turns alone (i.e. with no corresponding body turning movement). The results showed that there were no misdetection cases. Figure 8 shows walking trajectories during multiple turning detection tests with three participants. The feet trajectories were reconstructed from the inertial measurements based on the method described in [35]. Thin black lines of the feet trajectories correspond to straight walking, while thick red lines correspond to turns, as it was identified by the proposed turning detection method. The instants when turning was detected and completed are shown with black and grey arrows, representing orientation of the head and the pelvis, respectively. In all turning cases the proposed turning detection method worked correctly  and was able to identify turning at its earliest stages. Head orientation was always anticipating the turning intention of the subjects. The turning detection times for the subjects were 176 ± 25 ms, 201 ± 23 ms and 218 ± 57 ms.

Turning to different angles
We have used the simulated turning trajectories as described in section 2.6 with the experimental data based clusters to evaluate the performance of the proposed turning detection method. Figure 9(a) illustrates generated head and pelvis yaw behaviour for turning to 30° and 60°. Both trajectories contain straight walking ( ⩽ t 3 s) when the head and the pelvis are oscillating in antiphase, as it is observed in the experimental data. Turning initiation was programmed for = t 3 s, which was followed by the head and the pelvis turning to the final orientation. The set of 70 trajectories was used to test the turning detection with the proposed and pelvis-based methods. The threshold for pelvis based method was set to 13.00° as it corresponded to maximal amplitude of simulated straight walking pelvis movements which is a more conservative testing condition than it was in the experimental tests. The results for turning detection time for three turning angles are shown in figure 9(b). For all turning angles and trials the headbased detection method performed better than the pelvis-based only method. The turning detection was ≈ 90 ms, ≈ 40 ms and ≈ 30 ms faster when head turning information was used for 30°, 45°, 60°, respectively.

Anticipatory control of turning with the assistive wearable robot
This section presents an example of anticipatory control for wearable assistance robot during turning based on the model described in section 2.7. The model was used to compare how turning detection methods based on the head and the pelvis movements influence the accuracy of the robot exoskeleton control and interaction with the user during turning. In the modelling tests presented here the primary goal of the controller was to make the wearable robot follow the human's turning as closely as possible, hence making turning action comfortable through increasing mechanical transparency. Enabling transparent control is a crucial step for human-robot assistive systems, as it makes interaction natural and prepares a basis for further assistive controllers implementation. To evaluate the transparency of the controller, the error between the robot and the human body positions was selected as the performance measure, because accurate tracking of the body position is critical for the stability, efficiency and safety of the wearable robotic system. Accurate position tracking improves the system haptic transparency which is critical for wearable robotic systems. In the modelling scenario a human was required to turn the body by 1 rad. The results are presented in figure 10. The left panel shows the head and the pelvis yaw versus time and the error of the robot tracking controller. The robot followed the body turn in two cases: when the turning was detected based on the pelvis threshold and when the turning was detected based on the proposed anticipatory method. In the simulation, the timings for head anticipatory turn t a , and for turning detection time t d were taken from  figure 10 the control error was reduced when the anticipatory head based turning detection was used. The control performance was tested for different turning detection times ( = t 0... 0.5 d s). The calculated root mean square errors of differences between the body and the robot angles for different turning detection times are shown in the right panel in figure 10. The control error was significantly increased with the longer turning detection time. The modelling demonstrated that using head movements for turning detection is beneficial for collaborative human-robot control by taking advantage of anticipatory nature of human motion planning.

Discussion
A novel method for detection of turning behaviour during locomotion by which can be used for lower limb assistive robotic systems was presented. The results of our experimental evaluation demonstrated the efficiency of the proposed head based turning  anticipation method in detecting turning during locomotion. Compared to simple threshold based turning detection method the presented method relies on the usage of head movements during locomotion which provides valuable information about human's intention during walking and turning. The anticipatory behaviour of the head and the upper body which was used in the detection method has found to be essential for natural walking and observed in all healthy subjects. Early head movements during steering enabled to detect turning earlier and more robustly, as the design of the anticipatory based method is independent from the pelvis based threshold.
In the present work we considered the applications in which turning is detected while human-subjects are walking. The proposed turning detection method is meant to be used with assistive walking robots which are physically interacting and moving together with its user in contrast to previous work on controlling robots [24]. Typical example of systems where our approach is useful are wearable exoskeletons which require fast, robust and reactive control for high performance. Physical interaction between robot and its user requires the controller to observe and predict human movement intentions to improve stability and safety of collaborative locomotion.
Our control application scenario demonstrated that earlier turning detection helps the robot to turn in accordance with the natural human body movements, which should improve the coordination of the robot with the human movements and increase haptic transparency of the interaction. Achieving transparent haptic interaction is critical for human-robot assistive systems, as transparent control is the basis for designing assistive strategies operating in force/ position or impedance modes. Having extra anticipatory body movement information such as head orientation enabled fasted control reaction and provided the robot with a new motion planning reference. The turning detection method presented in this study can be used as a natural control input, making humanrobot interaction more intuitive and assisted locomotion more efficient.
Data clustering required for the proposed method is computationally expensive, however it can be done off-line, while the actual detection procedure based on k-nearest neighbours method can be implemented online as it only consists of a simple search in twodimensional space. Importantly, the size of the clusters can be reduced, as the algorithm does not require the full range of turning data, because the actual turning and switching between clusters happen when the absolute hip and head yaw angles are typically in a range of 7 to 20 . Additionally, our tests have shown that it is not necessary to redo the clustering for turning detection for each individual user, as the identified turning clusters are similar between different subjects, and subject-to-subject differences do not affect the detection's quality.
The proposed approach may be applied to different groups of neurologically impaired users to assist walking with the help of robotic systems. It was shown that SCI patients are capable to use upper body movements to perform robot control tasks [2]. Usage of anticipatory behaviour of upper body may provide more efficient and natural human-robot interaction control which can be also applied in the rehabilitation systems to improve turning performance [3]. However, further studies of upper body anticipatory behaviour is required for neurologically impaired users. Additionally, further studies are required to investigate the robustness of anticipatory turning behavior when robotic assistance for turning is applied, as it may be possible that the natural human behavior is constrained with the robot and extra adjustment for the algorithm might be required, especially in the case of impaired users.