parameters: (points, stamp=None, frame_id=None)
return_statement: return msg
docstring: Create a sensor_msgs.PointCloud2 from an array
      of points.
docstring_summary: Create a sensor_msgs.PointCloud2 from an array
      of points.
docstring_tokens: Create a sensor_msgs . PointCloud2 from an array of points .
function: def xyz_array_to_pointcloud2(points, stamp=None, frame_id=None):
      '''
      Create a sensor_msgs.PointCloud2 from an array
      of points.
      '''
  
      msg = PointCloud2()
      if stamp:
          msg.header.stamp = stamp
      if frame_id:
          msg.header.frame_id = frame_id
      if points.shape[0] == 3:
          msg.height = 1
          msg.width = points.shape[1]
      else:
          msg.height = 1
          msg.width = len(points)
      msg.fields = [
          PointField('x', 0, PointField.FLOAT32, 1),
          PointField('y', 4, PointField.FLOAT32, 1),
          PointField('z', 8, PointField.FLOAT32, 1)]
      msg.is_bigendian = False
      msg.point_step = 12
      msg.row_step = 12 * points.shape[0]
      msg.is_dense = int(np.isfinite(points).all())
      msg.data = np.asarray(points.T, np.float32).tostring()
  
      return msg
function_tokens: def xyz_array_to_pointcloud2 ( points , stamp = None , frame_id = None ) : msg = PointCloud2 ( ) if stamp : msg . header . stamp = stamp if frame_id : msg . header . frame_id = frame_id if points . shape [ 0 ] == 3 : msg . height = 1 msg . width = points . shape [ 1 ] else : msg . height = 1 msg . width = len ( points ) msg . fields = [ PointField ( 'x' , 0 , PointField . FLOAT32 , 1 ) , PointField ( 'y' , 4 , PointField . FLOAT32 , 1 ) , PointField ( 'z' , 8 , PointField . FLOAT32 , 1 ) ] msg . is_bigendian = False msg . point_step = 12 msg . row_step = 12 * points . shape [ 0 ] msg . is_dense = int ( np . isfinite ( points ) . all ( ) ) msg . data = np . asarray ( points . T , np . float32 ) . tostring ( ) return msg