  Learning-based visual odometry and SLAM methods demonstrate a steady
improvement over past years. However, collecting ground truth poses to train
these methods is difficult and expensive. This could be resolved by training in
an unsupervised mode, but there is still a large gap between performance of
unsupervised and supervised methods. In this work, we focus on generating
synthetic data for deep learning-based visual odometry and SLAM methods that
take optical flow as an input. We produce training data in a form of optical
flow that corresponds to arbitrary camera movement between a real frame and a
virtual frame. For synthesizing data we use depth maps either produced by a
depth sensor or estimated from stereo pair. We train visual odometry model on
synthetic data and do not use ground truth poses hence this model can be
considered unsupervised. Also it can be classified as monocular as we do not
use depth maps on inference. We also propose a simple way to convert any visual
odometry model into a SLAM method based on frame matching and graph
optimization. We demonstrate that both the synthetically-trained visual
odometry model and the proposed SLAM method build upon this model yields
state-of-the-art results among unsupervised methods on KITTI dataset and shows
promising results on a challenging EuRoC dataset.
