As the Mavic flies, dual ahead and downward vision sensors measure the distance between by itself and obstructions by taking shots from all 4 cameras and using the information to make a 3D map that tells it precisely where obstacles are. There also are constraints on where you can fly: https://flenzy.store/commercial-electronics/