demo_boat_advanced.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:lqRRT 作者: jnez71 项目源码 文件源码
def is_feasible(x, u):
    # Reject going too fast
    for i, v in enumerate(x[3:]):
        if v > velmax_pos_plan[i] or v < velmax_neg_plan[i]:
            return False
    # Body to world
    R = np.array([
                  [np.cos(x[2]), -np.sin(x[2])],
                  [np.sin(x[2]),  np.cos(x[2])],
                ])
    # Boat vertices in world frame
    verts = x[:2] + R.dot(vps).T
    # Check for collisions over all obstacles
    for ob in obs:
        if np.any(npl.norm(verts - ob[:2], axis=1) <= ob[2]):
            return False
    return True

################################################# HEURISTICS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号