(self, physics)
return np.hstack((torso, pelvis, upright, touch))
Returns the factorized reward.
Returns the factorized reward.
Returns the factorized reward .
def get_reward_factors(self, physics):
    """Returns the factorized reward."""
    # Keep the torso  at standing height.
    torso = rewards.tolerance(physics.torso_pelvis_height()[0],
                              bounds=(self._stand_height[0], float('inf')),
                              margin=self._stand_height[0])
    # Keep the pelvis at standing height.
    pelvis = rewards.tolerance(physics.torso_pelvis_height()[1],
                               bounds=(self._stand_height[1], float('inf')),
                               margin=self._stand_height[1])
    # Keep head, torso and pelvis upright.
    upright = rewards.tolerance(physics.upright(),
                                bounds=(_MIN_UPRIGHT_COSINE, float('inf')),
                                sigmoid='linear',
                                margin=_MIN_UPRIGHT_COSINE+1,
                                value_at_margin=0)

    # Reward for foot touch forces up to bodyweight.
    touch = rewards.tolerance(physics.touch_sensors().sum(),
                              bounds=(self._body_weight, float('inf')),
                              margin=self._body_weight,
                              sigmoid='linear',
                              value_at_margin=0.9)

    return np.hstack((torso, pelvis, upright, touch))
def get_reward_factors ( self , physics ) : # Keep the torso  at standing height. torso = rewards . tolerance ( physics . torso_pelvis_height ( ) [ 0 ] , bounds = ( self . _stand_height [ 0 ] , float ( 'inf' ) ) , margin = self . _stand_height [ 0 ] ) # Keep the pelvis at standing height. pelvis = rewards . tolerance ( physics . torso_pelvis_height ( ) [ 1 ] , bounds = ( self . _stand_height [ 1 ] , float ( 'inf' ) ) , margin = self . _stand_height [ 1 ] ) # Keep head, torso and pelvis upright. upright = rewards . tolerance ( physics . upright ( ) , bounds = ( _MIN_UPRIGHT_COSINE , float ( 'inf' ) ) , sigmoid = 'linear' , margin = _MIN_UPRIGHT_COSINE + 1 , value_at_margin = 0 ) # Reward for foot touch forces up to bodyweight. touch = rewards . tolerance ( physics . touch_sensors ( ) . sum ( ) , bounds = ( self . _body_weight , float ( 'inf' ) ) , margin = self . _body_weight , sigmoid = 'linear' , value_at_margin = 0.9 ) return np . hstack ( ( torso , pelvis , upright , touch ) )