_CartesianWrench.py
Go to the documentation of this file.
00001 """autogenerated by genpy from brics_actuator/CartesianWrench.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import brics_actuator.msg
00008 import genpy
00009 
00010 class CartesianWrench(genpy.Message):
00011   _md5sum = "9db8d24ea10e69de8feff86a9b0fa93d"
00012   _type = "brics_actuator/CartesianWrench"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """time timeStamp
00015 Poison poisonStamp
00016 string base_frame_uri
00017 string target_frame_uri
00018 # need some more frames?        
00019 CartesianVector force
00020 CartesianVector torque  
00021 
00022 ================================================================================
00023 MSG: brics_actuator/Poison
00024 string originator               # node id
00025 string description              # encoding still an issue
00026 float32 qos                     # reliability of the channel
00027                                 # 0..1 where 1 means healthy
00028 
00029 ================================================================================
00030 MSG: brics_actuator/CartesianVector
00031 string unit
00032 float64 x
00033 float64 y
00034 float64 z
00035 
00036 """
00037   __slots__ = ['timeStamp','poisonStamp','base_frame_uri','target_frame_uri','force','torque']
00038   _slot_types = ['time','brics_actuator/Poison','string','string','brics_actuator/CartesianVector','brics_actuator/CartesianVector']
00039 
00040   def __init__(self, *args, **kwds):
00041     """
00042     Constructor. Any message fields that are implicitly/explicitly
00043     set to None will be assigned a default value. The recommend
00044     use is keyword arguments as this is more robust to future message
00045     changes.  You cannot mix in-order arguments and keyword arguments.
00046 
00047     The available fields are:
00048        timeStamp,poisonStamp,base_frame_uri,target_frame_uri,force,torque
00049 
00050     :param args: complete set of field values, in .msg order
00051     :param kwds: use keyword arguments corresponding to message field names
00052     to set specific fields.
00053     """
00054     if args or kwds:
00055       super(CartesianWrench, self).__init__(*args, **kwds)
00056       #message fields cannot be None, assign default values for those that are
00057       if self.timeStamp is None:
00058         self.timeStamp = genpy.Time()
00059       if self.poisonStamp is None:
00060         self.poisonStamp = brics_actuator.msg.Poison()
00061       if self.base_frame_uri is None:
00062         self.base_frame_uri = ''
00063       if self.target_frame_uri is None:
00064         self.target_frame_uri = ''
00065       if self.force is None:
00066         self.force = brics_actuator.msg.CartesianVector()
00067       if self.torque is None:
00068         self.torque = brics_actuator.msg.CartesianVector()
00069     else:
00070       self.timeStamp = genpy.Time()
00071       self.poisonStamp = brics_actuator.msg.Poison()
00072       self.base_frame_uri = ''
00073       self.target_frame_uri = ''
00074       self.force = brics_actuator.msg.CartesianVector()
00075       self.torque = brics_actuator.msg.CartesianVector()
00076 
00077   def _get_types(self):
00078     """
00079     internal API method
00080     """
00081     return self._slot_types
00082 
00083   def serialize(self, buff):
00084     """
00085     serialize message into buffer
00086     :param buff: buffer, ``StringIO``
00087     """
00088     try:
00089       _x = self
00090       buff.write(_struct_2I.pack(_x.timeStamp.secs, _x.timeStamp.nsecs))
00091       _x = self.poisonStamp.originator
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097       _x = self.poisonStamp.description
00098       length = len(_x)
00099       if python3 or type(_x) == unicode:
00100         _x = _x.encode('utf-8')
00101         length = len(_x)
00102       buff.write(struct.pack('<I%ss'%length, length, _x))
00103       buff.write(_struct_f.pack(self.poisonStamp.qos))
00104       _x = self.base_frame_uri
00105       length = len(_x)
00106       if python3 or type(_x) == unicode:
00107         _x = _x.encode('utf-8')
00108         length = len(_x)
00109       buff.write(struct.pack('<I%ss'%length, length, _x))
00110       _x = self.target_frame_uri
00111       length = len(_x)
00112       if python3 or type(_x) == unicode:
00113         _x = _x.encode('utf-8')
00114         length = len(_x)
00115       buff.write(struct.pack('<I%ss'%length, length, _x))
00116       _x = self.force.unit
00117       length = len(_x)
00118       if python3 or type(_x) == unicode:
00119         _x = _x.encode('utf-8')
00120         length = len(_x)
00121       buff.write(struct.pack('<I%ss'%length, length, _x))
00122       _x = self
00123       buff.write(_struct_3d.pack(_x.force.x, _x.force.y, _x.force.z))
00124       _x = self.torque.unit
00125       length = len(_x)
00126       if python3 or type(_x) == unicode:
00127         _x = _x.encode('utf-8')
00128         length = len(_x)
00129       buff.write(struct.pack('<I%ss'%length, length, _x))
00130       _x = self
00131       buff.write(_struct_3d.pack(_x.torque.x, _x.torque.y, _x.torque.z))
00132     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00133     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00134 
00135   def deserialize(self, str):
00136     """
00137     unpack serialized message in str into this message instance
00138     :param str: byte array of serialized message, ``str``
00139     """
00140     try:
00141       if self.timeStamp is None:
00142         self.timeStamp = genpy.Time()
00143       if self.poisonStamp is None:
00144         self.poisonStamp = brics_actuator.msg.Poison()
00145       if self.force is None:
00146         self.force = brics_actuator.msg.CartesianVector()
00147       if self.torque is None:
00148         self.torque = brics_actuator.msg.CartesianVector()
00149       end = 0
00150       _x = self
00151       start = end
00152       end += 8
00153       (_x.timeStamp.secs, _x.timeStamp.nsecs,) = _struct_2I.unpack(str[start:end])
00154       start = end
00155       end += 4
00156       (length,) = _struct_I.unpack(str[start:end])
00157       start = end
00158       end += length
00159       if python3:
00160         self.poisonStamp.originator = str[start:end].decode('utf-8')
00161       else:
00162         self.poisonStamp.originator = str[start:end]
00163       start = end
00164       end += 4
00165       (length,) = _struct_I.unpack(str[start:end])
00166       start = end
00167       end += length
00168       if python3:
00169         self.poisonStamp.description = str[start:end].decode('utf-8')
00170       else:
00171         self.poisonStamp.description = str[start:end]
00172       start = end
00173       end += 4
00174       (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end])
00175       start = end
00176       end += 4
00177       (length,) = _struct_I.unpack(str[start:end])
00178       start = end
00179       end += length
00180       if python3:
00181         self.base_frame_uri = str[start:end].decode('utf-8')
00182       else:
00183         self.base_frame_uri = str[start:end]
00184       start = end
00185       end += 4
00186       (length,) = _struct_I.unpack(str[start:end])
00187       start = end
00188       end += length
00189       if python3:
00190         self.target_frame_uri = str[start:end].decode('utf-8')
00191       else:
00192         self.target_frame_uri = str[start:end]
00193       start = end
00194       end += 4
00195       (length,) = _struct_I.unpack(str[start:end])
00196       start = end
00197       end += length
00198       if python3:
00199         self.force.unit = str[start:end].decode('utf-8')
00200       else:
00201         self.force.unit = str[start:end]
00202       _x = self
00203       start = end
00204       end += 24
00205       (_x.force.x, _x.force.y, _x.force.z,) = _struct_3d.unpack(str[start:end])
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       start = end
00210       end += length
00211       if python3:
00212         self.torque.unit = str[start:end].decode('utf-8')
00213       else:
00214         self.torque.unit = str[start:end]
00215       _x = self
00216       start = end
00217       end += 24
00218       (_x.torque.x, _x.torque.y, _x.torque.z,) = _struct_3d.unpack(str[start:end])
00219       self.timeStamp.canon()
00220       return self
00221     except struct.error as e:
00222       raise genpy.DeserializationError(e) #most likely buffer underfill
00223 
00224 
00225   def serialize_numpy(self, buff, numpy):
00226     """
00227     serialize message with numpy array types into buffer
00228     :param buff: buffer, ``StringIO``
00229     :param numpy: numpy python module
00230     """
00231     try:
00232       _x = self
00233       buff.write(_struct_2I.pack(_x.timeStamp.secs, _x.timeStamp.nsecs))
00234       _x = self.poisonStamp.originator
00235       length = len(_x)
00236       if python3 or type(_x) == unicode:
00237         _x = _x.encode('utf-8')
00238         length = len(_x)
00239       buff.write(struct.pack('<I%ss'%length, length, _x))
00240       _x = self.poisonStamp.description
00241       length = len(_x)
00242       if python3 or type(_x) == unicode:
00243         _x = _x.encode('utf-8')
00244         length = len(_x)
00245       buff.write(struct.pack('<I%ss'%length, length, _x))
00246       buff.write(_struct_f.pack(self.poisonStamp.qos))
00247       _x = self.base_frame_uri
00248       length = len(_x)
00249       if python3 or type(_x) == unicode:
00250         _x = _x.encode('utf-8')
00251         length = len(_x)
00252       buff.write(struct.pack('<I%ss'%length, length, _x))
00253       _x = self.target_frame_uri
00254       length = len(_x)
00255       if python3 or type(_x) == unicode:
00256         _x = _x.encode('utf-8')
00257         length = len(_x)
00258       buff.write(struct.pack('<I%ss'%length, length, _x))
00259       _x = self.force.unit
00260       length = len(_x)
00261       if python3 or type(_x) == unicode:
00262         _x = _x.encode('utf-8')
00263         length = len(_x)
00264       buff.write(struct.pack('<I%ss'%length, length, _x))
00265       _x = self
00266       buff.write(_struct_3d.pack(_x.force.x, _x.force.y, _x.force.z))
00267       _x = self.torque.unit
00268       length = len(_x)
00269       if python3 or type(_x) == unicode:
00270         _x = _x.encode('utf-8')
00271         length = len(_x)
00272       buff.write(struct.pack('<I%ss'%length, length, _x))
00273       _x = self
00274       buff.write(_struct_3d.pack(_x.torque.x, _x.torque.y, _x.torque.z))
00275     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00276     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00277 
00278   def deserialize_numpy(self, str, numpy):
00279     """
00280     unpack serialized message in str into this message instance using numpy for array types
00281     :param str: byte array of serialized message, ``str``
00282     :param numpy: numpy python module
00283     """
00284     try:
00285       if self.timeStamp is None:
00286         self.timeStamp = genpy.Time()
00287       if self.poisonStamp is None:
00288         self.poisonStamp = brics_actuator.msg.Poison()
00289       if self.force is None:
00290         self.force = brics_actuator.msg.CartesianVector()
00291       if self.torque is None:
00292         self.torque = brics_actuator.msg.CartesianVector()
00293       end = 0
00294       _x = self
00295       start = end
00296       end += 8
00297       (_x.timeStamp.secs, _x.timeStamp.nsecs,) = _struct_2I.unpack(str[start:end])
00298       start = end
00299       end += 4
00300       (length,) = _struct_I.unpack(str[start:end])
00301       start = end
00302       end += length
00303       if python3:
00304         self.poisonStamp.originator = str[start:end].decode('utf-8')
00305       else:
00306         self.poisonStamp.originator = str[start:end]
00307       start = end
00308       end += 4
00309       (length,) = _struct_I.unpack(str[start:end])
00310       start = end
00311       end += length
00312       if python3:
00313         self.poisonStamp.description = str[start:end].decode('utf-8')
00314       else:
00315         self.poisonStamp.description = str[start:end]
00316       start = end
00317       end += 4
00318       (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end])
00319       start = end
00320       end += 4
00321       (length,) = _struct_I.unpack(str[start:end])
00322       start = end
00323       end += length
00324       if python3:
00325         self.base_frame_uri = str[start:end].decode('utf-8')
00326       else:
00327         self.base_frame_uri = str[start:end]
00328       start = end
00329       end += 4
00330       (length,) = _struct_I.unpack(str[start:end])
00331       start = end
00332       end += length
00333       if python3:
00334         self.target_frame_uri = str[start:end].decode('utf-8')
00335       else:
00336         self.target_frame_uri = str[start:end]
00337       start = end
00338       end += 4
00339       (length,) = _struct_I.unpack(str[start:end])
00340       start = end
00341       end += length
00342       if python3:
00343         self.force.unit = str[start:end].decode('utf-8')
00344       else:
00345         self.force.unit = str[start:end]
00346       _x = self
00347       start = end
00348       end += 24
00349       (_x.force.x, _x.force.y, _x.force.z,) = _struct_3d.unpack(str[start:end])
00350       start = end
00351       end += 4
00352       (length,) = _struct_I.unpack(str[start:end])
00353       start = end
00354       end += length
00355       if python3:
00356         self.torque.unit = str[start:end].decode('utf-8')
00357       else:
00358         self.torque.unit = str[start:end]
00359       _x = self
00360       start = end
00361       end += 24
00362       (_x.torque.x, _x.torque.y, _x.torque.z,) = _struct_3d.unpack(str[start:end])
00363       self.timeStamp.canon()
00364       return self
00365     except struct.error as e:
00366       raise genpy.DeserializationError(e) #most likely buffer underfill
00367 
00368 _struct_I = genpy.struct_I
00369 _struct_3d = struct.Struct("<3d")
00370 _struct_2I = struct.Struct("<2I")
00371 _struct_f = struct.Struct("<f")


brics_actuator
Author(s): Alexander Bubeck
autogenerated on Sun Oct 5 2014 22:58:19