_ConfigurationSpecificationGroup.py
Go to the documentation of this file.
00001 """autogenerated by genpy from openraveros/ConfigurationSpecificationGroup.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 ConfigurationSpecificationGroup(genpy.Message):
00009   _md5sum = "ce27ddd3c58fec6bf2c8cf22b7192326"
00010   _type = "openraveros/ConfigurationSpecificationGroup"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int32 offset
00013 int32 dof
00014 string name
00015 string interpolation
00016 
00017 """
00018   __slots__ = ['offset','dof','name','interpolation']
00019   _slot_types = ['int32','int32','string','string']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        offset,dof,name,interpolation
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(ConfigurationSpecificationGroup, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.offset is None:
00039         self.offset = 0
00040       if self.dof is None:
00041         self.dof = 0
00042       if self.name is None:
00043         self.name = ''
00044       if self.interpolation is None:
00045         self.interpolation = ''
00046     else:
00047       self.offset = 0
00048       self.dof = 0
00049       self.name = ''
00050       self.interpolation = ''
00051 
00052   def _get_types(self):
00053     """
00054     internal API method
00055     """
00056     return self._slot_types
00057 
00058   def serialize(self, buff):
00059     """
00060     serialize message into buffer
00061     :param buff: buffer, ``StringIO``
00062     """
00063     try:
00064       _x = self
00065       buff.write(_struct_2i.pack(_x.offset, _x.dof))
00066       _x = self.name
00067       length = len(_x)
00068       if python3 or type(_x) == unicode:
00069         _x = _x.encode('utf-8')
00070         length = len(_x)
00071       buff.write(struct.pack('<I%ss'%length, length, _x))
00072       _x = self.interpolation
00073       length = len(_x)
00074       if python3 or type(_x) == unicode:
00075         _x = _x.encode('utf-8')
00076         length = len(_x)
00077       buff.write(struct.pack('<I%ss'%length, length, _x))
00078     except struct.error as se: self._check_types(se)
00079     except TypeError as te: self._check_types(te)
00080 
00081   def deserialize(self, str):
00082     """
00083     unpack serialized message in str into this message instance
00084     :param str: byte array of serialized message, ``str``
00085     """
00086     try:
00087       end = 0
00088       _x = self
00089       start = end
00090       end += 8
00091       (_x.offset, _x.dof,) = _struct_2i.unpack(str[start:end])
00092       start = end
00093       end += 4
00094       (length,) = _struct_I.unpack(str[start:end])
00095       start = end
00096       end += length
00097       if python3:
00098         self.name = str[start:end].decode('utf-8')
00099       else:
00100         self.name = str[start:end]
00101       start = end
00102       end += 4
00103       (length,) = _struct_I.unpack(str[start:end])
00104       start = end
00105       end += length
00106       if python3:
00107         self.interpolation = str[start:end].decode('utf-8')
00108       else:
00109         self.interpolation = str[start:end]
00110       return self
00111     except struct.error as e:
00112       raise genpy.DeserializationError(e) #most likely buffer underfill
00113 
00114 
00115   def serialize_numpy(self, buff, numpy):
00116     """
00117     serialize message with numpy array types into buffer
00118     :param buff: buffer, ``StringIO``
00119     :param numpy: numpy python module
00120     """
00121     try:
00122       _x = self
00123       buff.write(_struct_2i.pack(_x.offset, _x.dof))
00124       _x = self.name
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.interpolation
00131       length = len(_x)
00132       if python3 or type(_x) == unicode:
00133         _x = _x.encode('utf-8')
00134         length = len(_x)
00135       buff.write(struct.pack('<I%ss'%length, length, _x))
00136     except struct.error as se: self._check_types(se)
00137     except TypeError as te: self._check_types(te)
00138 
00139   def deserialize_numpy(self, str, numpy):
00140     """
00141     unpack serialized message in str into this message instance using numpy for array types
00142     :param str: byte array of serialized message, ``str``
00143     :param numpy: numpy python module
00144     """
00145     try:
00146       end = 0
00147       _x = self
00148       start = end
00149       end += 8
00150       (_x.offset, _x.dof,) = _struct_2i.unpack(str[start:end])
00151       start = end
00152       end += 4
00153       (length,) = _struct_I.unpack(str[start:end])
00154       start = end
00155       end += length
00156       if python3:
00157         self.name = str[start:end].decode('utf-8')
00158       else:
00159         self.name = str[start:end]
00160       start = end
00161       end += 4
00162       (length,) = _struct_I.unpack(str[start:end])
00163       start = end
00164       end += length
00165       if python3:
00166         self.interpolation = str[start:end].decode('utf-8')
00167       else:
00168         self.interpolation = str[start:end]
00169       return self
00170     except struct.error as e:
00171       raise genpy.DeserializationError(e) #most likely buffer underfill
00172 
00173 _struct_I = genpy.struct_I
00174 _struct_2i = struct.Struct("<2i")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


openraveros
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 22:15:38