An Analysis on Position Estimation, Drifting and Accumulated Error Accuracy during 3D Tracking in Electronic Handheld Devices

This work focuses on a brief discussion of new concepts of using smartphone sensors for 3D painting in virtual or augmented reality. Motivation of this research comes from the idea of using different types of sensors which exist in our smartphones such as accelerometer, gyroscope, magnetometer etc. to track the position for painting in virtual reality, like Google Tilt Brush, but cost effectively. Research studies till date on estimating position and localization and tracking have been thoroughly reviewed to find the appropriate algorithm which will provide accurate result with minimum drift error. Sensor fusion, Inertial Measurement Unit (IMU), MEMS inertial sensor, Kalman filter based global translational localization systems are studied. It is observed, prevailing approaches consist issues such as stability, random bias drift, noisy acceleration output, position estimation error, robustness or accuracy, cost effectiveness etc. Moreover, issues with motions that do not follow laws of physics, bandwidth, restrictive nature of assumptions, scale optimization for large space are noticed as well. Advantages of such smartphone sensor based position estimation approaches include, less memory demand, very fast operation, making them well suited for real time problems and embedded systems. Being independent of the size of the system, they can work effectively for high dimensional systems as well. Through study of these approaches it is observed, extended Kalman filter gives the highest accuracy with reduced requirement of excess hardware during tracking. It renders better and faster result when used in accelerometer sensor. With the aid of various software, error accuracy can be increased further as well.


Introduction
Portable, compact, easily accessible, and cost-effective means of services and technology are of great use in recent times.A lot of works have been carried out in the field of computer algorithm and application development which is based on mobile and portable workstations like cellphone, smartphone, tablet, Personal Digital Assistant (PDA) etc.These devices are especially opted since they feature few unique characteristics i.e. portability, cost effectiveness, multiple platform and OS compatibility, easy internet connectivity for firmware update, user friendly UI etc.Moreover, with the advances in semiconductor chip and integrated circuits technology, these devices now boast highly powerful processors and a wide range of sensors.A developer hence can take advantage of this powerful yet portable computing ability of these devices to design innovative applications.To accurately estimate position and localization, and to achieve effective tracking, various combinations of sensors, algorithms have been designed and developed which work together in synchronization.After thorough scrutiny and analysis of relevant works in this area, it is found that they can be broadly categorized and discussed based on their methodology, framework, and experimental results.Hence our discussion is separated into three afore-mentioned kinds so that it is possible to critically analyze relevant works in an effective way considering every criterion and come up with a new idea.

Using Miniature Inertial Sensors
Various types of sensors have been used to accomplish various tasks.Miniature inertial sensors based on biomechanical models and sensor fusion algorithm can accurately track human motion [1].A rigid body can move freely in 3D space in six degrees of freedom (6DOF) which refers to specific number of axes.The number of independent parameters is characterized in 6DOF which elucidates the configuration of mechanical system.The rigid body can move with X, Y and Z axes and change its orientation among these axes with the help of rotation which are usually referred as pitch, yaw and roll.6DOF is mainly used in engineering and robotics to count the number of degrees of freedom of an object having 3D space.In short, it can be said that there are six parameters which are created during the movement of body.The movement of the cell phone can be tracked using 6DOF sensors of cellphone.Six degrees of freedom are more in number in case of robotics.Robotic arm has 18 degrees of freedom because three segments are found in its arm with each segment having six degrees of freedom [2].It is an expensive system for robotics and the cost of equipment, software and personal requires can restraint use of this system only to large productions.

Using Sensor Fusion Approach
Sensor fusion is another effective approach where data from several sensors is combined in a time triggered network that can correct deficiencies from indi-Journal of Computer and Communications vidual sensors to calculate accurate position and orientation information [3].It proposes two sensor fusion algorithms to accomplish this task, the systematic confidence-weighted averaging algorithm and the application-specific robust certainty grid algorithm.TT (Time-Triggered) design requires detailed design phase.Data arrival at fusion node does not coincide due to variable propagation delays.This sensor fusion can be used in android devices for indoor positioning quite satisfactorily [4].It focuses in estimating the position of the phone inside a building where the GPS signal is bad or unavailable.By using data from the device's different sensors, such as, accelerometer, gyroscope, and wireless adapter, the position is determined.Advantages of using sensor fusion are redundancy, complementary, timeliness and less costly information.However, it has higher power assumption.

