$search
00001 """autogenerated by genmsg_py from PointField.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PointField(roslib.message.Message): 00007 _md5sum = "268eacb2962780ceac86cbd17e328150" 00008 _type = "sensor_msgs/PointField" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# This message holds the description of one point entry in the 00011 # PointCloud2 message format. 00012 uint8 INT8 = 1 00013 uint8 UINT8 = 2 00014 uint8 INT16 = 3 00015 uint8 UINT16 = 4 00016 uint8 INT32 = 5 00017 uint8 UINT32 = 6 00018 uint8 FLOAT32 = 7 00019 uint8 FLOAT64 = 8 00020 00021 string name # Name of field 00022 uint32 offset # Offset from start of point struct 00023 uint8 datatype # Datatype enumeration, see above 00024 uint32 count # How many elements in the field 00025 00026 """ 00027 # Pseudo-constants 00028 INT8 = 1 00029 UINT8 = 2 00030 INT16 = 3 00031 UINT16 = 4 00032 INT32 = 5 00033 UINT32 = 6 00034 FLOAT32 = 7 00035 FLOAT64 = 8 00036 00037 __slots__ = ['name','offset','datatype','count'] 00038 _slot_types = ['string','uint32','uint8','uint32'] 00039 00040 def __init__(self, *args, **kwds): 00041 """ 00042 Constructor. Any message fields that are implicitly/explicitly 00043 set to None will be assigned a default value. The recommend 00044 use is keyword arguments as this is more robust to future message 00045 changes. You cannot mix in-order arguments and keyword arguments. 00046 00047 The available fields are: 00048 name,offset,datatype,count 00049 00050 @param args: complete set of field values, in .msg order 00051 @param kwds: use keyword arguments corresponding to message field names 00052 to set specific fields. 00053 """ 00054 if args or kwds: 00055 super(PointField, self).__init__(*args, **kwds) 00056 #message fields cannot be None, assign default values for those that are 00057 if self.name is None: 00058 self.name = '' 00059 if self.offset is None: 00060 self.offset = 0 00061 if self.datatype is None: 00062 self.datatype = 0 00063 if self.count is None: 00064 self.count = 0 00065 else: 00066 self.name = '' 00067 self.offset = 0 00068 self.datatype = 0 00069 self.count = 0 00070 00071 def _get_types(self): 00072 """ 00073 internal API method 00074 """ 00075 return self._slot_types 00076 00077 def serialize(self, buff): 00078 """ 00079 serialize message into buffer 00080 @param buff: buffer 00081 @type buff: StringIO 00082 """ 00083 try: 00084 _x = self.name 00085 length = len(_x) 00086 buff.write(struct.pack('<I%ss'%length, length, _x)) 00087 _x = self 00088 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00089 except struct.error as se: self._check_types(se) 00090 except TypeError as te: self._check_types(te) 00091 00092 def deserialize(self, str): 00093 """ 00094 unpack serialized message in str into this message instance 00095 @param str: byte array of serialized message 00096 @type str: str 00097 """ 00098 try: 00099 end = 0 00100 start = end 00101 end += 4 00102 (length,) = _struct_I.unpack(str[start:end]) 00103 start = end 00104 end += length 00105 self.name = str[start:end] 00106 _x = self 00107 start = end 00108 end += 9 00109 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00110 return self 00111 except struct.error as e: 00112 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00113 00114 00115 def serialize_numpy(self, buff, numpy): 00116 """ 00117 serialize message with numpy array types into buffer 00118 @param buff: buffer 00119 @type buff: StringIO 00120 @param numpy: numpy python module 00121 @type numpy module 00122 """ 00123 try: 00124 _x = self.name 00125 length = len(_x) 00126 buff.write(struct.pack('<I%ss'%length, length, _x)) 00127 _x = self 00128 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00129 except struct.error as se: self._check_types(se) 00130 except TypeError as te: self._check_types(te) 00131 00132 def deserialize_numpy(self, str, numpy): 00133 """ 00134 unpack serialized message in str into this message instance using numpy for array types 00135 @param str: byte array of serialized message 00136 @type str: str 00137 @param numpy: numpy python module 00138 @type numpy: module 00139 """ 00140 try: 00141 end = 0 00142 start = end 00143 end += 4 00144 (length,) = _struct_I.unpack(str[start:end]) 00145 start = end 00146 end += length 00147 self.name = str[start:end] 00148 _x = self 00149 start = end 00150 end += 9 00151 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00152 return self 00153 except struct.error as e: 00154 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00155 00156 _struct_I = roslib.message.struct_I 00157 _struct_IBI = struct.Struct("<IBI")