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