We introduce a general self-supervised approach to predict the future outputs\nof a short-range sensor (such as a proximity sensor) given the current outputs\nof a long-range sensor (such as a camera); we assume that the former is\ndirectly related to some piece of information to be perceived (such as the\npresence of an obstacle in a given position), whereas the latter is\ninformation-rich but hard to interpret directly. We instantiate and implement\nthe approach on a small mobile robot to detect obstacles at various distances\nusing the video stream of the robot's forward-pointing camera, by training a\nconvolutional neural network on automatically-acquired datasets. We\nquantitatively evaluate the quality of the predictions on unseen scenarios,\nqualitatively evaluate robustness to different operating conditions, and\ndemonstrate usage as the sole input of an obstacle-avoidance controller. We\nadditionally instantiate the approach on a different simulated scenario with\ncomplementary characteristics, to exemplify the generality of our contribution.\n