Using Triaxial Accelerometers
Mobile robot position can be accurately recorded using accelerometer [5].Here Kalman filter is used to reduce error caused by random noise.Although it can reduce error caused by random noise as well as having low cost and small size, random bias drift problems can occur here.Tri-axial accelerometer has also been used to determine position and orientation precisely [6].Triaxial accelerometers provide simultaneous measurements in three orthogonal directions, for analysis of all the vibrations being experienced by a structure.Here, each unit is a combination of three sensing elements, separated from one another and aligned at right angles with each other.It helps to diminish cost, amenity and upgrade tangential sensitivity, but it is bulkier in size.A combination of accelerometer, gyroscope, magnetometer can be used as well for 3D knee kinematics, having low error percentage results [7].A combination of two sensors has also been used to develop the error propagation equations [8].Beginning with the basic multi-sensor triangulation equations to estimate a 3D target position, error propagation equations are derived by taking the appropriate partial derivatives with respect to various measurement errors.Gaussian measurement is also used.

Inertial Measurement Units (IMU)
Integrated electronic devices containing accelerometers, gyroscopes, magnetometers are incorporated in Inertial Measurement Units (IMU) [9].IMUs are integrated electronic devices that contain accelerometers, magnetometers and gyroscopes.This system is not free from drift error, a difference between the actual position and system detected position.Growth of quadratic error in position and linear error in velocity occurs due to constant error of acceleration in the time of integration.On the contrary, quadratic error in velocity and growth of cubic error in position appears because of constant error of gyroscope [10].To mitigate drift error, MEMS based low cost system has been designed for pedestrian navigation using only accelerometer and gyroscope sensors without incorporating a magnetometer [11].Inertial measurement units have been used for gait analysis as well [12].A miniature inertial/magnetometer package wirelessly coupled to PDA is reported to track pedestrian position effectively with or without GPS availability [13].Using MEMS inertial sensor, it is possible to measure accurately up to 50 cm in case of diameter [14].The advantage of inertial sensor is being self-contained and non-reliant on external field, disadvantage is it is typically rate measurement and expensive.Though the system does not require calibration and is stride length independent, it can be affected to render erroneous data from surrounding metal infrastructures or buildings.Foot mounted inertial sensors have also been used in indoor environment for pedestrian localization [15].The system takes advantage of the low cost and small size of inertial sensors but it requires dedicated experiment space and walking range.

Kalman Filter Based Tracking
A widely-used approach of accurate tracking is Kalman filtering [16] [17].This approach has several advantages.It requires smaller memory allocation which makes it well suited for real time problems and embedded systems.It is a convenient form for online real-time processing.However, use of Kalman filter can sometimes make the final error level worse.1D Kalman filter, a statistical technique, can adequately describe the random structure of experimental data through a connection with GPS and Wiener filter [18].Here, the error is smaller with time varying gain.Kalman filter can be implemented with an accelerometer sensor that gives excellent noise reduction, increases dynamic range, and reduces displacement of mass under closed loop structure [19].Kalman filter fusion algorithm in IMU/UWB can be used to track human operators effectively [20].
Kalman filter approach has also been used for global pose estimation using multi sensor fusion [21].The system is made using Kalman filter for fusion of Differential GPS (DGPS) or Real Time Kinematic (RTK) for AR (Augmented Reality) and IMU with visual orientation tracker.Altitude Kalman filter is not independent because of 9 parameters for altitude representation and not easy to use and understand, besides real-time kinematics is no longer useful.

Extended Kalman Filter (EKF)
The extended Kalman filter (EKF) is the nonlinear version of the Kalman filter which linearizes about an estimate of the current mean and covariance [22].EKF usually gives less accurate measure of covariance.It is incorporated in designing indoor positioning system based on IMU/magnetometer [23].This filter also renders better and faster result when used in accelerometer sensor.Besides EKF, Unscented Kalman filter (UKF) algorithm is used for better position accuracy and reliability, uses U transform during filtering [24].UKF is more appropriate in solutions to nonlinear systems compared to EKF [25].

