Robotics StackExchange | Archived questions

kinect PointCloud2 differs in rviz and numpy array plot, redundant data in PointCloud2?

I need an numpy array with the xz coordinates in an certain y-range for an obstacle avoidance from the Kinect pointCloud2 Data. I wrote a test program and compared it with the rviz output. Now I am a little confused about the result. Can someone explain to me the array plot on the left?

Thank you very much!


Picture:

left: plot of np.array
right: rviz (TopDownOrtho)

test code

def callback_kinectPointCloud(data):
 # data '/camera/depth/points', PointCloud2

a = np.fromstring(data.data, dtype=np.float32)
b = a.reshape((-1,3)) 

# Filter data          
#d = b[ np.where( b[:,1] < robot_height_kinect),:][0]

e =b [:,(0,2)]

plt.plot(*np.transpose(e), marker=',', color='r', ls='')
plt.show()

Asked by meiskje on 2016-01-12 08:22:04 UTC

Comments

Answers