__init__.py 文件源码

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

项目:rosie 作者: PyForce 项目源码 文件源码
def go_to_with_planner(self, x, y, t):
        start = self.position()[:-1]
        end = np.array([x, y])
        points = self.planner.get_points(start=start, end=end, robot=self)

        def add_t(points, t):
            points = np.array(points)
            lens = np.hypot(points[:, 0], points[:, 1])
            tpm = t / np.add.reduce(lens)
            npoints = np.zeros(shape=(points.shape[0], 3))
            npoints[:, :-1] = points
            npoints[:, -1] = tpm * lens
            return npoints

        npoints = add_t(points, t)

        if not points:
            logging.warning("no available path. start=%r, end=%r", start, end)
        else:
            self.follow(points, t)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号