$search
00001 """autogenerated by genmsg_py from HS_distance.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class HS_distance(roslib.message.Message): 00007 _md5sum = "b2cb89f922c5d07784b533cfabb72389" 00008 _type = "srs_msgs/HS_distance" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# this message contains information about the distance to the detected human in centimeters 00011 00012 00013 uint32 distance # this is the distance in cm 00014 00015 """ 00016 __slots__ = ['distance'] 00017 _slot_types = ['uint32'] 00018 00019 def __init__(self, *args, **kwds): 00020 """ 00021 Constructor. Any message fields that are implicitly/explicitly 00022 set to None will be assigned a default value. The recommend 00023 use is keyword arguments as this is more robust to future message 00024 changes. You cannot mix in-order arguments and keyword arguments. 00025 00026 The available fields are: 00027 distance 00028 00029 @param args: complete set of field values, in .msg order 00030 @param kwds: use keyword arguments corresponding to message field names 00031 to set specific fields. 00032 """ 00033 if args or kwds: 00034 super(HS_distance, self).__init__(*args, **kwds) 00035 #message fields cannot be None, assign default values for those that are 00036 if self.distance is None: 00037 self.distance = 0 00038 else: 00039 self.distance = 0 00040 00041 def _get_types(self): 00042 """ 00043 internal API method 00044 """ 00045 return self._slot_types 00046 00047 def serialize(self, buff): 00048 """ 00049 serialize message into buffer 00050 @param buff: buffer 00051 @type buff: StringIO 00052 """ 00053 try: 00054 buff.write(_struct_I.pack(self.distance)) 00055 except struct.error as se: self._check_types(se) 00056 except TypeError as te: self._check_types(te) 00057 00058 def deserialize(self, str): 00059 """ 00060 unpack serialized message in str into this message instance 00061 @param str: byte array of serialized message 00062 @type str: str 00063 """ 00064 try: 00065 end = 0 00066 start = end 00067 end += 4 00068 (self.distance,) = _struct_I.unpack(str[start:end]) 00069 return self 00070 except struct.error as e: 00071 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00072 00073 00074 def serialize_numpy(self, buff, numpy): 00075 """ 00076 serialize message with numpy array types into buffer 00077 @param buff: buffer 00078 @type buff: StringIO 00079 @param numpy: numpy python module 00080 @type numpy module 00081 """ 00082 try: 00083 buff.write(_struct_I.pack(self.distance)) 00084 except struct.error as se: self._check_types(se) 00085 except TypeError as te: self._check_types(te) 00086 00087 def deserialize_numpy(self, str, numpy): 00088 """ 00089 unpack serialized message in str into this message instance using numpy for array types 00090 @param str: byte array of serialized message 00091 @type str: str 00092 @param numpy: numpy python module 00093 @type numpy: module 00094 """ 00095 try: 00096 end = 0 00097 start = end 00098 end += 4 00099 (self.distance,) = _struct_I.unpack(str[start:end]) 00100 return self 00101 except struct.error as e: 00102 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00103 00104 _struct_I = roslib.message.struct_I