You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to create an open3D pointcloud via the realsense SDK. However, I receive this:
RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details)
The code below shows the problem: vtx = np.asanyarray(points.get_vertices()) does not return a normal numpy array. Therefore, the o3d utility o3d.utility.Vector3dVector(vtx) fails. I already tested the o3d utility with normal numpy arrays. They work fine.
Inspecting via the debugger shows, that vtx is an array of dtype([('f0', '<f4'), ('f1', '<f4'), ('f2', '<f4')])
Hi @FloWsnr A RealSense Open3D user at isl-org/Open3D#473 shares their Python pointcloud scripting, using what seems to be a similar approach to your own. In the script under the What I tried heading, they are using Vector3DVector(vtx.tolist()) instead of just vtx. Does their script run correctly if you test it, please?
It's great to hear that adding tolist() worked for you, @FloWsnr - thanks very much for the update and for sharing your solution with the RealSense community!
Issue Description
I am currently trying to create an open3D pointcloud via the realsense SDK. However, I receive this:
RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details)
The code below shows the problem:
vtx = np.asanyarray(points.get_vertices())
does not return a normal numpy array. Therefore, the o3d utilityo3d.utility.Vector3dVector(vtx)
fails. I already tested the o3d utility with normal numpy arrays. They work fine.Inspecting via the debugger shows, that vtx is an array of
dtype([('f0', '<f4'), ('f1', '<f4'), ('f2', '<f4')])
What am I doing wrong here? Thanks for the help!
The text was updated successfully, but these errors were encountered: