  Although haptic sensing has recently been used for legged robot localization
in extreme environments where a camera or LiDAR might fail, the problem of
efficiently representing the haptic signatures in a learned prior map is still
open. This paper introduces an approach to terrain representation for haptic
localization inspired by recent trends in machine learning. It combines this
approach with the proven Monte Carlo algorithm to obtain an accurate,
computation-efficient, and practical method for localizing legged robots under
adversarial environmental conditions. We apply the triplet loss concept to
learn highly descriptive embeddings in a transformer-based neural network. As
the training haptic data are not labeled, the positive and negative examples
are discriminated by their geometric locations discovered while training. We
demonstrate experimentally that the proposed approach outperforms by a large
margin the previous solutions to haptic localization of legged robots
concerning the accuracy, inference time, and the amount of data stored in the
map. As far as we know, this is the first approach that completely removes the
need to use a dense terrain map for accurate haptic localization, thus paving
the way to practical applications.
