(self)
return
Reset reference motion.

    First randomly select a new reference motion from
    the set of available motions, and then resets to a random point along the
    selected motion.
Reset reference motion.
Reset reference motion .
def _reset_ref_motion(self):
    """Reset reference motion.

    First randomly select a new reference motion from
    the set of available motions, and then resets to a random point along the
    selected motion.
    """
    self._active_motion_id = self._sample_ref_motion()
    self._origin_offset_rot = np.array([0, 0, 0, 1])
    self._origin_offset_pos.fill(0.0)

    self._reset_motion_time_offset()
    motion = self.get_active_motion()
    time = self._get_motion_time()

    ref_pose = self._calc_ref_pose(time)
    ref_root_pos = motion.get_frame_root_pos(ref_pose)
    ref_root_rot = motion.get_frame_root_rot(ref_pose)
    sim_root_pos = self._get_sim_base_position()
    sim_root_rot = self._get_sim_base_rotation()

    # move the root to the same position and rotation as simulated robot
    self._origin_offset_pos = sim_root_pos - ref_root_pos
    self._origin_offset_pos[2] = 0

    ref_heading = motion_util.calc_heading(ref_root_rot)
    sim_heading = motion_util.calc_heading(sim_root_rot)
    delta_heading = sim_heading - ref_heading
    self._origin_offset_rot = transformations.quaternion_about_axis(
        delta_heading, [0, 0, 1])

    self._ref_pose = self._calc_ref_pose(time)
    self._ref_vel = self._calc_ref_vel(time)
    self._update_ref_model()

    self._prev_motion_phase = motion.calc_phase(time)
    self._reset_clip_change_time()

    return
def _reset_ref_motion ( self ) : self . _active_motion_id = self . _sample_ref_motion ( ) self . _origin_offset_rot = np . array ( [ 0 , 0 , 0 , 1 ] ) self . _origin_offset_pos . fill ( 0.0 ) self . _reset_motion_time_offset ( ) motion = self . get_active_motion ( ) time = self . _get_motion_time ( ) ref_pose = self . _calc_ref_pose ( time ) ref_root_pos = motion . get_frame_root_pos ( ref_pose ) ref_root_rot = motion . get_frame_root_rot ( ref_pose ) sim_root_pos = self . _get_sim_base_position ( ) sim_root_rot = self . _get_sim_base_rotation ( ) # move the root to the same position and rotation as simulated robot self . _origin_offset_pos = sim_root_pos - ref_root_pos self . _origin_offset_pos [ 2 ] = 0 ref_heading = motion_util . calc_heading ( ref_root_rot ) sim_heading = motion_util . calc_heading ( sim_root_rot ) delta_heading = sim_heading - ref_heading self . _origin_offset_rot = transformations . quaternion_about_axis ( delta_heading , [ 0 , 0 , 1 ] ) self . _ref_pose = self . _calc_ref_pose ( time ) self . _ref_vel = self . _calc_ref_vel ( time ) self . _update_ref_model ( ) self . _prev_motion_phase = motion . calc_phase ( time ) self . _reset_clip_change_time ( ) return