Obstacle avoidance using I2C Ez or RPLidar

I am making obstacle avoidance rover.
Stop when find obstacles, move when obstacles disappear
How can I set it to stop instead of avoiding it?

Here’s the wiki page for object avoidance. I think in Rover-3.5 it will actually stop in all modes if setup correctly.