本文整理汇总了Python中simulator.Simulator.simulate_eb_trajectory方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.simulate_eb_trajectory方法的具体用法?Python Simulator.simulate_eb_trajectory怎么用?Python Simulator.simulate_eb_trajectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulator.Simulator
的用法示例。
在下文中一共展示了Simulator.simulate_eb_trajectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: one_plan
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import simulate_eb_trajectory [as 别名]
def one_plan():
model = new_model()
plan, lam_x, lam_g = Planner.create_plan(model)
plan, lam_x, lam_g = Planner.create_belief_plan(
model, warm_start=True,
x0=plan, lam_x0=lam_x, lam_g0=lam_g
)
x_all = plan.prefix['X']
u_all = plan.prefix['U']
eb_all = Simulator.simulate_eb_trajectory(model, u_all)
# Plot
fig, ax = plt.subplots()
fig.tight_layout()
handles = Plotter.plot_plan(ax, eb_all)
ax.legend(handles=handles, loc='upper left')
ax.set_aspect('equal')
plt.show()
示例2:
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import simulate_eb_trajectory [as 别名]
return patch
# ============================================================================
# Plan trajectory
# ============================================================================
# Find optimal controls
plan, lam_x, lam_g = Planner.create_plan(model)
# plan, lam_x, lam_g = Planner.create_plan(model, warm_start=True,
# x0=plan, lam_x0=lam_x, lam_g0=lam_g)
x_all = plan.prefix['X']
u_all = plan.prefix['U']
# Simulate ebelief trajectory
eb_all = Simulator.simulate_eb_trajectory(model, u_all)
# Plot 2D
fig, ax = plt.subplots()
handles = Plotter.plot_plan(ax, eb_all)
ax.legend(handles=handles, loc='upper left')
ax.set_aspect('equal')
fig.tight_layout()
# Plot 3D
# fig_3D = plt.figure(figsize=(10, 10))
# ax_3D = fig_3D.add_subplot(111, projection='3d')
# Plotter.plot_trajectory_3D(ax_3D, x_all)
# ============================================================================