Questions about how to avoid obstacles without gps

I am using Pixhawk 2.1 , copter 4.0.
I want to make a drone that goes around at random while avoiding obstacles like a robot vacuum cleaner in a building without GPS.

I know how to use BENDY RULER in Auto mode.
But it has to move like a robot vacuum cleaner. not moving around with a waypoint

I think It will be possible if it keep going forward with bendy ruler
Is this possible? If not, please let me know how else…

Thank you

Hi,I am a newer,I am confused about the avoid obstacles function,I want to make two Boats and avoid conllision by each other.Could I realize the avoid conllision only by GPS?
I found AVOID_MARGIN、AVOID_BEHAVE and PRX_TYPE parameters.but I still cannot confirm the avoid conllision function only by GPS