Moving Obstacle Avoidance and Topology Recovery Based on Multi-agent Systems