Framework of Position Estimation Approaches
Among different frameworks, MVN consists of 17 inertial and magnetic sensor Journal of Computer and Communications modules [1].The magnetic sensor is not always able to find out below-surface defects, and inertial sensor is typically rate measurement and expensive.Computer, motion sensors (accelerometer) and rotation sensors (gyroscope) are used in inertial navigation system (INS) for continuous calculation of dead reckoning position, orientation and velocity of moving objects without external reference [26].In sensor-fusion approach, the application is structured as a single activity with different layouts (views) [4].The main processing line takes care of the sensors reading which is handled by an event listener.When a new value from the sensors is sampled depending on the mode it will be processed by the positioning engine, displayed on the screen or stored in a sampling array.The UI is handled from an independent thread, the screen updates are controlled by a timer and by external calls from the positioning block.The mode changes are triggered either by the 30-user interaction (through the menu) or by special event in the block which handles the sensors (e.g. the calibration is completed).
IMUs work by the principle such as, the first and the second frames depend on orientation and mounting position, and remain constant during motion between joint center and origin of their position [12].Here, MT9 need six channels to change and each channel needs to record separately [9].On the other hand, magnetometer calibration is done in implementing the Navshoe system based on inertial sensors [13].
Kalman filter based inertial motion capture system and UWB localization system for hybrid tracking incorporates measurements from the GypsyGyro-18 [20].These are transformed to the Ubisense coordinate system using transformation matrix in the same coordinate system.Kalman filter is used for prediction step and correction of step, whereas the Ubisense system usually returns accurate positions.However, some measurements from the Ubisense system have big errors and shouldn't be incorporated to the Kalman filter.In case of orientation estimation and position estimation, dedicated Kalman filter and altitude Kalman filter can be used together [21].Altitude Kalman filter, a linear Kalman filter is used to estimate altitude and vertical velocity by doing sensor fusion of acceleration and any altitude measurement sensor such as e.g.barometer or SONAR.Algorithm of the Kalman filter has several advantages.This is a statistical technique that adequately describes the random structure of experimental measurements.This filter can consider quantities that are partially or completely neglected in other techniques (such as the variance of the initial estimate of the state and the variance of the model error).It provides information about the quality of the estimation by providing the variance of the estimation error in addition to the best estimate.Kalman filter is well suited for online digital processing.Its recursive structure allows its real-time execution without storing observations or past estimates.EKF orientation estimation method is effective to provide accurate reconstructed trajectory in an indoor environment [27].EKF is also designed based on quaternions for heading estimation which is a combination of gyroscopes and accelerometers with better accuracy [28].

Result Analysis of Reviewed Estimation Approaches
It is observed that miniature inertial sensors based on biomechanical models and sensor fusion algorithm can accurately track human motion and finds unknown initial position [1].In case of estimating the position of a phone by sensor-fusion, a double integration is required to calculate position from acceleration [4].The INS algorithm needs large processing time.To reduce the effect of the errors, the linear acceleration method is complemented with additional functions: movement detection, walking speed limit and step detection.This improved the INS position estimation significantly.
To successfully estimate the orientation and position of a triaxial accelerometer on industrial robot, two basic steps are observed [6].First, the internal sensor parameters and the accelerometer with orientation of the sensor.Second, the position respect to the robot tool coordinate system.Here, there is no elimination of error.On the other hand, two-sensor 3D position estimation technique comprises steps such as, 3D position estimation, then error propagation for two sensors, Tylor series expansion for unknown values, then error propagation with Gaussian statistics to target the position.However, these steps can be avoided [8].
It is observed during calibration of IMUs for 3D orientation, spreading of error in absolute orientation is present [9].Besides in the time of raw data processing, the total error was split into component rotations about the global axis to further understand the sources of the orientation error.Each sensor needs to be mapped to the rigid body segment.In case of INS for pedestrians based on MEMS IMU, only accelerometer and gyroscope measurements were considered (no magnetometers required) [11].The sensor error model parameters were included in the state vector of an extended Kalman filter.This analytical approach was appropriated for foot stance detection at zero-velocity [11].
Comparison on Razor IMU and Xsens MTi IMU was drawn as well.It is also observed that the experimentation of various systems depicts different levels of non-consistency.Noise and slow drifting occurs in IMU based gait analysis [12].
Accuracy of only 0.3 percent is observed in indoor, outdoor experimentation of shoe-mounted inertial sensors based pedestrian tracking [13].Indoor environment localization technique for pedestrians did not remove errors present [15].
It required a dedicated experiment space and the walking range.
The Kalman filter combines all previous predicted values and information in implementing accelerometer sensor data for three state positions in dynamic system [19].It is very inexpensive since it completes the whole process without storing data.Besides, it uses simple loop equations.It is also mandatory to point out the independent Kalman gain and error covariance equation of actual observation.To obtain preliminary information of estimator performance, these parameters are easy to use.It is found that the algorithm is recursive and easy to implement because dimensional matrix cannot be changed with time.It is very useful for solving all problems in multi-state or multi-dimensional conditions.Journal of Computer and Communications The solution is obtained with less computational time in respect of large cost overhead in modeling.R\q value of 28 could be good solution to reduce errors in acceleration, velocity and position which are found from graph analysis [19].It is observed, Kalman filter based inertial motion capture system and UWB localization system for hybrid tracking incorporating measurements from the Gyp-syGyro-18 [20] in Ubisense system is not suitable, because Ubisense has small data frequency (5 -9 FPS) which causes extremely high latencies in industrial environments.Ubisense system having considerable amount of errors shouldn't be incorporated to the Kalman filter.GypsyGyro-18 gives accumulated errors in global translational measurements.GypsyGyro-18 represents an error of 0.56 m regarding the pre-established path.This error is due to the GypsyGyro-18 footstep extrapolation algorithm because it sometimes estimates wrongly when the feet meet the floor.That's why they need to use UWB localization system.The GypsyGyro-18 global translational error has been reduced to 0.14 m and the resulting data rate is equal to the GypsyGyro-18 frequency (30 Hz).It consists of two components: an inertial motion capture system (GypsyGyro-18) and an UWB localization system (Ubisense).The MoCap (Motion Capture) system can register movements of the operator's limbs with high precision, but global position of the operator in the environment is not determined with sufficient accuracy.On the other hand, use of dedicated Kalman filter and altitude Kalman filter together for orientation estimation and position estimation is achieved by a hardware platform [21].Kalman filter is then used for global pose estimation using multiple sensors.GPS and DGPS are used as well, which is not necessary.
A visual panorama tracker as additional input can communicate in limited distance.Also, use of barometer gives less accurate results.
It is shown that robustness against measurement error is found using EKF [29].EKFs have been implemented for all possible combinations using gyroscopes and accelerometers as control or measurement inputs [30].EKF with Taylor series expansion of observation matrix is used for superior performance [31].A comparison between Second-Order Extended Kalman Filter (SOEKF) based on multiplicative noise model and the random matrix approach i.e.EKF has been drawn.During the time of orientation changing, both SOEKF and EKF provides better performance [32].SOEKF Taylor series expansion matches more accurately with the exact moments compared to First-order Taylor series expansion [33].It is also observed that EKF is capable of incorporating different directions during movement when compared to invariant extended Kalman filter (IEKF) [34].

