00001 """autogenerated by genmsg_py from LSPBTrajectoryMsg.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006 import spline_smoother.msg
00007 import std_msgs.msg
00008
00009 class LSPBTrajectoryMsg(roslib.message.Message):
00010 _md5sum = "ce1139991f603c3d37b77cd9b60c5c3d"
00011 _type = "spline_smoother/LSPBTrajectoryMsg"
00012 _has_header = True
00013 _full_text = """Header header
00014 string[] names
00015 LSPBTrajectorySegmentMsg[] segments
00016
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data
00021 # in a particular coordinate frame.
00022 #
00023 # sequence ID: consecutively increasing ID
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034
00035 ================================================================================
00036 MSG: spline_smoother/LSPBTrajectorySegmentMsg
00037 duration duration
00038 LSPBSplineCoefficients[] joints
00039
00040 ================================================================================
00041 MSG: spline_smoother/LSPBSplineCoefficients
00042 float64[] coefficients
00043 float64 linear_segment_duration
00044 float64 quadratic_segment_duration
00045 """
00046 __slots__ = ['header','names','segments']
00047 _slot_types = ['Header','string[]','spline_smoother/LSPBTrajectorySegmentMsg[]']
00048
00049 def __init__(self, *args, **kwds):
00050 """
00051 Constructor. Any message fields that are implicitly/explicitly
00052 set to None will be assigned a default value. The recommend
00053 use is keyword arguments as this is more robust to future message
00054 changes. You cannot mix in-order arguments and keyword arguments.
00055
00056 The available fields are:
00057 header,names,segments
00058
00059 @param args: complete set of field values, in .msg order
00060 @param kwds: use keyword arguments corresponding to message field names
00061 to set specific fields.
00062 """
00063 if args or kwds:
00064 super(LSPBTrajectoryMsg, self).__init__(*args, **kwds)
00065
00066 if self.header is None:
00067 self.header = std_msgs.msg._Header.Header()
00068 if self.names is None:
00069 self.names = []
00070 if self.segments is None:
00071 self.segments = []
00072 else:
00073 self.header = std_msgs.msg._Header.Header()
00074 self.names = []
00075 self.segments = []
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
00087 @type buff: StringIO
00088 """
00089 try:
00090 _x = self
00091 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00092 _x = self.header.frame_id
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 length = len(self.names)
00096 buff.write(_struct_I.pack(length))
00097 for val1 in self.names:
00098 length = len(val1)
00099 buff.write(struct.pack('<I%ss'%length, length, val1))
00100 length = len(self.segments)
00101 buff.write(_struct_I.pack(length))
00102 for val1 in self.segments:
00103 _v1 = val1.duration
00104 _x = _v1
00105 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00106 length = len(val1.joints)
00107 buff.write(_struct_I.pack(length))
00108 for val2 in val1.joints:
00109 length = len(val2.coefficients)
00110 buff.write(_struct_I.pack(length))
00111 pattern = '<%sd'%length
00112 buff.write(struct.pack(pattern, *val2.coefficients))
00113 _x = val2
00114 buff.write(_struct_2d.pack(_x.linear_segment_duration, _x.quadratic_segment_duration))
00115 except struct.error, se: self._check_types(se)
00116 except TypeError, te: self._check_types(te)
00117
00118 def deserialize(self, str):
00119 """
00120 unpack serialized message in str into this message instance
00121 @param str: byte array of serialized message
00122 @type str: str
00123 """
00124 try:
00125 if self.header is None:
00126 self.header = std_msgs.msg._Header.Header()
00127 end = 0
00128 _x = self
00129 start = end
00130 end += 12
00131 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00132 start = end
00133 end += 4
00134 (length,) = _struct_I.unpack(str[start:end])
00135 start = end
00136 end += length
00137 self.header.frame_id = str[start:end]
00138 start = end
00139 end += 4
00140 (length,) = _struct_I.unpack(str[start:end])
00141 self.names = []
00142 for i in xrange(0, length):
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 start = end
00147 end += length
00148 val1 = str[start:end]
00149 self.names.append(val1)
00150 start = end
00151 end += 4
00152 (length,) = _struct_I.unpack(str[start:end])
00153 self.segments = []
00154 for i in xrange(0, length):
00155 val1 = spline_smoother.msg.LSPBTrajectorySegmentMsg()
00156 _v2 = val1.duration
00157 _x = _v2
00158 start = end
00159 end += 8
00160 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 val1.joints = []
00165 for i in xrange(0, length):
00166 val2 = spline_smoother.msg.LSPBSplineCoefficients()
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 pattern = '<%sd'%length
00171 start = end
00172 end += struct.calcsize(pattern)
00173 val2.coefficients = struct.unpack(pattern, str[start:end])
00174 _x = val2
00175 start = end
00176 end += 16
00177 (_x.linear_segment_duration, _x.quadratic_segment_duration,) = _struct_2d.unpack(str[start:end])
00178 val1.joints.append(val2)
00179 self.segments.append(val1)
00180 return self
00181 except struct.error, e:
00182 raise roslib.message.DeserializationError(e)
00183
00184
00185 def serialize_numpy(self, buff, numpy):
00186 """
00187 serialize message with numpy array types into buffer
00188 @param buff: buffer
00189 @type buff: StringIO
00190 @param numpy: numpy python module
00191 @type numpy module
00192 """
00193 try:
00194 _x = self
00195 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00196 _x = self.header.frame_id
00197 length = len(_x)
00198 buff.write(struct.pack('<I%ss'%length, length, _x))
00199 length = len(self.names)
00200 buff.write(_struct_I.pack(length))
00201 for val1 in self.names:
00202 length = len(val1)
00203 buff.write(struct.pack('<I%ss'%length, length, val1))
00204 length = len(self.segments)
00205 buff.write(_struct_I.pack(length))
00206 for val1 in self.segments:
00207 _v3 = val1.duration
00208 _x = _v3
00209 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00210 length = len(val1.joints)
00211 buff.write(_struct_I.pack(length))
00212 for val2 in val1.joints:
00213 length = len(val2.coefficients)
00214 buff.write(_struct_I.pack(length))
00215 pattern = '<%sd'%length
00216 buff.write(val2.coefficients.tostring())
00217 _x = val2
00218 buff.write(_struct_2d.pack(_x.linear_segment_duration, _x.quadratic_segment_duration))
00219 except struct.error, se: self._check_types(se)
00220 except TypeError, te: self._check_types(te)
00221
00222 def deserialize_numpy(self, str, numpy):
00223 """
00224 unpack serialized message in str into this message instance using numpy for array types
00225 @param str: byte array of serialized message
00226 @type str: str
00227 @param numpy: numpy python module
00228 @type numpy: module
00229 """
00230 try:
00231 if self.header is None:
00232 self.header = std_msgs.msg._Header.Header()
00233 end = 0
00234 _x = self
00235 start = end
00236 end += 12
00237 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00238 start = end
00239 end += 4
00240 (length,) = _struct_I.unpack(str[start:end])
00241 start = end
00242 end += length
00243 self.header.frame_id = str[start:end]
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 self.names = []
00248 for i in xrange(0, length):
00249 start = end
00250 end += 4
00251 (length,) = _struct_I.unpack(str[start:end])
00252 start = end
00253 end += length
00254 val1 = str[start:end]
00255 self.names.append(val1)
00256 start = end
00257 end += 4
00258 (length,) = _struct_I.unpack(str[start:end])
00259 self.segments = []
00260 for i in xrange(0, length):
00261 val1 = spline_smoother.msg.LSPBTrajectorySegmentMsg()
00262 _v4 = val1.duration
00263 _x = _v4
00264 start = end
00265 end += 8
00266 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 val1.joints = []
00271 for i in xrange(0, length):
00272 val2 = spline_smoother.msg.LSPBSplineCoefficients()
00273 start = end
00274 end += 4
00275 (length,) = _struct_I.unpack(str[start:end])
00276 pattern = '<%sd'%length
00277 start = end
00278 end += struct.calcsize(pattern)
00279 val2.coefficients = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00280 _x = val2
00281 start = end
00282 end += 16
00283 (_x.linear_segment_duration, _x.quadratic_segment_duration,) = _struct_2d.unpack(str[start:end])
00284 val1.joints.append(val2)
00285 self.segments.append(val1)
00286 return self
00287 except struct.error, e:
00288 raise roslib.message.DeserializationError(e)
00289
00290 _struct_I = roslib.message.struct_I
00291 _struct_2d = struct.Struct("<2d")
00292 _struct_3I = struct.Struct("<3I")
00293 _struct_2i = struct.Struct("<2i")