Repository navigation
Is it possible to extract the jacobian matrix of a system with SofaPython ? #3350
|
Hi everyone, I am currently working on a parallel continuum robot modeled with SOFA. I know the jacobian matrix of the system/robot is computed somewhere whithin SOFA, and I need it for my control loop. Is there any way to extract this matrix ? This discussion: https://github.com/sofa-framework/sofa/discussions/2912 shows that there was an ongoing work on making system matrices accessible, is it ready now ? Thank you for your help. |
Replies: 1 comment 5 replies
|
Hi @Matyas-D if you use Python, you can have read-access to various matrices and vectors in the simulation scenes:
Dense objects will be available as a numpy array, while sparse matrices will be represented by scipy.sparse.csr_matrix. This is available in SOFA v22.06. Checkout the examples in the SofaPython3 plugin. For example: Alex |
Hi @Matyas-D
if you use Python, you can have read-access to various matrices and vectors in the simulation scenes:
Dense objects will be available as a numpy array, while sparse matrices will be represented by scipy.sparse.csr_matrix.
This is available in SOFA v22.06.
Checkout the examples in the SofaPython3 plugin. For example:
https://github.com/sofa-framework/SofaPython3/blob/fffebadfbe4e68a1adf1910efa622e27af59209c/examples/access_matrix.py#L44
Alex