the snippet in the method Observer()in graph_observer.py:
# the distance between the ego agent and boundaries of the road
distance = []
num_lines = len(list(world.ego_agent.road_corridor.lane_corridors))
distance.append(Distance(world.ego_agent.GetPolygonFromState(world.ego_agent.state),
world.ego_agent.road_corridor.lane_corridors[num_lines-1].right_boundary))
distance.append(-Distance(world.ego_agent.GetPolygonFromState(world.ego_agent.state),
world.ego_agent.road_corridor.lane_corridors[0].left_boundary))
distance.sort(key=abs)
obs[-2] = self._normalize_value(distance[0], [0, 3*num_lines])
I want to know a little about the snippet:
does world.ego_agent.road_corridor simply hold the road that ego agent is currently in or all roads in the map?
does barkhave an interface to provide the number of lanes of the road ego agent is currently in?
the snippet in the method
Observer()
ingraph_observer.py
:I want to know a little about the snippet:
world.ego_agent.road_corridor
simply hold the road that ego agent is currently in or all roads in the map?bark
have an interface to provide the number of lanes of the road ego agent is currently in?