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


Python World.convert_ref_frame方法代码示例

本文整理汇总了Python中World.World.convert_ref_frame方法的典型用法代码示例。如果您正苦于以下问题:Python World.convert_ref_frame方法的具体用法?Python World.convert_ref_frame怎么用?Python World.convert_ref_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World.World的用法示例。


在下文中一共展示了World.convert_ref_frame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _set_ref

# 需要导入模块: from World import World [as 别名]
# 或者: from World.World import convert_ref_frame [as 别名]
    def _set_ref(self, new_ref_name):
        '''Changes the reference frame of the action step'''
        new_ref = World.get_ref_from_name(new_ref_name)
        if (new_ref != ArmState.ROBOT_BASE):
            index = ActionStepMarker._ref_names.index(new_ref_name)
            new_ref_obj = ActionStepMarker._ref_object_list[index - 1]
        else:
            new_ref_obj = Object()

        if (self.action_step.type == ActionStep.ARM_TARGET):
            if self.arm_index == 0:
                self.action_step.armTarget.rArm = World.convert_ref_frame(
                        self.action_step.armTarget.rArm, new_ref, new_ref_obj)
            else:
                self.action_step.armTarget.lArm = World.convert_ref_frame(
                        self.action_step.armTarget.lArm, new_ref, new_ref_obj)
        elif (self.action_step.type == ActionStep.ARM_TRAJECTORY):
            for i in range(len(self.action_step.armTrajectory.timing)):
                if self.arm_index == 0:
                    arm_old = self.action_step.armTrajectory.rArm[i]
                    arm_new = World.convert_ref_frame(arm_old,
                                                      new_ref, new_ref_obj)
                    self.action_step.armTrajectory.rArm[i] = arm_new
                else:
                    arm_old = self.action_step.armTrajectory.lArm[i]
                    arm_new = World.convert_ref_frame(arm_old,
                                                      new_ref, new_ref_obj)
                    self.action_step.armTrajectory.lArm[i] = arm_new
            if self.arm_index == 0:
                self.action_step.armTrajectory.rRefFrameObject = new_ref_obj
                self.action_step.armTrajectory.rRefFrame = new_ref
            else:
                self.action_step.armTrajectory.lRefFrameObject = new_ref_obj
                self.action_step.armTrajectory.lRefFrame = new_ref
开发者ID:mayacakmak,项目名称:pr2_pbd,代码行数:36,代码来源:ActionStepMarker.py

示例2: _fix_trajectory_ref

# 需要导入模块: from World import World [as 别名]
# 或者: from World.World import convert_ref_frame [as 别名]
 def _fix_trajectory_ref(self):
     '''Makes the reference frame of continuous trajectories uniform'''
     (r_ref, _), (_, r_ref_obj) = self._find_dominant_ref(
                                             Interaction._arm_trajectory.rArm)
     (l_ref, _), (_, l_ref_obj) = self._find_dominant_ref(
                                             Interaction._arm_trajectory.lArm)
                                             
     for i in range(len(Interaction._arm_trajectory.timing)):
         Interaction._arm_trajectory.rArm[i] = World.convert_ref_frame(
                         Interaction._arm_trajectory.rArm[i],
                         r_ref, r_ref_obj)
         Interaction._arm_trajectory.lArm[i] = World.convert_ref_frame(
                         Interaction._arm_trajectory.lArm[i],
                         l_ref, l_ref_obj)
     
     Interaction._arm_trajectory.rRefFrame = r_ref
     Interaction._arm_trajectory.rRefFrameObject = r_ref_obj
     Interaction._arm_trajectory.lRefFrame = l_ref
     Interaction._arm_trajectory.lRefFrameObject = l_ref_obj
开发者ID:christophersu,项目名称:pr2_pbd,代码行数:21,代码来源:Interaction.py


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