Most drones (e.g. DJI) are fitted with a mix of GPS, solid-state accelerometers and gyros, barometric altimeters and multiple cameras for object avoidance and visual odometry. They really are quite sophisticated and relatively inexpensive.
Quite shocking that it is possible to purchase technology like this without regulation or licence.