ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

meiskje's profile - activity

2016-08-08 00:15:16 -0500 received badge  Famous Question (source)
2016-02-29 12:11:23 -0500 received badge  Notable Question (source)
2016-02-01 15:45:04 -0500 received badge  Popular Question (source)
2016-01-27 04:58:18 -0500 received badge  Enthusiast
2016-01-14 07:26:10 -0500 received badge  Supporter (source)
2016-01-12 07:43:18 -0500 received badge  Student (source)
2016-01-12 07:34:47 -0500 asked a question 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()