>>2443759A drone is basically just a normal microcontroller (think Arduino) that runs a looping program (called a PID loop) that monitors a gyro/accelerometer and issues corrections to motor speed. You can add more sensors to that loop however you like; GPS, LIDAR, camera, magnetic compass, pressure altitude, etc etc etc
They all do basically the same thing; your code watches input from the sensor and issues instructions to the speed controllers, which simply control how much voltage is being fed into each motor.
Tree evasion is a nontrivial task but there are commercially available drones that can manage it, so it's definitely an achievable goal.
If you would like to know more, /diy/ has a reliably high quality drone thread.
For your application, the real problem is going to be aircraft range. Flight times for anything small enough to navigate in a forest are measured in minutes and that goes down rapidly when you start strapping on gimbals, LIDAR arrays and whatnot.