Some of that exists already, some doesn't. The trick is to have the right kind of sensors to do what you want it to do, and the right kind of maps loaded so it knows where it is.
If you can load the right level of DTED and CHUM, you don't really need much in the way of ground avoidance tech...