Пример симулятора Карлы не работает

Я попытался запустить automatic_control.py из примеров carla, но когда я установил --agent arg в значение "Basic", программа выполняется, но окно carla ничего не показывает. Вместо этого, когда я устанавливаю --agent arg в "Роуминг", он работает хорошо. Я пытался решить проблему, и я обнаружил, что сбой находится в функции с именем "get_topology".

    def get_topology(self):
    """
    Accessor for topology.
    This function retrieves topology from the server as a list of
    road segments as pairs of waypoint objects, and processes the
    topology into a list of dictionary objects.

    return: list of dictionary objects with the following attributes
            entry   -   (x,y) of entry point of road segment
            exit    -   (x,y) of exit point of road segment
            path    -   list of waypoints separated by 1m from entry
                        to exit
            intersection    -   Boolean indicating if the road segment
                                is an intersection
    """
    topology = []
    # Retrieving waypoints to construct a detailed topology
    for segment in self._wmap.get_topology():
        x1 = segment[0].transform.location.x
        y1 = segment[0].transform.location.y
        x2 = segment[1].transform.location.x
        y2 = segment[1].transform.location.y
        seg_dict = dict()
        seg_dict['entry'] = (x1, y1)
        seg_dict['exit'] = (x2, y2)
        seg_dict['path'] = []
        wp1 = segment[0]
        wp2 = segment[1]
        seg_dict['intersection'] = True if wp1.is_intersection else False
        endloc = wp2.transform.location
        w = wp1.next(1)[0]
        while w.transform.location.distance(endloc) > 1:
            x = w.transform.location.x
            y = w.transform.location.y
            seg_dict['path'].append((x, y))
            w = w.next(1)[0]

        topology.append(seg_dict)
    return topology

Карла 0,9,5 на окнах 10.

  • Почему это не работает?
  • Как я могу решить это?

0 ответов

Другие вопросы по тегам