05-08-2023, 11:12 PM
(This post was last modified: 05-08-2023, 11:39 PM by sig.johnnson.)
I am doing some math that requires numpy / scipy matrix operations. Numpy and scipy functions handle robomath.Mat matrices quite well. However, I cannot item.SetPose(np.ndarray), unfortunately.
As a workaround, I have the following kind of gross passage in my code:
I am sure this will slow down my code severely.
Is there a built-in way to cast numpy matrices to robomath.Mat matrices?
As a workaround, I have the following kind of gross passage in my code:
Code:
rm_mat = robomath.eye()
# TODO: figure out how to get a robomath.Mat matrix that is equivalent to a numpy matrix
for i in range(np.shape(rm_mat)[0]):
for j in range(np.shape(rm_mat)[1]):
rm_mat[i,j] = my_numpy_matrix[i][j]
I am sure this will slow down my code severely.
Is there a built-in way to cast numpy matrices to robomath.Mat matrices?