本文整理汇总了Python中map.Map.draw_lanes方法的典型用法代码示例。如果您正苦于以下问题:Python Map.draw_lanes方法的具体用法?Python Map.draw_lanes怎么用?Python Map.draw_lanes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map.Map
的用法示例。
在下文中一共展示了Map.draw_lanes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import draw_lanes [as 别名]
def __init__(self, ax, map_file=None):
self.ax = ax
self.map_width = 20
if map_file is not None:
map = Map()
map.load(map_file)
map.draw_lanes(ax, False, [])
self.path_lines = []
self.path_lines_size = 3
colors = ['b', 'g', 'r', 'k']
for i in range(self.path_lines_size):
line, = ax.plot(
[0], [0],
colors[i % len(colors)],
lw=3 + i * 3,
alpha=0.4)
self.path_lines.append(line)
self.vehicle_position_line, = ax.plot([0], [0], 'go', alpha=0.3)
self.vehicle_polygon_line, = ax.plot([0], [0], 'g-')
self.init_point_line, = ax.plot([0], [0], 'ro', alpha=0.3)
self.set_visible(False)
ax.set_title("PLANNING PATH")
示例2: id
# 需要导入模块: from map import Map [as 别名]
# 或者: from map.Map import draw_lanes [as 别名]
"-sl", "--showlaneids", action="store_const", const=True,
help="Show all lane ids in map")
parser.add_argument(
"-ss", "--showsignals", action="store_const", const=True,
help="Show all signal light stop lines with ids in map")
parser.add_argument(
"-l", "--laneid", nargs='+',
help="Show specific lane id(s) in map")
parser.add_argument(
"--loc", action="store", type=str, required=False,
help="Specify the localization pb file in txt format")
args = parser.parse_args()
map = Map()
map.load(args.map)
lane_ids = args.laneid
if lane_ids is None:
lane_ids = []
map.draw_lanes(plt, args.showlaneids, lane_ids)
if args.showsignals:
map.draw_signal_lights(plt)
if args.loc is not None:
localization = Localization()
localization.load(args.loc)
localization.plot_vehicle(plt)
plt.axis('equal')
plt.show()