00001 """autogenerated by genpy from pr2_msgs/SetLaserTrajCmdRequest.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 genpy
00008 import pr2_msgs.msg
00009 import std_msgs.msg
00010
00011 class SetLaserTrajCmdRequest(genpy.Message):
00012 _md5sum = "83f915c37d36f61442c752779261e7d4"
00013 _type = "pr2_msgs/SetLaserTrajCmdRequest"
00014 _has_header = False
00015 _full_text = """pr2_msgs/LaserTrajCmd command
00016
00017 ================================================================================
00018 MSG: pr2_msgs/LaserTrajCmd
00019 # This message is used to set the profile that the tilt laser controller
00020 # executes.
00021 Header header
00022 string profile # options are currently "linear" or "linear_blended"
00023 float64[] position # Laser positions
00024 duration[] time_from_start # Times to reach laser positions in seconds
00025 float64 max_velocity # Set <= 0 to use default
00026 float64 max_acceleration # Set <= 0 to use default
00027
00028 ================================================================================
00029 MSG: std_msgs/Header
00030 # Standard metadata for higher-level stamped data types.
00031 # This is generally used to communicate timestamped data
00032 # in a particular coordinate frame.
00033 #
00034 # sequence ID: consecutively increasing ID
00035 uint32 seq
00036 #Two-integer timestamp that is expressed as:
00037 # * stamp.secs: seconds (stamp_secs) since epoch
00038 # * stamp.nsecs: nanoseconds since stamp_secs
00039 # time-handling sugar is provided by the client library
00040 time stamp
00041 #Frame this data is associated with
00042 # 0: no frame
00043 # 1: global frame
00044 string frame_id
00045
00046 """
00047 __slots__ = ['command']
00048 _slot_types = ['pr2_msgs/LaserTrajCmd']
00049
00050 def __init__(self, *args, **kwds):
00051 """
00052 Constructor. Any message fields that are implicitly/explicitly
00053 set to None will be assigned a default value. The recommend
00054 use is keyword arguments as this is more robust to future message
00055 changes. You cannot mix in-order arguments and keyword arguments.
00056
00057 The available fields are:
00058 command
00059
00060 :param args: complete set of field values, in .msg order
00061 :param kwds: use keyword arguments corresponding to message field names
00062 to set specific fields.
00063 """
00064 if args or kwds:
00065 super(SetLaserTrajCmdRequest, self).__init__(*args, **kwds)
00066
00067 if self.command is None:
00068 self.command = pr2_msgs.msg.LaserTrajCmd()
00069 else:
00070 self.command = pr2_msgs.msg.LaserTrajCmd()
00071
00072 def _get_types(self):
00073 """
00074 internal API method
00075 """
00076 return self._slot_types
00077
00078 def serialize(self, buff):
00079 """
00080 serialize message into buffer
00081 :param buff: buffer, ``StringIO``
00082 """
00083 try:
00084 _x = self
00085 buff.write(_struct_3I.pack(_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs))
00086 _x = self.command.header.frame_id
00087 length = len(_x)
00088 if python3 or type(_x) == unicode:
00089 _x = _x.encode('utf-8')
00090 length = len(_x)
00091 buff.write(struct.pack('<I%ss'%length, length, _x))
00092 _x = self.command.profile
00093 length = len(_x)
00094 if python3 or type(_x) == unicode:
00095 _x = _x.encode('utf-8')
00096 length = len(_x)
00097 buff.write(struct.pack('<I%ss'%length, length, _x))
00098 length = len(self.command.position)
00099 buff.write(_struct_I.pack(length))
00100 pattern = '<%sd'%length
00101 buff.write(struct.pack(pattern, *self.command.position))
00102 length = len(self.command.time_from_start)
00103 buff.write(_struct_I.pack(length))
00104 for val1 in self.command.time_from_start:
00105 _x = val1
00106 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00107 _x = self
00108 buff.write(_struct_2d.pack(_x.command.max_velocity, _x.command.max_acceleration))
00109 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00110 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00111
00112 def deserialize(self, str):
00113 """
00114 unpack serialized message in str into this message instance
00115 :param str: byte array of serialized message, ``str``
00116 """
00117 try:
00118 if self.command is None:
00119 self.command = pr2_msgs.msg.LaserTrajCmd()
00120 end = 0
00121 _x = self
00122 start = end
00123 end += 12
00124 (_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00125 start = end
00126 end += 4
00127 (length,) = _struct_I.unpack(str[start:end])
00128 start = end
00129 end += length
00130 if python3:
00131 self.command.header.frame_id = str[start:end].decode('utf-8')
00132 else:
00133 self.command.header.frame_id = str[start:end]
00134 start = end
00135 end += 4
00136 (length,) = _struct_I.unpack(str[start:end])
00137 start = end
00138 end += length
00139 if python3:
00140 self.command.profile = str[start:end].decode('utf-8')
00141 else:
00142 self.command.profile = str[start:end]
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 pattern = '<%sd'%length
00147 start = end
00148 end += struct.calcsize(pattern)
00149 self.command.position = struct.unpack(pattern, str[start:end])
00150 start = end
00151 end += 4
00152 (length,) = _struct_I.unpack(str[start:end])
00153 self.command.time_from_start = []
00154 for i in range(0, length):
00155 val1 = genpy.Duration()
00156 _x = val1
00157 start = end
00158 end += 8
00159 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00160 self.command.time_from_start.append(val1)
00161 _x = self
00162 start = end
00163 end += 16
00164 (_x.command.max_velocity, _x.command.max_acceleration,) = _struct_2d.unpack(str[start:end])
00165 return self
00166 except struct.error as e:
00167 raise genpy.DeserializationError(e)
00168
00169
00170 def serialize_numpy(self, buff, numpy):
00171 """
00172 serialize message with numpy array types into buffer
00173 :param buff: buffer, ``StringIO``
00174 :param numpy: numpy python module
00175 """
00176 try:
00177 _x = self
00178 buff.write(_struct_3I.pack(_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs))
00179 _x = self.command.header.frame_id
00180 length = len(_x)
00181 if python3 or type(_x) == unicode:
00182 _x = _x.encode('utf-8')
00183 length = len(_x)
00184 buff.write(struct.pack('<I%ss'%length, length, _x))
00185 _x = self.command.profile
00186 length = len(_x)
00187 if python3 or type(_x) == unicode:
00188 _x = _x.encode('utf-8')
00189 length = len(_x)
00190 buff.write(struct.pack('<I%ss'%length, length, _x))
00191 length = len(self.command.position)
00192 buff.write(_struct_I.pack(length))
00193 pattern = '<%sd'%length
00194 buff.write(self.command.position.tostring())
00195 length = len(self.command.time_from_start)
00196 buff.write(_struct_I.pack(length))
00197 for val1 in self.command.time_from_start:
00198 _x = val1
00199 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00200 _x = self
00201 buff.write(_struct_2d.pack(_x.command.max_velocity, _x.command.max_acceleration))
00202 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00203 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00204
00205 def deserialize_numpy(self, str, numpy):
00206 """
00207 unpack serialized message in str into this message instance using numpy for array types
00208 :param str: byte array of serialized message, ``str``
00209 :param numpy: numpy python module
00210 """
00211 try:
00212 if self.command is None:
00213 self.command = pr2_msgs.msg.LaserTrajCmd()
00214 end = 0
00215 _x = self
00216 start = end
00217 end += 12
00218 (_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 start = end
00223 end += length
00224 if python3:
00225 self.command.header.frame_id = str[start:end].decode('utf-8')
00226 else:
00227 self.command.header.frame_id = str[start:end]
00228 start = end
00229 end += 4
00230 (length,) = _struct_I.unpack(str[start:end])
00231 start = end
00232 end += length
00233 if python3:
00234 self.command.profile = str[start:end].decode('utf-8')
00235 else:
00236 self.command.profile = str[start:end]
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 pattern = '<%sd'%length
00241 start = end
00242 end += struct.calcsize(pattern)
00243 self.command.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 self.command.time_from_start = []
00248 for i in range(0, length):
00249 val1 = genpy.Duration()
00250 _x = val1
00251 start = end
00252 end += 8
00253 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00254 self.command.time_from_start.append(val1)
00255 _x = self
00256 start = end
00257 end += 16
00258 (_x.command.max_velocity, _x.command.max_acceleration,) = _struct_2d.unpack(str[start:end])
00259 return self
00260 except struct.error as e:
00261 raise genpy.DeserializationError(e)
00262
00263 _struct_I = genpy.struct_I
00264 _struct_2d = struct.Struct("<2d")
00265 _struct_3I = struct.Struct("<3I")
00266 _struct_2i = struct.Struct("<2i")
00267 """autogenerated by genpy from pr2_msgs/SetLaserTrajCmdResponse.msg. Do not edit."""
00268 import sys
00269 python3 = True if sys.hexversion > 0x03000000 else False
00270 import genpy
00271 import struct
00272
00273 import genpy
00274
00275 class SetLaserTrajCmdResponse(genpy.Message):
00276 _md5sum = "3888666920054f1ef39d2df7a5d94b02"
00277 _type = "pr2_msgs/SetLaserTrajCmdResponse"
00278 _has_header = False
00279 _full_text = """time start_time
00280
00281 """
00282 __slots__ = ['start_time']
00283 _slot_types = ['time']
00284
00285 def __init__(self, *args, **kwds):
00286 """
00287 Constructor. Any message fields that are implicitly/explicitly
00288 set to None will be assigned a default value. The recommend
00289 use is keyword arguments as this is more robust to future message
00290 changes. You cannot mix in-order arguments and keyword arguments.
00291
00292 The available fields are:
00293 start_time
00294
00295 :param args: complete set of field values, in .msg order
00296 :param kwds: use keyword arguments corresponding to message field names
00297 to set specific fields.
00298 """
00299 if args or kwds:
00300 super(SetLaserTrajCmdResponse, self).__init__(*args, **kwds)
00301
00302 if self.start_time is None:
00303 self.start_time = genpy.Time()
00304 else:
00305 self.start_time = genpy.Time()
00306
00307 def _get_types(self):
00308 """
00309 internal API method
00310 """
00311 return self._slot_types
00312
00313 def serialize(self, buff):
00314 """
00315 serialize message into buffer
00316 :param buff: buffer, ``StringIO``
00317 """
00318 try:
00319 _x = self
00320 buff.write(_struct_2I.pack(_x.start_time.secs, _x.start_time.nsecs))
00321 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00322 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00323
00324 def deserialize(self, str):
00325 """
00326 unpack serialized message in str into this message instance
00327 :param str: byte array of serialized message, ``str``
00328 """
00329 try:
00330 if self.start_time is None:
00331 self.start_time = genpy.Time()
00332 end = 0
00333 _x = self
00334 start = end
00335 end += 8
00336 (_x.start_time.secs, _x.start_time.nsecs,) = _struct_2I.unpack(str[start:end])
00337 self.start_time.canon()
00338 return self
00339 except struct.error as e:
00340 raise genpy.DeserializationError(e)
00341
00342
00343 def serialize_numpy(self, buff, numpy):
00344 """
00345 serialize message with numpy array types into buffer
00346 :param buff: buffer, ``StringIO``
00347 :param numpy: numpy python module
00348 """
00349 try:
00350 _x = self
00351 buff.write(_struct_2I.pack(_x.start_time.secs, _x.start_time.nsecs))
00352 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00353 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00354
00355 def deserialize_numpy(self, str, numpy):
00356 """
00357 unpack serialized message in str into this message instance using numpy for array types
00358 :param str: byte array of serialized message, ``str``
00359 :param numpy: numpy python module
00360 """
00361 try:
00362 if self.start_time is None:
00363 self.start_time = genpy.Time()
00364 end = 0
00365 _x = self
00366 start = end
00367 end += 8
00368 (_x.start_time.secs, _x.start_time.nsecs,) = _struct_2I.unpack(str[start:end])
00369 self.start_time.canon()
00370 return self
00371 except struct.error as e:
00372 raise genpy.DeserializationError(e)
00373
00374 _struct_I = genpy.struct_I
00375 _struct_2I = struct.Struct("<2I")
00376 class SetLaserTrajCmd(object):
00377 _type = 'pr2_msgs/SetLaserTrajCmd'
00378 _md5sum = '28fe2ce397611c999952c74a1ea882aa'
00379 _request_class = SetLaserTrajCmdRequest
00380 _response_class = SetLaserTrajCmdResponse