A Learning-Free Method for Locomotion Mode Prediction by Terrain Reconstruction and Visual Inertial Odometry