def globe_walking_success(stdout, parameter, val):
    """Whether the robot is balanced on the ball (and not floating)."""
    lines = stdout.decode().split("\n")
    lines = [line for line in lines if "z-position" in line]

    min_base_height, max_base_height = float("inf"), float("-inf")
    for line in lines:
        height = float(line.split(": ")[1].strip())
        min_base_height = min(min_base_height, height)
        max_base_height = max(max_base_height, height)
    print(f"Minimum, Maximum base height for {parameter} = {val}: {min_base_height}, {max_base_height}")
    return 0.9 <= min_base_height and max_base_height <= 1.2
Whether the robot is balanced on the ball (and not floating).
dr_eureka/rapp.py