parameters: (env)
return_statement: return False
docstring: Returns a bool indicating that the extended env is terminated.
  
    This predicate checks whether 1) the legs are bent inward too much or
    2) the body is tilted too much.
  
    Args:
      env: An instance of MinitaurGymEnv
docstring_summary: Returns a bool indicating that the extended env is terminated.
docstring_tokens: Returns a bool indicating that the extended env is terminated .
function: def terminal_condition_for_minitaur_extended_env(env):
    """Returns a bool indicating that the extended env is terminated.
  
    This predicate checks whether 1) the legs are bent inward too much or
    2) the body is tilted too much.
  
    Args:
      env: An instance of MinitaurGymEnv
    """
    motor_angles = env.robot.motor_angles
    leg_pose = minitaur_pose_utils.motor_angles_to_leg_pose(motor_angles)
  
    swing_threshold = np.radians(35.0)
    if (leg_pose[0] > swing_threshold or leg_pose[2] > swing_threshold or  # Front
        leg_pose[1] < -swing_threshold or leg_pose[3] < -swing_threshold):  # Rear
      return True
    roll, _, _ = env.robot.base_roll_pitch_yaw
    if abs(roll) > np.radians(30.0):
      return True
  
    return False
function_tokens: def terminal_condition_for_minitaur_extended_env ( env ) : motor_angles = env . robot . motor_angles leg_pose = minitaur_pose_utils . motor_angles_to_leg_pose ( motor_angles ) swing_threshold = np . radians ( 35.0 ) if ( leg_pose [ 0 ] > swing_threshold or leg_pose [ 2 ] > swing_threshold or # Front leg_pose [ 1 ] < - swing_threshold or leg_pose [ 3 ] < - swing_threshold ) : # Rear return True roll , _ , _ = env . robot . base_roll_pitch_yaw if abs ( roll ) > np . radians ( 30.0 ) : return True return False