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