ROBOMATH.MAT AND NUMPY.NDARRAY EQUIVALENCY sig.johnnson RoboDK Expert Posts: 62 Threads: 21 Joined: Jun 2022 Reputation: 0 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: 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? Find Reply Sam Moderator Posts: 247 Threads: 2 Joined: Jun 2021 Reputation: 14 05-09-2023, 01:58 PM (This post was last modified: 05-09-2023, 01:58 PM by Sam.) To cast a numpy array to a RoboDK matrix, you can do something like this: robomath.Mat(np_array.tolist()) Please read the Forum Guidelines before posting! Find useful information about RoboDK by visiting our Online Documentation. Find Reply sig.johnnson RoboDK Expert Posts: 62 Threads: 21 Joined: Jun 2022 Reputation: 0 05-10-2023, 01:39 PM (This post was last modified: 05-10-2023, 01:39 PM by sig.johnnson.) Thanks, Sam. That worked great. Might be good to add that to the reference: https://robodk.com/doc/en/PythonAPI/robo...obomath-py ``` classrobodk.robomath.Mat(rows=None, ncols=None) Mat is a matrix object. The main purpose of this object is to represent a pose in the 3D space (position and orientation). A pose is a 4x4 matrix that represents the position and orientation of one reference frame with respect to another one, in the 3D space. Poses are commonly used in robotics to place objects, reference frames and targets with respect to each other. ``` Find Reply