(physics, deviation_angle=0)
return rewards.tolerance(
      physics.torso_upright(),
      bounds=(deviation, float('inf')),
      sigmoid='linear',
      margin=1 + deviation,
      value_at_margin=0)
Returns a reward proportional to how upright the torso is.

  Args:
    physics: an instance of `Physics`.
    deviation_angle: A float, in degrees. The reward is 0 when the torso is
      exactly upside-down and 1 when the torso's z-axis is less than
      `deviation_angle` away from the global z-axis.
Returns a reward proportional to how upright the torso is.
Returns a reward proportional to how upright the torso is .
def _upright_reward(physics, deviation_angle=0):
  """Returns a reward proportional to how upright the torso is.

  Args:
    physics: an instance of `Physics`.
    deviation_angle: A float, in degrees. The reward is 0 when the torso is
      exactly upside-down and 1 when the torso's z-axis is less than
      `deviation_angle` away from the global z-axis.
  """
  deviation = np.cos(np.deg2rad(deviation_angle))
  return rewards.tolerance(
      physics.torso_upright(),
      bounds=(deviation, float('inf')),
      sigmoid='linear',
      margin=1 + deviation,
      value_at_margin=0)
def _upright_reward ( physics , deviation_angle = 0 ) : deviation = np . cos ( np . deg2rad ( deviation_angle ) ) return rewards . tolerance ( physics . torso_upright ( ) , bounds = ( deviation , float ( 'inf' ) ) , sigmoid = 'linear' , margin = 1 + deviation , value_at_margin = 0 )