(self)
return ball_state.dot(torso_frame).ravel()
Returns ball position and velocity relative to the torso frame.
Returns ball position and velocity relative to the torso frame.
Returns ball position and velocity relative to the torso frame .
def ball_state(self):
    """Returns ball position and velocity relative to the torso frame."""
    data = self.named.data
    torso_frame = data.xmat['torso'].reshape(3, 3)
    ball_rel_pos = data.xpos['ball'] - data.xpos['torso']
    ball_rel_vel = data.qvel['ball_root'][:3] - data.qvel['root'][:3]
    ball_rot_vel = data.qvel['ball_root'][3:]
    ball_state = np.vstack((ball_rel_pos, ball_rel_vel, ball_rot_vel))
    return ball_state.dot(torso_frame).ravel()
def ball_state ( self ) : data = self . named . data torso_frame = data . xmat [ 'torso' ] . reshape ( 3 , 3 ) ball_rel_pos = data . xpos [ 'ball' ] - data . xpos [ 'torso' ] ball_rel_vel = data . qvel [ 'ball_root' ] [ : 3 ] - data . qvel [ 'root' ] [ : 3 ] ball_rot_vel = data . qvel [ 'ball_root' ] [ 3 : ] ball_state = np . vstack ( ( ball_rel_pos , ball_rel_vel , ball_rot_vel ) ) return ball_state . dot ( torso_frame ) . ravel ( )