

def coriolismatrix(rbtdef, geom, ifunc=None):
    'Generate Coriolis matrix (non-unique).'
    if (not ifunc):
        ifunc = identity
    C = zeros(rbtdef.dof, rbtdef.dof)
    rbtdeftmp = deepcopy(rbtdef)
    rbtdeftmp.gravityacc = zeros(3, 1)
    rbtdeftmp.ddq = zeros(rbtdeftmp.dof, 1)
    rbtdeftmp.frictionmodel = None
    A = [zeros(rbtdef.dof, rbtdef.dof) for k in range(rbtdef.dof)]
    for i in range(rbtdef.dof):
        rbtdeftmp.dq = zeros(rbtdeftmp.dof, 1)
        rbtdeftmp.dq[i] = 1
        geomtmp = Geometry(rbtdeftmp)
        fw_results = rne_forward(A, geomtmp, ifunc)
        c = rne_backward(rbtdeftmp, geomtmp, fw_results, ifunc)
        for k in range(rbtdef.dof):
            A[k][(i, i)] = c[k]
    for i in range(rbtdef.dof):
        for j in range((i + 1), rbtdef.dof):
            rbtdeftmp.dq = zeros(rbtdeftmp.dof, 1)
            rbtdeftmp.dq[i] = rbtdeftmp.dq[j] = 1
            geomtmp = Geometry(rbtdeftmp)
            fw_results = rne_forward(rbtdeftmp, geomtmp, ifunc)
            c = rne_backward(rbtdeftmp, geomtmp, fw_results, ifunc)
            for k in range(rbtdef.dof):
                A[k][(i, j)] = ifunc(((c[k] - A[k][(i, i)]) - A[k][(j, j)]))
    for k in range(rbtdef.dof):
        C[k, :] = (rbtdef.dq.T * A[k])
    C = ifunc(C)
    return C

dataset/ETHPy150Open cdsousa/SymPyBotics/sympybotics/dynamics/rne.py coriolismatrix/VarMisuse@150/234 `rbtdeftmp`->`A`