How to make AGV stop when there is an obstacles?

Hello I am new to VC and I am currently working out on follow me robot. I am facing the problem to make AGV to stop when there is a human passing by. How can I make it works?