$search
00001 """autogenerated by genmsg_py from ChangeControlTypeRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import sr_robot_msgs.msg 00006 00007 class ChangeControlTypeRequest(roslib.message.Message): 00008 _md5sum = "69fffaeba377b18d307bd4ce65536c13" 00009 _type = "sr_robot_msgs/ChangeControlTypeRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """ControlType control_type 00012 00013 ================================================================================ 00014 MSG: sr_robot_msgs/ControlType 00015 int16 control_type 00016 00017 int16 PWM=0 00018 int16 FORCE=1 00019 """ 00020 __slots__ = ['control_type'] 00021 _slot_types = ['sr_robot_msgs/ControlType'] 00022 00023 def __init__(self, *args, **kwds): 00024 """ 00025 Constructor. Any message fields that are implicitly/explicitly 00026 set to None will be assigned a default value. The recommend 00027 use is keyword arguments as this is more robust to future message 00028 changes. You cannot mix in-order arguments and keyword arguments. 00029 00030 The available fields are: 00031 control_type 00032 00033 @param args: complete set of field values, in .msg order 00034 @param kwds: use keyword arguments corresponding to message field names 00035 to set specific fields. 00036 """ 00037 if args or kwds: 00038 super(ChangeControlTypeRequest, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.control_type is None: 00041 self.control_type = sr_robot_msgs.msg.ControlType() 00042 else: 00043 self.control_type = sr_robot_msgs.msg.ControlType() 00044 00045 def _get_types(self): 00046 """ 00047 internal API method 00048 """ 00049 return self._slot_types 00050 00051 def serialize(self, buff): 00052 """ 00053 serialize message into buffer 00054 @param buff: buffer 00055 @type buff: StringIO 00056 """ 00057 try: 00058 buff.write(_struct_h.pack(self.control_type.control_type)) 00059 except struct.error as se: self._check_types(se) 00060 except TypeError as te: self._check_types(te) 00061 00062 def deserialize(self, str): 00063 """ 00064 unpack serialized message in str into this message instance 00065 @param str: byte array of serialized message 00066 @type str: str 00067 """ 00068 try: 00069 if self.control_type is None: 00070 self.control_type = sr_robot_msgs.msg.ControlType() 00071 end = 0 00072 start = end 00073 end += 2 00074 (self.control_type.control_type,) = _struct_h.unpack(str[start:end]) 00075 return self 00076 except struct.error as e: 00077 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00078 00079 00080 def serialize_numpy(self, buff, numpy): 00081 """ 00082 serialize message with numpy array types into buffer 00083 @param buff: buffer 00084 @type buff: StringIO 00085 @param numpy: numpy python module 00086 @type numpy module 00087 """ 00088 try: 00089 buff.write(_struct_h.pack(self.control_type.control_type)) 00090 except struct.error as se: self._check_types(se) 00091 except TypeError as te: self._check_types(te) 00092 00093 def deserialize_numpy(self, str, numpy): 00094 """ 00095 unpack serialized message in str into this message instance using numpy for array types 00096 @param str: byte array of serialized message 00097 @type str: str 00098 @param numpy: numpy python module 00099 @type numpy: module 00100 """ 00101 try: 00102 if self.control_type is None: 00103 self.control_type = sr_robot_msgs.msg.ControlType() 00104 end = 0 00105 start = end 00106 end += 2 00107 (self.control_type.control_type,) = _struct_h.unpack(str[start:end]) 00108 return self 00109 except struct.error as e: 00110 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00111 00112 _struct_I = roslib.message.struct_I 00113 _struct_h = struct.Struct("<h") 00114 """autogenerated by genmsg_py from ChangeControlTypeResponse.msg. Do not edit.""" 00115 import roslib.message 00116 import struct 00117 00118 import sr_robot_msgs.msg 00119 00120 class ChangeControlTypeResponse(roslib.message.Message): 00121 _md5sum = "149802f62d62361cd3f9f9faa0c637bc" 00122 _type = "sr_robot_msgs/ChangeControlTypeResponse" 00123 _has_header = False #flag to mark the presence of a Header object 00124 _full_text = """ControlType result 00125 00126 ================================================================================ 00127 MSG: sr_robot_msgs/ControlType 00128 int16 control_type 00129 00130 int16 PWM=0 00131 int16 FORCE=1 00132 """ 00133 __slots__ = ['result'] 00134 _slot_types = ['sr_robot_msgs/ControlType'] 00135 00136 def __init__(self, *args, **kwds): 00137 """ 00138 Constructor. Any message fields that are implicitly/explicitly 00139 set to None will be assigned a default value. The recommend 00140 use is keyword arguments as this is more robust to future message 00141 changes. You cannot mix in-order arguments and keyword arguments. 00142 00143 The available fields are: 00144 result 00145 00146 @param args: complete set of field values, in .msg order 00147 @param kwds: use keyword arguments corresponding to message field names 00148 to set specific fields. 00149 """ 00150 if args or kwds: 00151 super(ChangeControlTypeResponse, self).__init__(*args, **kwds) 00152 #message fields cannot be None, assign default values for those that are 00153 if self.result is None: 00154 self.result = sr_robot_msgs.msg.ControlType() 00155 else: 00156 self.result = sr_robot_msgs.msg.ControlType() 00157 00158 def _get_types(self): 00159 """ 00160 internal API method 00161 """ 00162 return self._slot_types 00163 00164 def serialize(self, buff): 00165 """ 00166 serialize message into buffer 00167 @param buff: buffer 00168 @type buff: StringIO 00169 """ 00170 try: 00171 buff.write(_struct_h.pack(self.result.control_type)) 00172 except struct.error as se: self._check_types(se) 00173 except TypeError as te: self._check_types(te) 00174 00175 def deserialize(self, str): 00176 """ 00177 unpack serialized message in str into this message instance 00178 @param str: byte array of serialized message 00179 @type str: str 00180 """ 00181 try: 00182 if self.result is None: 00183 self.result = sr_robot_msgs.msg.ControlType() 00184 end = 0 00185 start = end 00186 end += 2 00187 (self.result.control_type,) = _struct_h.unpack(str[start:end]) 00188 return self 00189 except struct.error as e: 00190 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00191 00192 00193 def serialize_numpy(self, buff, numpy): 00194 """ 00195 serialize message with numpy array types into buffer 00196 @param buff: buffer 00197 @type buff: StringIO 00198 @param numpy: numpy python module 00199 @type numpy module 00200 """ 00201 try: 00202 buff.write(_struct_h.pack(self.result.control_type)) 00203 except struct.error as se: self._check_types(se) 00204 except TypeError as te: self._check_types(te) 00205 00206 def deserialize_numpy(self, str, numpy): 00207 """ 00208 unpack serialized message in str into this message instance using numpy for array types 00209 @param str: byte array of serialized message 00210 @type str: str 00211 @param numpy: numpy python module 00212 @type numpy: module 00213 """ 00214 try: 00215 if self.result is None: 00216 self.result = sr_robot_msgs.msg.ControlType() 00217 end = 0 00218 start = end 00219 end += 2 00220 (self.result.control_type,) = _struct_h.unpack(str[start:end]) 00221 return self 00222 except struct.error as e: 00223 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00224 00225 _struct_I = roslib.message.struct_I 00226 _struct_h = struct.Struct("<h") 00227 class ChangeControlType(roslib.message.ServiceDefinition): 00228 _type = 'sr_robot_msgs/ChangeControlType' 00229 _md5sum = 'ac3ec0a68c75634618a1c4f579171ff8' 00230 _request_class = ChangeControlTypeRequest 00231 _response_class = ChangeControlTypeResponse