Robot programming with a depth sensor

Hi

I’m a software engineer and I have experience in realtime and algorithms.

I would like to know how could I program a depth sensor of a robot to move from X to Y.

Kindly specify in details…

(can be a state machine,text ,a program or else)

Thanks