parameters: (self)
docstring: 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 with the following attributes
  
          - entry (carla.Waypoint): waypoint of entry point of road segment
          - entryxyz (tuple): (x,y,z) of entry point of road segment
          - exit (carla.Waypoint): waypoint of exit point of road segment
          - exitxyz (tuple): (x,y,z) of exit point of road segment
          - path (list of carla.Waypoint):  list of waypoints between entry to exit, separated by the resolution
docstring_summary: 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 with the following attributes
docstring_tokens: 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 with the following attributes
function: def _build_topology(self):
          """
          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 with the following attributes
  
          - entry (carla.Waypoint): waypoint of entry point of road segment
          - entryxyz (tuple): (x,y,z) of entry point of road segment
          - exit (carla.Waypoint): waypoint of exit point of road segment
          - exitxyz (tuple): (x,y,z) of exit point of road segment
          - path (list of carla.Waypoint):  list of waypoints between entry to exit, separated by the resolution
          """
          self._topology = []
          # Retrieving waypoints to construct a detailed topology
          for segment in self._wmap.get_topology():
              wp1, wp2 = segment[0], segment[1]
              l1, l2 = wp1.transform.location, wp2.transform.location
              # Rounding off to avoid floating point imprecision
              x1, y1, z1, x2, y2, z2 = np.round([l1.x, l1.y, l1.z, l2.x, l2.y, l2.z], 0)
              wp1.transform.location, wp2.transform.location = l1, l2
              seg_dict = dict()
              seg_dict['entry'], seg_dict['exit'] = wp1, wp2
              seg_dict['entryxyz'], seg_dict['exitxyz'] = (x1, y1, z1), (x2, y2, z2)
              seg_dict['path'] = []
              endloc = wp2.transform.location
              if wp1.transform.location.distance(endloc) > self._sampling_resolution:
                  w = wp1.next(self._sampling_resolution)[0]
                  while w.transform.location.distance(endloc) > self._sampling_resolution:
                      seg_dict['path'].append(w)
                      w = w.next(self._sampling_resolution)[0]
              else:
                  seg_dict['path'].append(wp1.next(self._sampling_resolution)[0])
              self._topology.append(seg_dict)
function_tokens: def _build_topology ( self ) : self . _topology = [ ] # Retrieving waypoints to construct a detailed topology for segment in self . _wmap . get_topology ( ) : wp1 , wp2 = segment [ 0 ] , segment [ 1 ] l1 , l2 = wp1 . transform . location , wp2 . transform . location # Rounding off to avoid floating point imprecision x1 , y1 , z1 , x2 , y2 , z2 = np . round ( [ l1 . x , l1 . y , l1 . z , l2 . x , l2 . y , l2 . z ] , 0 ) wp1 . transform . location , wp2 . transform . location = l1 , l2 seg_dict = dict ( ) seg_dict [ 'entry' ] , seg_dict [ 'exit' ] = wp1 , wp2 seg_dict [ 'entryxyz' ] , seg_dict [ 'exitxyz' ] = ( x1 , y1 , z1 ) , ( x2 , y2 , z2 ) seg_dict [ 'path' ] = [ ] endloc = wp2 . transform . location if wp1 . transform . location . distance ( endloc ) > self . _sampling_resolution : w = wp1 . next ( self . _sampling_resolution ) [ 0 ] while w . transform . location . distance ( endloc ) > self . _sampling_resolution : seg_dict [ 'path' ] . append ( w ) w = w . next ( self . _sampling_resolution ) [ 0 ] else : seg_dict [ 'path' ] . append ( wp1 . next ( self . _sampling_resolution ) [ 0 ] ) self . _topology . append ( seg_dict )