class_docstr: This class provides a very high level route plan.
class_docstr_tok: ["This","class","provides","a","very","high","level","route","plan","."]
docstr: This method places zero cost links in the topology graph
  representing availability of lane changes.
docstr_tok: ["This","method","places","zero","cost","links","in","the","topology","graph","representing","availability","of","lane","changes","."]
code: def _lane_change_link(self):
      """
      This method places zero cost links in the topology graph
      representing availability of lane changes.
      """
  
      for segment in self._topology:
          left_found, right_found = False, False
  
          for waypoint in segment["path"]:
              if not segment["entry"].is_junction:
                  next_waypoint, next_road_option, next_segment = (
                      None,
                      None,
                      None,
                  )
  
                  if (
                      waypoint.right_lane_marking
                      and waypoint.right_lane_marking.lane_change
                      & carla.LaneChange.Right
                      and not right_found
                  ):
                      next_waypoint = waypoint.get_right_lane()
                      if (
                          next_waypoint is not None
                          and next_waypoint.lane_type
                          == carla.LaneType.Driving
                          and waypoint.road_id == next_waypoint.road_id
                      ):
                          next_road_option = RoadOption.CHANGELANERIGHT
                          next_segment = self._localize(
                              next_waypoint.transform.location
                          )
                          if next_segment is not None:
                              self._graph.add_edge(
                                  self._id_map[segment["entryxyz"]],
                                  next_segment[0],
                                  entry_waypoint=waypoint,
                                  exit_waypoint=next_waypoint,
                                  intersection=False,
                                  exit_vector=None,
                                  path=[],
                                  length=0,
                                  type=next_road_option,
                                  change_waypoint=next_waypoint,
                              )
                              right_found = True
                  if (
                      waypoint.left_lane_marking
                      and waypoint.left_lane_marking.lane_change
                      & carla.LaneChange.Left
                      and not left_found
                  ):
                      next_waypoint = waypoint.get_left_lane()
                      if (
                          next_waypoint is not None
                          and next_waypoint.lane_type
                          == carla.LaneType.Driving
                          and waypoint.road_id == next_waypoint.road_id
                      ):
                          next_road_option = RoadOption.CHANGELANELEFT
                          next_segment = self._localize(
                              next_waypoint.transform.location
                          )
                          if next_segment is not None:
                              self._graph.add_edge(
                                  self._id_map[segment["entryxyz"]],
                                  next_segment[0],
                                  entry_waypoint=waypoint,
                                  exit_waypoint=next_waypoint,
                                  intersection=False,
                                  exit_vector=None,
                                  path=[],
                                  length=0,
                                  type=next_road_option,
                                  change_waypoint=next_waypoint,
                              )
                              left_found = True
              if left_found and right_found:
                  break
  
file_path: carla/PythonAPI/carla/agents/navigation/global_route_planner.py
imports: import math
  import numpy
  import networkx
  import carla
  from agents.navigation.local_planner import RoadOption
  from agents.tools.misc import vector
label_desc: Use image node_id 6 for calling the GlobalRoutePlanner obj's underlying member method code with example usage: obj._lane_change_link() without return types