def plot_region(region, color): "Plot passage region" for seg in region.segment: center_pt = debug_topo.plot_central_curve_with_s_range( g_central_curve_dict[seg.id], seg.start_s, seg.end_s, color=color) debug_topo.draw_id(center_pt, seg.id, 'r') g_center_point_dict[seg.id] = center_pt print 'Plot lane id: %s, start s: %f, end s: %f' % ( seg.id, seg.start_s, seg.end_s)
def plot_region(region, color): "Plot passage region" for seg in region.segment: center_pt = debug_topo.plot_central_curve_with_s_range( g_central_curve_dict[seg.id], seg.start_s, seg.end_s, color=color) debug_topo.draw_id(center_pt, seg.id, 'r') g_center_point_dict[seg.id] = center_pt print 'Plot lane id: %s, start s: %f, end s: %f' % (seg.id, seg.start_s, seg.end_s)
def plot_route(lanes, central_curve_dict): """Plot route result""" plt.close() plt.figure() for lane in lanes: lane_id = lane['id'] if lane['is virtual']: color = 'red' else: color = 'green' mid_pt = debug_topo.plot_central_curve_with_s_range( central_curve_dict[lane_id], lane['start s'], lane['end s'], color=color) debug_topo.draw_id(mid_pt, lane_id, 'y') plt.gca().set_aspect(1) plt.title('Routing result') plt.xlabel('x') plt.ylabel('y') plt.legend() plt.draw()