本文整理汇总了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
示例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