Experimental Discussion
Study of various position estimation approaches above exhibit that comprehensive and accurate position and localization estimation as well as efficient tracking comprises different degree of issues where there is scope of further improvements.The dimensions and joints of the character (creature) often do not exact-Journal of Computer and Communications ly match the subject (actor) being captured in miniature inertial sensors based human motion tracking using sensor fusion algorithm [1].Custom calibration of inertial measurement units for 3D orientation is valid for only 22 days, with error increasing everyday [9].Moreover, human knee being less close to a perfect hinge joint, gait analysis of IMU based joint angle measurement is not completely accurate [12].On the other hand, a large difference between altitudes occurs at the beginning due to slow transition oscillation for global pose estimation using multi sensor-fusion by Kalman filter approach [21].Lack of accuracy and drift over time is observed as well.
To compensate for the drift, existing sensor fusion systems use various types of external sensor, such as, GPS, ultrasonic beacons etc.In our approach, we propose to implement a single camera SLAM [20] [21] with controller smartphone's camera to obtain visual odometry of the handheld device in real-world environment.Lucas-Kanade sparse optical flow [35] is used to track good features between frames.We then calculate essential matrix to obtain rotation and translation information, which eliminates dependency on any external positioning system.Proposed approach is tested on Sony Xperia Z2 smartphone, which runs on Android OS 6.0.1, API level 23.Android API's Sensor Manager Class is used to make use of events and information, such as, sensor's type, time-stamp, accuracy, and sensor's data.Android API provides a 3D vector indicating acceleration along each device axis, excluding gravity.The smartphone used in the experiments consist of BMA2X20 Accelerometer, having a resolution of 0.019 m/s 2 and maximum range of 39.227 m/s 2 .
Accelerometers have very fast response but consists noise.Experimental data shows white noise propagation in raw linear acceleration over constant time domain with controller device in flat position.By using EKF, relatively smooth data is found as in Figure 1.During construction of EKF, we set three values.They are expectation value (0.001), process noise (1e-5) and measurement noise (0.0195).Data from linear acceleration of X, Y and Z-axis is sent to EKF to convert noisy data into smooth data.There is still some bias found when accelerometer data is sent after filtering.Computing filtered or smooth data by double integration, we get position estimation of the handheld device.However, an issue of rise in drift is observed.Bias increases the amount of drift error as well.
So, we accumulate long term average of bias for bias estimation.Then we calculate bias estimation before double integration to reduce drift.Inertial measurement sensors are MEMS based.Hence, flicker noise or 1/f noise is present.

Conclusion
It is observed from detailed analysis above; there is scope of state estimation (velocity, position and pose) by using accelerometer, gyroscope and magnetometer sensors and EKF which requires further study.The significance of this approach is to be able to get room scale canvas and introduce immersive experience to users.Extensive experimentation can be performed by using IMU of mobile device.Further analysis on estimating accurate drift and error can be performed as well.Monocular odometry to compute the accurate relation between IMU provided position and visual localization in real world co-ordinate system is another scope of possible study.We propose to use monocular visual inertial system integrated with accelerometer to reduce observed flicker noise in linear acceleration data.From monocular images, depth map can be created using concurrent inertial measurements and pose recovery.With Structure-from-Motion method we can estimate camera pose estimation and trajectory to get stable 3D coordinates for handheld device with reduced residual noise from IMU sensors.

Figure 1 .
Figure 1.Accelerometer linear acceleration data from X-axis: (a) Noisy data (b) Smooth data after extended Kalman filtering (arbitrary units).