def _find_next_link(root, current_joint, next_link_name):
    """
    Find the next link in the URDF tree

    Parameters
    ----------
    root
    current_joint: xml.etree.ElementTree
        The current URDF joint
    next_link_name: str
        Optional : The name of the next link. If not provided, find it automatically as the first child of the joint.
    """
    has_next = False
    next_link = None
    if next_link_name is None:
        next_link_name = current_joint.find('child').attrib['link']
    for urdf_link in root.findall('link'):
        if urdf_link.attrib['name'] == next_link_name:
            next_link = urdf_link
            has_next = True
    return has_next, next_link
