def hppConfigFromMatrice(robot, q_matrix):
    """
    Convert a numpy array to a list, if required fill the list with 0 at the end to match the dimension defined in robot
    :param robot:
    :param q_matrix:
    :return: a list a length robot.configSize() where the head is the values in q_matrix and the tail are zero
    """
    q = q_matrix.tolist()
    extraDof = robot.getConfigSize() - q_matrix.shape[0]
    assert extraDof >= 0, "Changes in the robot model happened."
    if extraDof > 0:
        q += [0] * extraDof
    return q