forward_kinematics.py
def select(q_sols, q_d, w=[1]*6):
    """Select the optimal solutions among a set of feasible joint value
       solutions.

    Args:
        q_sols: A set of feasible joint value solutions (unit: radian)
        q_d: A list of desired joint value solution (unit: radian)
        w: A list of weight corresponding to robot joints

    Returns:
        A list of optimal joint value solution.
    """

    error = []
    for q in q_sols:
        error.append(sum([w[i] * (q[i] - q_d[i]) ** 2 for i in range(6)]))

    return q_sols[error.index(min(error))]
Select the optimal solutions among a set of feasible joint value
       solutions.

    Args:
        q_sols: A set of feasible joint value solutions (unit: radian)
        q_d: A list of desired joint value solution (unit: radian)
        w: A list of weight corresponding to robot joints

    Returns:
        A list of optimal joint value solution.
    
Select the optimal solutions among a set of feasible joint value
solutions.
Select the optimal solutions among a set of feasible joint value solutions .
def select(q_sols, q_d, w=[1]*6):
    error = []
    for q in q_sols:
        error.append(sum([w[i] * (q[i] - q_d[i]) ** 2 for i in range(6)]))
    return q_sols[error.index(min(error))]
def select ( q_sols , q_d , w = [ 1 ] * 6 ) : error = [ ] for q in q_sols : error . append ( sum ( [ w [ i ] * ( q [ i ] - q_d [ i ] ) ** 2 for i in range ( 6 ) ] ) ) return q_sols [ error . index ( min ( error ) ) ]
Select the optimal solutions among a set of feasible joint value
solutions.
Select the optimal solutions among a set of feasible joint value solutions .
"""Select the optimal solutions among a set of feasible joint value
       solutions.

    Args:
        q_sols: A set of feasible joint value solutions (unit: radian)
        q_d: A list of desired joint value solution (unit: radian)
        w: A list of weight corresponding to robot joints

    Returns:
        A list of optimal joint value solution.
    """
A list of optimal joint value solution.
A list of optimal joint value solution .
q_sols
A set of feasible joint value solutions (unit: radian)
A set of feasible joint value solutions ( unit : radian )
q_d
A list of desired joint value solution (unit: radian)
A list of desired joint value solution ( unit : radian )
w
A list of weight corresponding to robot joints
A list of weight corresponding to robot joints