当前位置: 首页>>代码示例>>Python>>正文


Python Simulator.simulate_eb_trajectory方法代码示例

本文整理汇总了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()
开发者ID:b4be1,项目名称:easy_catch,代码行数:20,代码来源:launcher.py

示例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)


# ============================================================================
开发者ID:b4be1,项目名称:easy_catch,代码行数:33,代码来源:main.py


注:本文中的simulator.Simulator.simulate_eb_trajectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。