def _parse_limits(joint):
    """Parse joint limits."""
    limit = joint.find("limit")
    lower, upper = float("-inf"), float("inf")
    if limit is not None:
        if limit.has_attr("lower"):
            lower = float(limit["lower"])
        if limit.has_attr("upper"):
            upper = float(limit["upper"])
    return lower, upper