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
The o3d.utility.Vector3dVector() line throws a runtime error without any description.
I'm guessing it's something to do with the conversion in pcd_as_numpy_array . The line doesn't throw an error though.
This alternative works though.
gen=read_points(msg, skip_nans=True)
int_data=list(gen)
xyz=np.empty((len(int_data), 3))
rgb=np.empty((len(int_data), 3))
idx=0forxinint_data:
test=x[3]
# cast float32 to int so that bitwise operations are possibles=struct.pack('>f' ,test)
i=struct.unpack('>l',s)[0]
# you can get back the float value by the inverse operationspack=ctypes.c_uint32(i).valuer= (pack&0x00FF0000)>>16g= (pack&0x0000FF00)>>8b= (pack&0x000000FF)
# prints r,g,b values in the 0-255 range# x,y,z can be retrieved from the x[0],x[1],x[2]# xyz = np.append(xyz,[[x[0],x[1],x[2]]], axis = 0)# rgb = np.append(rgb,[[r,g,b]], axis = 0)xyz[idx] = [x[0],x[1],x[2]]
rgb[idx] = [r,g,b]
idx=idx+1out_pcd=o3d.geometry.PointCloud()
out_pcd.points=o3d.utility.Vector3dVector(xyz)
out_pcd.colors=o3d.utility.Vector3dVector(rgb)
The text was updated successfully, but these errors were encountered:
The o3d.utility.Vector3dVector() line throws a runtime error without any description.
I'm guessing it's something to do with the conversion in
pcd_as_numpy_array
. The line doesn't throw an error though.This alternative works though.
The text was updated successfully, but these errors were encountered: