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