def get_shortest_path_distance_old(planner, origin, destination):
    """
    This function calculates the distance of the shortest path connecting
    origin and destination using A* search with distance heuristic.
    Args:
        planner: Global route planner
        origin (tuple): Tuple containing x, y co-ordinates of start position
        destination (tuple): (x, y) co-coordinates of destination position

    Returns:
        The shortest distance from origin to destination along a feasible path

    """
    graph, _ = planner.build_graph()
    path = planner.path_search(origin, destination)
    distance = 0.0
    if len(path) > 0:
        first_node = graph.nodes[path[0]]['vertex']
        distance = planner.distance(origin, first_node)
        for i in range(1, len(path)):
            distance += planner.distance(graph.nodes[path[i - 1]]['vertex'],
                graph.nodes[path[i]]['vertex'])
    return distance
