Vision navigation systems are pretty effective these days - 'avoid big rocks' seems like a straightforward use case for that. And clearly the landing systems would need to account for some degree of rough terrain. The wheeled drones go through a tremendous amount of testing of the various conditions they would encounter - a flying drone would go through the same engineering rigour before it was approved for the mission.
Also, I believe most of the activity of these devices is planned out well in advance, so you could even add human review to some of that process. It could take a short flight for a few high-rez pictures, land right near (or exactly) where it took off from, send the pics back to earth for review to pick it's next landing spot.