learning.py 文件源码

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

项目:APEX 作者: ymollard 项目源码 文件源码
def cb_produce(self, request):
        with self.lock_iteration:
            # Check if we need a new learner
            self.produce_init_learner()
            focus = copy(self.focus)

        rospy.loginfo("Learning node is requesting the current state")
        state = self.get_state(GetSensorialStateRequest()).state

        demonstrate = request.skill_to_demonstrate
        if demonstrate == "":
            rospy.loginfo("Learning node is producing...")
            w = self.learning.produce(self.translator.get_context(state), focus)
        else:
            rospy.logwarn("Assessing {}...".format(demonstrate))
            context = self.translator.get_context(state)
            w = self.learning.produce(context, goal=demonstrate)

        trajectory_matrix = self.translator.w_to_trajectory(w)
        trajectory_msg = self.translator.matrix_to_trajectory_msg(trajectory_matrix)

        self.ready_for_interaction = True

        response = ProduceResponse(torso_trajectory=trajectory_msg)
        return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号