def METHOD_NAME(robot, joint_list):
    """
    Gets the joint information used for joint_limits file from the robot
    """
    out = {"names": [], "elements": []}
    for joint in sorted(joint_list):
        j = robot.get_joint(joint)
        if j is None:
            raise Exception("Joint of name "+joint+" not found in robot!")
        if j.joint_type != "fixed":
            out["names"] += [j.name]
            if j.limit is None:
                log.warning(f"No joint limits defined for joint {j.name} (type: {j.joint_type})")
            out["elements"] += [{
                # "name" : j,
                "max": {
                    "position": j.limit.upper if j.limit is not None else 0,
                    "speed": j.limit.velocity if j.limit is not None else 0,
                    "effort": j.limit.effort if j.limit is not None else 0
                },
                "min": {"position": j.limit.lower if j.limit is not None else 0}
            }]
    return out