$search
00001 """autogenerated by genmsg_py from Ack.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class Ack(roslib.message.Message): 00007 _md5sum = "f84607dc6beaf1cb6772d23af7221bdf" 00008 _type = "applanix_msgs/Ack" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """uint16 transaction 00011 uint16 id 00012 00013 uint16 RESPONSE_NOT_APPLICABLE=0 00014 uint16 RESPONSE_ACCEPTED=1 00015 uint16 RESPONSE_ACCEPTED_TOO_LONG=2 00016 uint16 RESPONSE_ACCEPTED_TOO_SHORT=3 00017 uint16 RESPONSE_PARAM_ERROR=4 00018 uint16 RESPONSE_NOT_APPLICABLE_IN_CURRENT_STATE=5 00019 uint16 RESPONSE_DATA_NOT_AVAILABLE=6 00020 uint16 RESPONSE_MESSAGE_START_ERROR=7 00021 uint16 RESPONSE_MESSAGE_END_ERROR=8 00022 uint16 RESPONSE_BYTE_COUNT_ERROR=9 00023 uint16 RESPONSE_CHECKSUM_ERROR=10 00024 uint16 response_code 00025 00026 uint8 PARAMS_NO_CHANGE=0 00027 uint8 PARAMS_CHANGE=1 00028 uint8 params_status 00029 00030 uint8[32] error_parameter_name 00031 00032 """ 00033 # Pseudo-constants 00034 RESPONSE_NOT_APPLICABLE = 0 00035 RESPONSE_ACCEPTED = 1 00036 RESPONSE_ACCEPTED_TOO_LONG = 2 00037 RESPONSE_ACCEPTED_TOO_SHORT = 3 00038 RESPONSE_PARAM_ERROR = 4 00039 RESPONSE_NOT_APPLICABLE_IN_CURRENT_STATE = 5 00040 RESPONSE_DATA_NOT_AVAILABLE = 6 00041 RESPONSE_MESSAGE_START_ERROR = 7 00042 RESPONSE_MESSAGE_END_ERROR = 8 00043 RESPONSE_BYTE_COUNT_ERROR = 9 00044 RESPONSE_CHECKSUM_ERROR = 10 00045 PARAMS_NO_CHANGE = 0 00046 PARAMS_CHANGE = 1 00047 00048 __slots__ = ['transaction','id','response_code','params_status','error_parameter_name'] 00049 _slot_types = ['uint16','uint16','uint16','uint8','uint8[32]'] 00050 00051 def __init__(self, *args, **kwds): 00052 """ 00053 Constructor. Any message fields that are implicitly/explicitly 00054 set to None will be assigned a default value. The recommend 00055 use is keyword arguments as this is more robust to future message 00056 changes. You cannot mix in-order arguments and keyword arguments. 00057 00058 The available fields are: 00059 transaction,id,response_code,params_status,error_parameter_name 00060 00061 @param args: complete set of field values, in .msg order 00062 @param kwds: use keyword arguments corresponding to message field names 00063 to set specific fields. 00064 """ 00065 if args or kwds: 00066 super(Ack, self).__init__(*args, **kwds) 00067 #message fields cannot be None, assign default values for those that are 00068 if self.transaction is None: 00069 self.transaction = 0 00070 if self.id is None: 00071 self.id = 0 00072 if self.response_code is None: 00073 self.response_code = 0 00074 if self.params_status is None: 00075 self.params_status = 0 00076 if self.error_parameter_name is None: 00077 self.error_parameter_name = chr(0)*32 00078 else: 00079 self.transaction = 0 00080 self.id = 0 00081 self.response_code = 0 00082 self.params_status = 0 00083 self.error_parameter_name = chr(0)*32 00084 00085 def _get_types(self): 00086 """ 00087 internal API method 00088 """ 00089 return self._slot_types 00090 00091 def serialize(self, buff): 00092 """ 00093 serialize message into buffer 00094 @param buff: buffer 00095 @type buff: StringIO 00096 """ 00097 try: 00098 _x = self 00099 buff.write(_struct_3HB.pack(_x.transaction, _x.id, _x.response_code, _x.params_status)) 00100 _x = self.error_parameter_name 00101 # - if encoded as a list instead, serialize as bytes instead of string 00102 if type(_x) in [list, tuple]: 00103 buff.write(_struct_32B.pack(*_x)) 00104 else: 00105 buff.write(_struct_32s.pack(_x)) 00106 except struct.error as se: self._check_types(se) 00107 except TypeError as te: self._check_types(te) 00108 00109 def deserialize(self, str): 00110 """ 00111 unpack serialized message in str into this message instance 00112 @param str: byte array of serialized message 00113 @type str: str 00114 """ 00115 try: 00116 end = 0 00117 _x = self 00118 start = end 00119 end += 7 00120 (_x.transaction, _x.id, _x.response_code, _x.params_status,) = _struct_3HB.unpack(str[start:end]) 00121 start = end 00122 end += 32 00123 self.error_parameter_name = str[start:end] 00124 return self 00125 except struct.error as e: 00126 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00127 00128 00129 def serialize_numpy(self, buff, numpy): 00130 """ 00131 serialize message with numpy array types into buffer 00132 @param buff: buffer 00133 @type buff: StringIO 00134 @param numpy: numpy python module 00135 @type numpy module 00136 """ 00137 try: 00138 _x = self 00139 buff.write(_struct_3HB.pack(_x.transaction, _x.id, _x.response_code, _x.params_status)) 00140 _x = self.error_parameter_name 00141 # - if encoded as a list instead, serialize as bytes instead of string 00142 if type(_x) in [list, tuple]: 00143 buff.write(_struct_32B.pack(*_x)) 00144 else: 00145 buff.write(_struct_32s.pack(_x)) 00146 except struct.error as se: self._check_types(se) 00147 except TypeError as te: self._check_types(te) 00148 00149 def deserialize_numpy(self, str, numpy): 00150 """ 00151 unpack serialized message in str into this message instance using numpy for array types 00152 @param str: byte array of serialized message 00153 @type str: str 00154 @param numpy: numpy python module 00155 @type numpy: module 00156 """ 00157 try: 00158 end = 0 00159 _x = self 00160 start = end 00161 end += 7 00162 (_x.transaction, _x.id, _x.response_code, _x.params_status,) = _struct_3HB.unpack(str[start:end]) 00163 start = end 00164 end += 32 00165 self.error_parameter_name = str[start:end] 00166 return self 00167 except struct.error as e: 00168 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00169 00170 _struct_I = roslib.message.struct_I 00171 _struct_32B = struct.Struct("<32B") 00172 _struct_32s = struct.Struct("<32s") 00173 _struct_3HB = struct.Struct("<3HB")