Stable Path Planning for Reconfigurable Robots over Uneven Terrains