The present invention relates to a device (100) comprising a haptic interface (110), input means (120), a first ranging sensor (130), a processor (140); wherein the input means (120) is configured to send an input signal to the processor (140) in response to an input from a user (102), wherein the first ranging sensor (130) is configured to measure a first distance dfrom the device (100) to one or more objects (134) in a first direction (132) and send a first measurement signal to the processor (140) indicating the first distance d, wherein the processor (140) is configured to operate in a first mode (M1) or in a second mode (M2) based on the input signal, wherein operating in the first mode (M1) comprises set a virtual cane length value C, and wherein operating in the second mode (M2) comprises send an activation signal to the haptic interface (110) if it is determined that the first distance dis less than the virtual cane length value C.