本文整理匯總了Python中visualizer.Visualizer.nh_trace_path方法的典型用法代碼示例。如果您正苦於以下問題:Python Visualizer.nh_trace_path方法的具體用法?Python Visualizer.nh_trace_path怎麽用?Python Visualizer.nh_trace_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類visualizer.Visualizer
的用法示例。
在下文中一共展示了Visualizer.nh_trace_path方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: CollisionDetector
# 需要導入模塊: from visualizer import Visualizer [as 別名]
# 或者: from visualizer.Visualizer import nh_trace_path [as 別名]
obstcls = vizer.define_obstacles()
cd = CollisionDetector(obstcls)
obstcls_aabb = cd.compute_AABB()
# Plan path using q_init and obstacles
planner = PathPlanner(q_init, cd)
start = time.time()
rrt_tree = planner.nh_build_rrt(K=100, epsilon=40)
end = time.time()
print('Time taken: %f' % (end - start))
q_nearest, dist, _ = planner.nearest_neighbour(q_goal, np.array(rrt_tree.vertexMap.keys()))
# Non Holonomic
vizer.nh_plot_graph(rrt_tree, q_init)
vizer.nh_trace_path(rrt_tree.getVertex(q_nearest))
a,b,c,d = planner.nh_reach_goal(q_nearest, q_goal)
final_list = planner.append_t1_m_t2(a, b, c)
vizer.plot_points(final_list, vizer.YELLOW, 3)
if not planner.nh_obstacle_free(final_list):
print 'Final Maneuve collide with obstacle'
vizer.draw_square(q_init)
vizer.draw_square(q_goal, color=vizer.RED)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()