{'fraction_non_alphanumeric': 0.029088558500323207, 'fraction_numerical': 0.005171299288946348, 'mean_word_length': 4.7473776223776225, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dense RGB-D-Inertial SLAM with Map Deformations

While dense visual SLAM methods are capable of estimating dense reconstructions of the environment, they suffer from a lack of robustness in their tracking step, especially when the optimisation is poorly initialised. Sparse visual SLAM systems have attained high levels of accuracy and robustness through the inclusion of inertial measurements in a tightly-coupled fusion. Inspired by this performance, we propose the first tightly-coupled dense RGB-D-inertial SLAM system. Our system has real-time capability while running on a GPU. It jointly optimises for the camera pose, velocity, IMU biases and gravity direction while building up a globally consistent, fully dense surfel-based 3D reconstruction of the environment. Through a series of experiments on both synthetic and real world datasets, we show that our dense visual-inertial SLAM system is more robust to fast motions and periods of low texture and low geometric variation than a related RGB-D-only SLAM system.


I. INTRODUCTION
Visual Simultaneous Localisation and Mapping (SLAM) has achieved a level of maturity that allows for integration into mobile robots. We can split respective algorithms into two broad categories: sparse landmark-based systems and dense or semi-dense systems. While sparse methods may not directly produce a map that is useful for robot navigation, pose estimation quality and robustness of state-of-the-art systems, such as [1] and [2], are typically very high. Even higher accuracy and robustness may be attained by the inclusion of inertial measurements in a tightly-coupled fusion. Inertial Measurement Units (IMUs) have become very cheap and are abundant in today's consumer electronic devices, therefore their use in visual SLAM has been widely adopted. Approaches are formulated either as filters e.g. [3]- [6] or as methods employing iterative minimisation, typically in a sliding window manner, such as [7]- [10]. Loosely-coupled approaches to visual-inertial fusion, such as [11]- [13] that separate out either the visual or inertial estimation part have also been proposed. These methods are popular due to their modularity, but disregard correlations in the state estimates, typically leading to lower accuracy and/or robustness.
Other research has focused on producing denser maps, a development enabled by ever more computational power and specifically the emergence of Graphics Processing Units (GPUs), as well as by novel sensors in the form of depth cameras (RGB-D cameras). Such systems typically employ direct photometric alignment of the image and/or Iterative Closest Point (ICP) alignment of the depth image to the Fig. 1: Tightly integrating IMU measurements into a dense RGB-D SLAM system leads to more accurate and robust tracking and 3D reconstruction compared with using visual information alone. The above surface reconstruction was captured despite periods of low texture and geometric variation. map in a tracking step; in a separate mapping step, new information is fused into the dense map representation. Examples using solely monocular cameras range from the fully dense DTAM [14] to LSD-SLAM [15], which reconstructs a semi-dense representation. RGB-D SLAM approaches that make use of depth cameras include KinectFusion [16] and other methods employing signed distance function-based volumetric mapping, such as [17]- [19]. Surfel-based mapping presents itself as an alternative enabling easier scalability in space and time: ElasticFusion [20], which our proposed work is based on, focuses on global map consistency by applying elastic map deformations upon loop closure.
Dense maps offer much more potential for safe robot navigation which we envisage to evolve into very general spatial perception with semantic understanding and tracking of dynamic objects in the future. As of now, however, visiononly SLAM, and dense SLAM using direct image alignment in particular, suffers from a lack of robustness in the tracking step when initialised too far from the "true" solution; in fact, the tracking optimisation may not converge at all in absence of sufficient texture and/or geometric variation in the depth channel. To address these shortcomings, inspired by the success of sparse visual-inertial systems, we advocate the integration of acceleration and rotation rate measurements into the tracking of a dense SLAM system. In principle, the tight integration of these complementary sensing modalities should provide robustness in rapid motion, low texture and flat walls. Furthermore, the inclusion of an IMU renders the gravity direction observable, which not only improves map accuracy due to bounded absolute inclination error, but may also be of paramount importance for robot control, most prominently drones.
There have been a few recent examples of dense visualinertial systems: both [21] and [22] present loosely-coupled approaches, with the former using the integrated IMU data as a prediction step in a filter to estimate the transformation between image pairs, and the latter fusing relative poses generated by inertial and stereo camera measurements in a manner similar to a pose graph. A tightly-coupled semi-dense monocular visual-inertial odometry system is presented in [23]. Unlike other pure monocular odometry systems, it is able to use the inertial data to remove scale ambiguity. Their system uses a semi-dense approach for tracking and, in a separate thread, estimates a fully dense map below frame rate using a piecewise planar prior. Another example of a semidense visual-inertial odometry system is described in [24]. This system is implemented within the stereo LSD-SLAM framework [25]. Through a series of experiments, they demonstrate that their tightly-coupled approach outperforms both vision-only and loosely-coupled approaches. While the system is closely related to ours, we propose a more mapcentric, fully dense approach that additionally considers a depth channel and performs map optimisation compliant with gravity alignment.
In this paper, we extend the RGB-D SLAM system Elas-ticFusion [20] with tightly-coupled IMU integration, which is capable of more accurate and robust fully dense mapping. Please see Figure 1 for an example map output. More specifically, we make the following contributions: • In the tracking step, we simultaneously estimate the camera pose, velocity, IMU biases and gravity direction from an RGB-D camera and IMU by minimising a joint photometric, geometric, and inertial energy functional. • Concerning the mapping, we propose a system that constructs a globally consistent, fully dense surfel-based 3D reconstruction of the environment. The map is optimised not through a pose graph, but by applying non-rigid space deformations using a sparse deformation graph.
We propose an addition to the deformation energy that ensures consistency with the observable gravity direction. • Through experiments on both synthetic and real world datasets, we demonstrate the benefits of our approach. It performs well under aggressive motion, fast rotations, and under low texture and geometric variation. We demonstrate trajectory and map reconstruction accuracy higher or on-par with an RGB-D-only ElasticFusion. • We emphasise that the system maintains real-time capability while running on a GPU. Unlike [23] and [24], which achieve real-time performance on a CPU, our system constructs a fully dense map at frame rate. • To the best of our knowledge, we hereby present the first tightly-coupled dense RGB-D-inertial SLAM system. The remainder of this paper is organised as follows: we start with an overview of notation employed in Section II and of the approach as such in III. We then describe the method concerning tracking in IV and mapping in V followed by extensive results in VI.

II. NOTATION
Throughout this work we will employ the following notation: a reference frame A is denoted F − → A , with vectors expressed in it denoted as A p. The position vector from the origin of The homogeneous transformation matrix that transforms homogeneous points from F − → B to F − → A is written as T AB . The corresponding rotation is represented by a Hamiltonian unit quaternion, q AB . In order to refer to the homogeneous coordinates of a coordinate vector p we will use the italic notation p.
Four different coordinate frames will be used in this work: • F − → W , the world frame in which the global model is expressed. This frame corresponds with the initial camera frame. • F − → I , the inertial frame that is aligned with gravity and shares an origin with F − → W . • F − → C , the camera frame in which the RGB-D data is observed. • F − → S , the sensor frame in which the IMU data is observed.

III. SYSTEM OVERVIEW
Our system directly builds upon the vision-only dense RGB-D tracking and mapping approach of ElasticFusion [20]. Like ElasticFusion, our approach performs the tracking and mapping in separate steps. In the tracking step, a joint photometric, geometric and inertial energy functional is constructed. Please see Figure 2 for a comparison of the factorgraph representation of the underlying tracking optimisation problem in RGB-D-only and RGB-D-inertial ElasticFusion. Whereas ElasticFusion combined the photometric and geometric terms based on a tuning parameter λ, we combine the terms based on the covariances associated with the measurement noise. A nonlinear optimisation formulation is then used to simultaneously estimate the camera pose, velocity, IMU biases and gravity direction. Unlike the original ElasticFusion which only estimated the current camera pose, our system estimates the states associated with both the current and previous camera frames. After the optimisation the states related to the previous frame are marginalised and the remaining current state is used as a prior for the next time step.
In the mapping step, a fully dense surfel-based surface representation is constructed from the camera data and estimated poses obtained from the tracking step. The map is kept globally consistent by applying non-rigid space deformations through a sparse deformation graph. We extend the deformation energy formulation proposed by ElasticFusion to ensure consistency with the observable gravity direction.

IV. TRACKING A. States & Local Parameterisation
At the arrival of each new camera frame, we estimate the current state, x 1 , while simultaneously refining the previous state, x 0 . The system state is comprised of the camera position in the world frame W r C , the camera orientation q W C , the velocity of the IMU in the inertial frame I v IS , the biases of the gyroscopes b g and accelerometers b a , and the orientation of the world frame in the inertial frame q IW . Therefore the system state x for a specific time instance is given by: While only two degrees of freedom are required to express the gravity direction in the world frame, for simplicity, we use a 3D implementation with gauge freedom. We did not observe any issues related to this formulation. The system state exists on a manifold and so is updated by a local perturbation δx in the tangent space through the operator, such that x =x δx around a referencex. For W r C , I v IS , b g and b a , the operator is equivalent to standard vector addition. For q W C and q IW , a combination of the group operator (quaternion multiplication) and exponential map is used (q δα = exp(δα) ⊗ q). This results in the following minimal local coordinate representation: Similarly, a operator can be introduced to compute the difference between two systems states. For regular vector space quantities this corresponds to standard subtraction. For orientations an inverse of the above can be constructed (p q = exp −1 (p ⊗ q −1 )).

B. Dense Photometric & Geometric Alignment
The RGB-D subsystem of our approach combines dense per-pixel photometric alignment with ICP point-to-plane geometric alignment. The photometric alignment error, e RGB,u for pixel u in the current image is the intensity difference between the transformed previous and current images: where I * (·) is a scalar function that returns the intensity value of a given pixel, π(·) is the projection and dehomogenisation function that maps a 3D point onto the image plane, and ρ(u, d) is the back-projection function that returns a homogeneous 3D point for pixel u with a depth d. K is the camera intrinsics matrix, containing the focal lengths and principal point of the camera. The geometric alignment error uses a point-to-plane ICP technique and computes the signed distance between a point p k projected from the depth measurement k as viewed from the current camera pose and a corresponding point in the global model:

C. Inertial Integration
For the formulation of the IMU measurement error term we adopt the approach of [9], extending it to include the preintegration technique described by [10]. The IMU measurements are integrated numerically between the previous and current camera frames. The final IMU error term is given by: wherex 1 is the prediction of the current state by integrating the IMU measurements onto the previous state.

D. Optimisation
The RGB-D-inertial tracking problem is solved using a joint cost function c track that contains the weighted photometric alignment, geometric alignment and inertial terms: where W RGB , W ICP,k , and W IMU are the inverse covariance (matrices) associated with the respective measurement uncertainties, and H * and b * are priors obtained through the marginalisation step. The cost function is minimised using a Gauss-Newton iterative method with a three level coarse-to-fine pyramid scheme. We omit the Jacobians for readability and space constraints. After each iteration, the current and previous states are updated using the operator.

E. Partial Marginalisation & Fixation of Variables
The equations for the Gauss-Newton system are constructed from the Jacobians, error terms and information relating to the current and previous states, taking the form: After the current and previous states are updated, we marginalise out the previous state using the Schur-Complement: The resulting H * and b * information is used as a prior in the next optimisation step. This partial marginalisation fixes the linearisation point, but with each iteration in the subsequent optimisation scheme, the linearisation point changes. Instead of relinearising at each step, we apply a first-order correction, ∆x, based on the difference between the new and old linearisation points as is commonly done in the literature [9] [24]: V. MAPPING Like the original ElasticFusion, the map in our formulation is split into active and inactive areas [20]. The active map is the area most recently observed and is where the tracking and fusing takes place. If a segment of the active map is not observed for a period of time, δ t , it becomes inactive. We keep the map globally consistent by attempting to match the currently observed portion of the active map with the inactive map. If a match is detected, the loop is closed by applying non-rigid space deformations through a sparse deformation graph. A deformation graph is a set of nodes, G l , that are embedded in the global model, each with a position, G l g , and a set of neighboring nodes, G n ∈ N (G l ). Each deformation node stores a Euclidean transformation as a rotation, G l R , and a translation, G l t , that is used to elastically deform surfels in the map from a source position Q s to a destination position Q d through a deformation function, φ(·), defined in [20]. This affine transformation is determined by minimising a cost function. In the original ElasticFusion, the cost function consists of five terms. The first encourages rigidity in the deformation: The second encourages smoothness in the deformation: The third minimises the distance of each point from the desired deformation: The fourth constrains the inactive areas of the map such that the active map is being deformed into the inactive map: The fifth term is only applied to global deformations, and is used to prevent previous registrations, R, from being pulled apart by future global loop closures: As matches between the active and inactive areas of the map are determined only by the RGB-D subsystem, we include a sixth cost term in our formulation to constrain the graph from deforming the map out of alignment with gravity: where W g denotes the acceleration due to gravity represented in vision-world frame F − → W . Keeping the parameter choices the same as ElasticFusion, the total cost function for local loop closures is given by: (16) and the total cost for the global loop closures is given by: with ω f = 1, ω r = 10, and ω c = ω i = 100.

VI. RESULTS
We evaluate our system in terms of trajectory estimation and reconstruction accuracy on both synthetic and real world datasets. We adapt the living room sequences of the ICL-NUIM dataset [28] for the experiments on synthetic data. For the real world experiments, we recorded our own datasets along with ground truth poses from a Vicon motion capture system. The synthetic dataset consists of slow, smooth trajectories usually required for dense visual SLAM. The real world dataset contains a mixture of slow trajectories, aggressive motions and sequences with low texture and geometric information where vision-only systems tend to struggle.
We consider two metrics when examining the performance of the system: the absolute trajectory (ATE) root-meansquare error (RMSE) described in [29], and for reconstruction error, the mean distance from each point in the reconstruction to the nearest surface in the aligned ground truth model. The ATE RMSE is calculated for all sequences, but the reconstruction error is only available for the synthetic dataset. As the behavior of the loop closure mechanism is non-deterministic, we ran each test 10 times and took the average result. Tests where either system had lost tracking are denoted by brackets in the tables.
Through these experiments, we show that our dense RGB-D-inertial SLAM system performs at least as well as the RGB-D-only system on "easier" trajectories where the problem is well constrained by the visual data alone, but is much more robust when facing sequences with fast motions or little photometric and geometric variation.

A. Synthetic Data
We evaluate both the trajectory estimation and surface reconstruction accuracy of our system on a modified version of the living room sequences in the ICL-NUIM dataset. The ICL-NUIM dataset is a benchmark that provides ground truth poses as well as a 3D model with which to evaluate reconstructions of RGB-D SLAM systems. The dataset does not come with inertial data, however, so in a manner similar to [30], we fit splines to the ground truth poses to simulate continuous trajectories. IMU measurements are then generated along these trajectories using the model described in [31] and the noise parameters given in Table I. However, due to the non-smooth trajectories of the dataset, we needed to sample every 10th frame of the ground truth trajectories when fitting the splines. This resulted in the new ground truth poses being close to but not exactly the same as those in the original dataset. Therefore, we rendered the images at these new poses using POV-Ray and applied the same noise models to the images as those in the original dataset.
Since the entire ground truth states are known for the synthetic dataset, we are able to demonstrate that our system can accurately track the velocity and IMU biases. For example, the error in the velocity and bias estimates for Sequence LR0, provided in Fig. 3, quickly converges to zero.
We compared the performance of the RGB-D-inertial and RGB-D-only versions of our system on each of the four living room sequences of the modified ICL-NUIM dataset. The results for the ATE RMSE are given in Table II and for  the reconstruction error in Table III. Although slow, some of the sequences in the modified ICL-NUIM dataset are still difficult for dense SLAM systems to follow, particularly the last sequence. In this sequence, the camera moves slowly along a wall providing little photometric or geometric variation. The results of the original ElasticFusion were not obtained using the same set of inter- Fig. 3: Error in the velocity and bias estimates when compared to the ground truth values in synthetic dataset LR0. Our system is able to converge to and track the correct values.  nal parameters for each sequence in the ICL-NUIM dataset. However, in this work, to showcase the robustness of our system and to avoid overfitting to a particular sequence, the default set of parameters was used across all datasets. As a result, the RGB-D-only version of ElasticFusion now fails on this sequence. The RGB-D-inertial system, however, is able to use the inertial data to get through the difficult section of the sequence and successfully reconstructs the scene. The RGB-D-inertial system performs approximately as well as the RGB-D-only system on the three easier sequences.

B. Real World Data
While the synthetic data showed that the RGB-D-inertial system is capable of performing at least as well as the RGB-D-only system on slow, smooth trajectories, the real strength of visual-inertial systems is their robustness to aggressive motions and sequences with little photometric or geometric information. To test this, a new dataset of 21 sequences was collected using the Intel RealSense ZR300 visual-inertial sensor. This sensor captures aligned RGB and depth images as well as inertial measurements. The camera intrinsics, as well as the transformation between the camera and IMU, T CS , was obtained using the Kalibr calibration system [32]. To see how our system would perform under different scenarios, a number of different types of datasets were captured. Sequences 1-3 are slow, smooth trajectories that typical RGB-D SLAM systems could handle. Sequences 4-6 are also slow and smooth, but with a large loop closure. Sequences 7-9 have slightly faster trajectories, and sequences 10-12 have very aggressive trajectories but continue to map the same area, allowing the SLAM system to keep tracking against a previously built up map. Sequences 13-15 are also aggressive trajectories, but include a quick rotation into an unmapped area of the scene. Sequences 16-18 are slow trajectories, but pass close to a white wall such that the RGB-D data provides little photometric or geometric information. Sequences 19-21 are slow, smooth trajectories, but much longer than the other sequences, on the order of 15-20m.
For each sequence, a ground truth trajectory was captured using the Vicon motion capture system. As explained in [29], these ground truth poses cannot be used to create a reliable ground truth scene reconstruction through depth image projection, as very small errors in the pose can result in very large errors in the reconstruction. For this reason, we do not calculate the reconstruction error for these sequences, only the ATE RMSE.
1) RGB-D-Only vs. RGB-D-Inertial: For each of the 21 sequences we compared the performance of the RGB-Dinertial system with the RGB-D-only system. The results of these experiments are presented in Table IV. In all but  we generally achieve a higher degree of map consistency through the inclusion of inertial measurements in the tracking. While loop closure was enabled, the first zoom-in (row second from the bottom) shows that ElasticFusion failed to detect and apply a larger loop closure (in both cases); but it also shows smaller drift as a starting point before potential loop closures. The second zoom-in (bottom row) highlights in more detail the generally higher map consistency with inertial integration.
are not allowed). We compared this on a sample sequence from five of the different categories (we excluded the quick rotation and low texture scenes due to their difficulty). The results of these tests are shown in Table V. In all cases, the closed loop version performs at least as well as the open loop version.
3) Drift Analysis: In order to examine the relative contributions of the gyroscopes and accelerometers, we test the system on a number of sequences where the accelerometer related residuals are ignored. Fig. 6 shows the position error as a function of the distance traveled for Sequence 20, comparing RGB-D-only to RGB-D-and-gyroscopes-only to the full RGB-D-inertial system. As this figure shows, most of the gain in accuracy comes from the gyroscopes. This Fig. 6: Relation between accumulated position error and travelled distance for Sequence 20 with three different setups: no IMU, gyroscope only, and full IMU (gyroscope + accelerometer). We observe that most of the accuracy is gained from the integration of the gyroscopes. While the accelerometers do not significantly improve the accuracy of the system, their integration can contribute to the reliability of the system.  is confirmed by the results for the long sequences in Table  VI. Over such a long sequence, the gyroscopes-only setup can outperform the full IMU due to the high noise levels of the accelerometers. The necessity of the accelerometers, however, is shown by the low texture sequences in Table VI. As the camera passes over the white wall, the gyroscopeonly system fails because without visual input the relative position is no longer constrained.

VII. CONCLUSION
We have presented what is, to the best of our knowledge, the first real-time tightly-coupled dense RGB-D-inertial SLAM system. In the tracking step, it minimises a combined photometric, geometric and inertial energy functional to simultaneously estimate the camera pose, velocity, IMU biases and gravity direction. In the mapping step, our system constructs a fully dense 3D reconstruction of the environment which is not only globally consistent, but gravity aligned due to the addition of an inertial deformation energy applied to the deformation graph.
We show through a series of experiments on both synthetic and real world datasets that our RGB-D-inertial system performs at least as well as the RGB-D-only version of our system on slow, smooth trajectories, but is much more robust to aggressive motions and a lack of photometric and geometric variation.