(self)
return observable.Generic(bodies_pos_in_egocentric_frame)
Position of bodies relative to root, in the egocentric frame.
Position of bodies relative to root, in the egocentric frame.
Position of bodies relative to root in the egocentric frame .
def bodies_pos(self):
    """Position of bodies relative to root, in the egocentric frame."""
    def bodies_pos_in_egocentric_frame(physics):
      """Compute relative orientation of the bodies."""
      # Get the bodies
      bodies = self._entity.bodies
      # Get the positions of all the bodies & root in the global frame
      bodies_xpos = physics.bind(bodies).xpos
      root_xpos, _ = self._entity.get_pose(physics)
      # Compute the relative position of the bodies in the root frame
      root_xmat = np.reshape(physics.bind(self._entity.root_body).xmat, (3, 3))
      return np.reshape(
          np.dot(bodies_xpos - root_xpos, root_xmat), -1)
    return observable.Generic(bodies_pos_in_egocentric_frame)
def bodies_pos ( self ) : def bodies_pos_in_egocentric_frame ( physics ) : """Compute relative orientation of the bodies.""" # Get the bodies bodies = self . _entity . bodies # Get the positions of all the bodies & root in the global frame bodies_xpos = physics . bind ( bodies ) . xpos root_xpos , _ = self . _entity . get_pose ( physics ) # Compute the relative position of the bodies in the root frame root_xmat = np . reshape ( physics . bind ( self . _entity . root_body ) . xmat , ( 3 , 3 ) ) return np . reshape ( np . dot ( bodies_xpos - root_xpos , root_xmat ) , - 1 ) return observable . Generic ( bodies_pos_in_egocentric_frame )