Abstract. Existing geographic routing algorithms for sensor networks are mainly concerned with finding a path toward a destination, without explicitly addressing the impact of obstacles on the routing performance. When the size of the communication voids is increased, they might not scale well with respect to the quality of paths, measured in terms of hop count and path length. This paper introduces a routing algorithm with early obstacle detection and avoidance. The routing decisions are based on path optimality evaluation, made at the node level, gradually over time. We implement our algorithm and evaluate different aspects: message delivery performance, topology control overhead and algorithm convergence time. The simulation findings demonstrate that our algorithm manages to improve significantly and quite fast the path quality while keeping the computational complexity and message overhead low. The algorithm is fully distributed, and uses only limited local network knowledge.