def _get_poses(self, indexA, indexB, transform=False): if self.poses is None: return None, None, None indexA = indexA indexB = indexB poseA = Transform.from_parameters(*self.poses[indexA], is_degree=True) poseB = Transform.from_parameters(*self.poses[indexB], is_degree=True) if transform: pose_A_flip = Transform.scale(1, -1, -1).combine(poseA) pose_A_flip = self.matrix_transformation.combine(pose_A_flip, copy=True) poseA = Transform().scale(1, -1, -1).combine(pose_A_flip, copy=True) pose_B_flip = Transform.scale(1, -1, -1).combine(poseB) pose_B_flip = self.matrix_transformation.combine(pose_B_flip, copy=True) poseB = Transform().scale(1, -1, -1).combine(pose_B_flip, copy=True) delta = delta_transform( poseA, poseB).to_parameters(isDegree=True).astype(np.float32) return delta, poseA, poseB
def to_event(self, pose): pose_f_flip = Transform.scale(1, -1, -1).combine(pose, copy=True) pose_e_flip = self.transform.combine(pose_f_flip, copy=True) pose_e = Transform().scale(1, -1, -1).combine(pose_e_flip, copy=True) return pose_e