Feature Request: URScript Matrix Element Indexing Improvement

Ooh, yea you’re going to hate this more but what we actually did is used the tried and tested @mbush technique and used another language to generate this:

def get_element(mat, index, size):
    if size == 1:
        temp = 0
    elif size == 2:
        temp = [0, 0]
    end  # continue this trend
    count  = 0
    while count < size:
        temp[size] = mat[index, size]
        count = count + 1
    end
end

matrix = [[0, 1], [2,3]]
element_size = 2

# Output is [2, 3]
row = get_element(matrix, 1, element_size)
1 Like