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


cob_srvs
Author(s): Florian Weisshardt
autogenerated on Sun Oct 5 2014 22:58:03