本文整理汇总了Python中visualizer.Visualizer.draw_square方法的典型用法代码示例。如果您正苦于以下问题:Python Visualizer.draw_square方法的具体用法?Python Visualizer.draw_square怎么用?Python Visualizer.draw_square使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类visualizer.Visualizer
的用法示例。
在下文中一共展示了Visualizer.draw_square方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Visualizer
# 需要导入模块: from visualizer import Visualizer [as 别名]
# 或者: from visualizer.Visualizer import draw_square [as 别名]
import sys
import numpy as np
import pickle
import time
from pathplan import PathPlanner
from visualizer import Visualizer
from collisiondetect import CollisionDetector
sys.setrecursionlimit(5000)
# Initial Config
q_init = (100.0, 500.0, 0.0)
q_goal = (700.0, 500.0, -2.15)
# Define and convert obstacles
vizer = Visualizer()
vizer.draw_square(q_init)
vizer.draw_square(q_goal, color=vizer.RED)
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()
# Call algorithm
rrt_tree = planner.build_rrtstar(K=2000, epsilon=5)
end = time.time()
print('Time taken: %f' % (end - start))