_SetPeriodicCmd.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_msgs/SetPeriodicCmdRequest.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 pr2_msgs.msg
00008 import std_msgs.msg
00009 
00010 class SetPeriodicCmdRequest(genpy.Message):
00011   _md5sum = "d4deedcc194c4a77110f7228904ee733"
00012   _type = "pr2_msgs/SetPeriodicCmdRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """pr2_msgs/PeriodicCmd command
00015 
00016 ================================================================================
00017 MSG: pr2_msgs/PeriodicCmd
00018 # This message is used to set the parameters of a profile executed by the
00019 # laser tilt controller.
00020 Header header
00021 string profile
00022 float64 period
00023 float64 amplitude
00024 float64 offset
00025 
00026 ================================================================================
00027 MSG: std_msgs/Header
00028 # Standard metadata for higher-level stamped data types.
00029 # This is generally used to communicate timestamped data 
00030 # in a particular coordinate frame.
00031 # 
00032 # sequence ID: consecutively increasing ID 
00033 uint32 seq
00034 #Two-integer timestamp that is expressed as:
00035 # * stamp.secs: seconds (stamp_secs) since epoch
00036 # * stamp.nsecs: nanoseconds since stamp_secs
00037 # time-handling sugar is provided by the client library
00038 time stamp
00039 #Frame this data is associated with
00040 # 0: no frame
00041 # 1: global frame
00042 string frame_id
00043 
00044 """
00045   __slots__ = ['command']
00046   _slot_types = ['pr2_msgs/PeriodicCmd']
00047 
00048   def __init__(self, *args, **kwds):
00049     """
00050     Constructor. Any message fields that are implicitly/explicitly
00051     set to None will be assigned a default value. The recommend
00052     use is keyword arguments as this is more robust to future message
00053     changes.  You cannot mix in-order arguments and keyword arguments.
00054 
00055     The available fields are:
00056        command
00057 
00058     :param args: complete set of field values, in .msg order
00059     :param kwds: use keyword arguments corresponding to message field names
00060     to set specific fields.
00061     """
00062     if args or kwds:
00063       super(SetPeriodicCmdRequest, self).__init__(*args, **kwds)
00064       #message fields cannot be None, assign default values for those that are
00065       if self.command is None:
00066         self.command = pr2_msgs.msg.PeriodicCmd()
00067     else:
00068       self.command = pr2_msgs.msg.PeriodicCmd()
00069 
00070   def _get_types(self):
00071     """
00072     internal API method
00073     """
00074     return self._slot_types
00075 
00076   def serialize(self, buff):
00077     """
00078     serialize message into buffer
00079     :param buff: buffer, ``StringIO``
00080     """
00081     try:
00082       _x = self
00083       buff.write(_struct_3I.pack(_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs))
00084       _x = self.command.header.frame_id
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.command.profile
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self
00097       buff.write(_struct_3d.pack(_x.command.period, _x.command.amplitude, _x.command.offset))
00098     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00099     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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.command is None:
00108         self.command = pr2_msgs.msg.PeriodicCmd()
00109       end = 0
00110       _x = self
00111       start = end
00112       end += 12
00113       (_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00114       start = end
00115       end += 4
00116       (length,) = _struct_I.unpack(str[start:end])
00117       start = end
00118       end += length
00119       if python3:
00120         self.command.header.frame_id = str[start:end].decode('utf-8')
00121       else:
00122         self.command.header.frame_id = str[start:end]
00123       start = end
00124       end += 4
00125       (length,) = _struct_I.unpack(str[start:end])
00126       start = end
00127       end += length
00128       if python3:
00129         self.command.profile = str[start:end].decode('utf-8')
00130       else:
00131         self.command.profile = str[start:end]
00132       _x = self
00133       start = end
00134       end += 24
00135       (_x.command.period, _x.command.amplitude, _x.command.offset,) = _struct_3d.unpack(str[start:end])
00136       return self
00137     except struct.error as e:
00138       raise genpy.DeserializationError(e) #most likely buffer underfill
00139 
00140 
00141   def serialize_numpy(self, buff, numpy):
00142     """
00143     serialize message with numpy array types into buffer
00144     :param buff: buffer, ``StringIO``
00145     :param numpy: numpy python module
00146     """
00147     try:
00148       _x = self
00149       buff.write(_struct_3I.pack(_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs))
00150       _x = self.command.header.frame_id
00151       length = len(_x)
00152       if python3 or type(_x) == unicode:
00153         _x = _x.encode('utf-8')
00154         length = len(_x)
00155       buff.write(struct.pack('<I%ss'%length, length, _x))
00156       _x = self.command.profile
00157       length = len(_x)
00158       if python3 or type(_x) == unicode:
00159         _x = _x.encode('utf-8')
00160         length = len(_x)
00161       buff.write(struct.pack('<I%ss'%length, length, _x))
00162       _x = self
00163       buff.write(_struct_3d.pack(_x.command.period, _x.command.amplitude, _x.command.offset))
00164     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00165     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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.command is None:
00175         self.command = pr2_msgs.msg.PeriodicCmd()
00176       end = 0
00177       _x = self
00178       start = end
00179       end += 12
00180       (_x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       start = end
00185       end += length
00186       if python3:
00187         self.command.header.frame_id = str[start:end].decode('utf-8')
00188       else:
00189         self.command.header.frame_id = str[start:end]
00190       start = end
00191       end += 4
00192       (length,) = _struct_I.unpack(str[start:end])
00193       start = end
00194       end += length
00195       if python3:
00196         self.command.profile = str[start:end].decode('utf-8')
00197       else:
00198         self.command.profile = str[start:end]
00199       _x = self
00200       start = end
00201       end += 24
00202       (_x.command.period, _x.command.amplitude, _x.command.offset,) = _struct_3d.unpack(str[start:end])
00203       return self
00204     except struct.error as e:
00205       raise genpy.DeserializationError(e) #most likely buffer underfill
00206 
00207 _struct_I = genpy.struct_I
00208 _struct_3I = struct.Struct("<3I")
00209 _struct_3d = struct.Struct("<3d")
00210 """autogenerated by genpy from pr2_msgs/SetPeriodicCmdResponse.msg. Do not edit."""
00211 import sys
00212 python3 = True if sys.hexversion > 0x03000000 else False
00213 import genpy
00214 import struct
00215 
00216 import genpy
00217 
00218 class SetPeriodicCmdResponse(genpy.Message):
00219   _md5sum = "3888666920054f1ef39d2df7a5d94b02"
00220   _type = "pr2_msgs/SetPeriodicCmdResponse"
00221   _has_header = False #flag to mark the presence of a Header object
00222   _full_text = """time start_time
00223 
00224 """
00225   __slots__ = ['start_time']
00226   _slot_types = ['time']
00227 
00228   def __init__(self, *args, **kwds):
00229     """
00230     Constructor. Any message fields that are implicitly/explicitly
00231     set to None will be assigned a default value. The recommend
00232     use is keyword arguments as this is more robust to future message
00233     changes.  You cannot mix in-order arguments and keyword arguments.
00234 
00235     The available fields are:
00236        start_time
00237 
00238     :param args: complete set of field values, in .msg order
00239     :param kwds: use keyword arguments corresponding to message field names
00240     to set specific fields.
00241     """
00242     if args or kwds:
00243       super(SetPeriodicCmdResponse, self).__init__(*args, **kwds)
00244       #message fields cannot be None, assign default values for those that are
00245       if self.start_time is None:
00246         self.start_time = genpy.Time()
00247     else:
00248       self.start_time = genpy.Time()
00249 
00250   def _get_types(self):
00251     """
00252     internal API method
00253     """
00254     return self._slot_types
00255 
00256   def serialize(self, buff):
00257     """
00258     serialize message into buffer
00259     :param buff: buffer, ``StringIO``
00260     """
00261     try:
00262       _x = self
00263       buff.write(_struct_2I.pack(_x.start_time.secs, _x.start_time.nsecs))
00264     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00265     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00266 
00267   def deserialize(self, str):
00268     """
00269     unpack serialized message in str into this message instance
00270     :param str: byte array of serialized message, ``str``
00271     """
00272     try:
00273       if self.start_time is None:
00274         self.start_time = genpy.Time()
00275       end = 0
00276       _x = self
00277       start = end
00278       end += 8
00279       (_x.start_time.secs, _x.start_time.nsecs,) = _struct_2I.unpack(str[start:end])
00280       self.start_time.canon()
00281       return self
00282     except struct.error as e:
00283       raise genpy.DeserializationError(e) #most likely buffer underfill
00284 
00285 
00286   def serialize_numpy(self, buff, numpy):
00287     """
00288     serialize message with numpy array types into buffer
00289     :param buff: buffer, ``StringIO``
00290     :param numpy: numpy python module
00291     """
00292     try:
00293       _x = self
00294       buff.write(_struct_2I.pack(_x.start_time.secs, _x.start_time.nsecs))
00295     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00296     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00297 
00298   def deserialize_numpy(self, str, numpy):
00299     """
00300     unpack serialized message in str into this message instance using numpy for array types
00301     :param str: byte array of serialized message, ``str``
00302     :param numpy: numpy python module
00303     """
00304     try:
00305       if self.start_time is None:
00306         self.start_time = genpy.Time()
00307       end = 0
00308       _x = self
00309       start = end
00310       end += 8
00311       (_x.start_time.secs, _x.start_time.nsecs,) = _struct_2I.unpack(str[start:end])
00312       self.start_time.canon()
00313       return self
00314     except struct.error as e:
00315       raise genpy.DeserializationError(e) #most likely buffer underfill
00316 
00317 _struct_I = genpy.struct_I
00318 _struct_2I = struct.Struct("<2I")
00319 class SetPeriodicCmd(object):
00320   _type          = 'pr2_msgs/SetPeriodicCmd'
00321   _md5sum = 'daeb6e862b732192bc82a7ea52bb7975'
00322   _request_class  = SetPeriodicCmdRequest
00323   _response_class = SetPeriodicCmdResponse


pr2_msgs
Author(s): Eric Berger and many others
autogenerated on Mon Oct 6 2014 03:30:41