(self)
return tar_obs
Constructs the target observations, consisting of a sequence of

    target frames for future timesteps. The tartet poses to include is
    specified by self._tar_frame_steps.

    Returns:
      An array containing the target frames.
Constructs the target observations, consisting of a sequence of
Constructs the target observations consisting of a sequence of
def build_target_obs(self):
    """Constructs the target observations, consisting of a sequence of

    target frames for future timesteps. The tartet poses to include is
    specified by self._tar_frame_steps.

    Returns:
      An array containing the target frames.
    """
    tar_poses = []

    time0 = self._get_motion_time()
    dt = self._env.env_time_step
    motion = self.get_active_motion()

    robot = self._env.robot
    ref_base_pos = self._get_ref_base_position()
    sim_base_rot = np.array(robot.GetBaseOrientation())

    heading = motion_util.calc_heading(sim_base_rot)
    if self._tar_obs_noise is not None:
      heading += self._randn(0, self._tar_obs_noise[0])
    inv_heading_rot = transformations.quaternion_about_axis(-heading, [0, 0, 1])

    for step in self._tar_frame_steps:
      tar_time = time0 + step * dt
      tar_pose = self._calc_ref_pose(tar_time)

      tar_root_pos = motion.get_frame_root_pos(tar_pose)
      tar_root_rot = motion.get_frame_root_rot(tar_pose)

      tar_root_pos -= ref_base_pos
      tar_root_pos = pose3d.QuaternionRotatePoint(tar_root_pos, inv_heading_rot)

      tar_root_rot = transformations.quaternion_multiply(
          inv_heading_rot, tar_root_rot)
      tar_root_rot = motion_util.standardize_quaternion(tar_root_rot)

      motion.set_frame_root_pos(tar_root_pos, tar_pose)
      motion.set_frame_root_rot(tar_root_rot, tar_pose)

      tar_poses.append(tar_pose)

    tar_obs = np.concatenate(tar_poses, axis=-1)

    return tar_obs
def build_target_obs ( self ) : tar_poses = [ ] time0 = self . _get_motion_time ( ) dt = self . _env . env_time_step motion = self . get_active_motion ( ) robot = self . _env . robot ref_base_pos = self . _get_ref_base_position ( ) sim_base_rot = np . array ( robot . GetBaseOrientation ( ) ) heading = motion_util . calc_heading ( sim_base_rot ) if self . _tar_obs_noise is not None : heading += self . _randn ( 0 , self . _tar_obs_noise [ 0 ] ) inv_heading_rot = transformations . quaternion_about_axis ( - heading , [ 0 , 0 , 1 ] ) for step in self . _tar_frame_steps : tar_time = time0 + step * dt tar_pose = self . _calc_ref_pose ( tar_time ) tar_root_pos = motion . get_frame_root_pos ( tar_pose ) tar_root_rot = motion . get_frame_root_rot ( tar_pose ) tar_root_pos -= ref_base_pos tar_root_pos = pose3d . QuaternionRotatePoint ( tar_root_pos , inv_heading_rot ) tar_root_rot = transformations . quaternion_multiply ( inv_heading_rot , tar_root_rot ) tar_root_rot = motion_util . standardize_quaternion ( tar_root_rot ) motion . set_frame_root_pos ( tar_root_pos , tar_pose ) motion . set_frame_root_rot ( tar_root_rot , tar_pose ) tar_poses . append ( tar_pose ) tar_obs = np . concatenate ( tar_poses , axis = - 1 ) return tar_obs