$search
00001 """autogenerated by genmsg_py from SetJointStiffnessRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class SetJointStiffnessRequest(roslib.message.Message): 00007 _md5sum = "3f30c4d99702f028fe1bef65668a3d21" 00008 _type = "cob_srvs/SetJointStiffnessRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """float32[] joint_stiffness 00011 00012 """ 00013 __slots__ = ['joint_stiffness'] 00014 _slot_types = ['float32[]'] 00015 00016 def __init__(self, *args, **kwds): 00017 """ 00018 Constructor. Any message fields that are implicitly/explicitly 00019 set to None will be assigned a default value. The recommend 00020 use is keyword arguments as this is more robust to future message 00021 changes. You cannot mix in-order arguments and keyword arguments. 00022 00023 The available fields are: 00024 joint_stiffness 00025 00026 @param args: complete set of field values, in .msg order 00027 @param kwds: use keyword arguments corresponding to message field names 00028 to set specific fields. 00029 """ 00030 if args or kwds: 00031 super(SetJointStiffnessRequest, self).__init__(*args, **kwds) 00032 #message fields cannot be None, assign default values for those that are 00033 if self.joint_stiffness is None: 00034 self.joint_stiffness = [] 00035 else: 00036 self.joint_stiffness = [] 00037 00038 def _get_types(self): 00039 """ 00040 internal API method 00041 """ 00042 return self._slot_types 00043 00044 def serialize(self, buff): 00045 """ 00046 serialize message into buffer 00047 @param buff: buffer 00048 @type buff: StringIO 00049 """ 00050 try: 00051 length = len(self.joint_stiffness) 00052 buff.write(_struct_I.pack(length)) 00053 pattern = '<%sf'%length 00054 buff.write(struct.pack(pattern, *self.joint_stiffness)) 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 (length,) = _struct_I.unpack(str[start:end]) 00069 pattern = '<%sf'%length 00070 start = end 00071 end += struct.calcsize(pattern) 00072 self.joint_stiffness = struct.unpack(pattern, str[start:end]) 00073 return self 00074 except struct.error as e: 00075 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00076 00077 00078 def serialize_numpy(self, buff, numpy): 00079 """ 00080 serialize message with numpy array types into buffer 00081 @param buff: buffer 00082 @type buff: StringIO 00083 @param numpy: numpy python module 00084 @type numpy module 00085 """ 00086 try: 00087 length = len(self.joint_stiffness) 00088 buff.write(_struct_I.pack(length)) 00089 pattern = '<%sf'%length 00090 buff.write(self.joint_stiffness.tostring()) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize_numpy(self, str, numpy): 00095 """ 00096 unpack serialized message in str into this message instance using numpy for array types 00097 @param str: byte array of serialized message 00098 @type str: str 00099 @param numpy: numpy python module 00100 @type numpy: module 00101 """ 00102 try: 00103 end = 0 00104 start = end 00105 end += 4 00106 (length,) = _struct_I.unpack(str[start:end]) 00107 pattern = '<%sf'%length 00108 start = end 00109 end += struct.calcsize(pattern) 00110 self.joint_stiffness = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00111 return self 00112 except struct.error as e: 00113 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00114 00115 _struct_I = roslib.message.struct_I 00116 """autogenerated by genmsg_py from SetJointStiffnessResponse.msg. Do not edit.""" 00117 import roslib.message 00118 import struct 00119 00120 import std_msgs.msg 00121 00122 class SetJointStiffnessResponse(roslib.message.Message): 00123 _md5sum = "bdad515e8f4c013bd650d3407753d2b8" 00124 _type = "cob_srvs/SetJointStiffnessResponse" 00125 _has_header = False #flag to mark the presence of a Header object 00126 _full_text = """std_msgs/Bool success 00127 std_msgs/String error_message 00128 00129 00130 ================================================================================ 00131 MSG: std_msgs/Bool 00132 bool data 00133 ================================================================================ 00134 MSG: std_msgs/String 00135 string data 00136 00137 """ 00138 __slots__ = ['success','error_message'] 00139 _slot_types = ['std_msgs/Bool','std_msgs/String'] 00140 00141 def __init__(self, *args, **kwds): 00142 """ 00143 Constructor. Any message fields that are implicitly/explicitly 00144 set to None will be assigned a default value. The recommend 00145 use is keyword arguments as this is more robust to future message 00146 changes. You cannot mix in-order arguments and keyword arguments. 00147 00148 The available fields are: 00149 success,error_message 00150 00151 @param args: complete set of field values, in .msg order 00152 @param kwds: use keyword arguments corresponding to message field names 00153 to set specific fields. 00154 """ 00155 if args or kwds: 00156 super(SetJointStiffnessResponse, self).__init__(*args, **kwds) 00157 #message fields cannot be None, assign default values for those that are 00158 if self.success is None: 00159 self.success = std_msgs.msg.Bool() 00160 if self.error_message is None: 00161 self.error_message = std_msgs.msg.String() 00162 else: 00163 self.success = std_msgs.msg.Bool() 00164 self.error_message = std_msgs.msg.String() 00165 00166 def _get_types(self): 00167 """ 00168 internal API method 00169 """ 00170 return self._slot_types 00171 00172 def serialize(self, buff): 00173 """ 00174 serialize message into buffer 00175 @param buff: buffer 00176 @type buff: StringIO 00177 """ 00178 try: 00179 buff.write(_struct_B.pack(self.success.data)) 00180 _x = self.error_message.data 00181 length = len(_x) 00182 buff.write(struct.pack('<I%ss'%length, length, _x)) 00183 except struct.error as se: self._check_types(se) 00184 except TypeError as te: self._check_types(te) 00185 00186 def deserialize(self, str): 00187 """ 00188 unpack serialized message in str into this message instance 00189 @param str: byte array of serialized message 00190 @type str: str 00191 """ 00192 try: 00193 if self.success is None: 00194 self.success = std_msgs.msg.Bool() 00195 if self.error_message is None: 00196 self.error_message = std_msgs.msg.String() 00197 end = 0 00198 start = end 00199 end += 1 00200 (self.success.data,) = _struct_B.unpack(str[start:end]) 00201 self.success.data = bool(self.success.data) 00202 start = end 00203 end += 4 00204 (length,) = _struct_I.unpack(str[start:end]) 00205 start = end 00206 end += length 00207 self.error_message.data = str[start:end] 00208 return self 00209 except struct.error as e: 00210 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00211 00212 00213 def serialize_numpy(self, buff, numpy): 00214 """ 00215 serialize message with numpy array types into buffer 00216 @param buff: buffer 00217 @type buff: StringIO 00218 @param numpy: numpy python module 00219 @type numpy module 00220 """ 00221 try: 00222 buff.write(_struct_B.pack(self.success.data)) 00223 _x = self.error_message.data 00224 length = len(_x) 00225 buff.write(struct.pack('<I%ss'%length, length, _x)) 00226 except struct.error as se: self._check_types(se) 00227 except TypeError as te: self._check_types(te) 00228 00229 def deserialize_numpy(self, str, numpy): 00230 """ 00231 unpack serialized message in str into this message instance using numpy for array types 00232 @param str: byte array of serialized message 00233 @type str: str 00234 @param numpy: numpy python module 00235 @type numpy: module 00236 """ 00237 try: 00238 if self.success is None: 00239 self.success = std_msgs.msg.Bool() 00240 if self.error_message is None: 00241 self.error_message = std_msgs.msg.String() 00242 end = 0 00243 start = end 00244 end += 1 00245 (self.success.data,) = _struct_B.unpack(str[start:end]) 00246 self.success.data = bool(self.success.data) 00247 start = end 00248 end += 4 00249 (length,) = _struct_I.unpack(str[start:end]) 00250 start = end 00251 end += length 00252 self.error_message.data = str[start:end] 00253 return self 00254 except struct.error as e: 00255 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00256 00257 _struct_I = roslib.message.struct_I 00258 _struct_B = struct.Struct("<B") 00259 class SetJointStiffness(roslib.message.ServiceDefinition): 00260 _type = 'cob_srvs/SetJointStiffness' 00261 _md5sum = '2ae9ddd5d3294ccf3c876d966e4e11a3' 00262 _request_class = SetJointStiffnessRequest 00263 _response_class = SetJointStiffnessResponse