_ThrottleCommand.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/ThrottleCommand.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 std_msgs.msg
00008 
00009 class ThrottleCommand(genpy.Message):
00010   _md5sum = "7d9e24314a55cc39669333e821a84049"
00011   _type = "art_msgs/ThrottleCommand"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# ART throttle controller command message
00014 
00015 # $Id: ThrottleCommand.msg 644 2010-09-28 03:19:07Z jack.oquin $
00016 
00017 Header  header
00018 
00019 # request types
00020 uint32 Absolute = 0    # set absolute position: 0.0 is off, 1.0 is fully on
00021 uint32 Relative = 1    # change relative to current setting, [-1.0 to 1.0]
00022 
00023 uint32  request                # request type
00024 float32 position               # requested position
00025 
00026 
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   # Pseudo-constants
00048   Absolute = 0
00049   Relative = 1
00050 
00051   __slots__ = ['header','request','position']
00052   _slot_types = ['std_msgs/Header','uint32','float32']
00053 
00054   def __init__(self, *args, **kwds):
00055     """
00056     Constructor. Any message fields that are implicitly/explicitly
00057     set to None will be assigned a default value. The recommend
00058     use is keyword arguments as this is more robust to future message
00059     changes.  You cannot mix in-order arguments and keyword arguments.
00060 
00061     The available fields are:
00062        header,request,position
00063 
00064     :param args: complete set of field values, in .msg order
00065     :param kwds: use keyword arguments corresponding to message field names
00066     to set specific fields.
00067     """
00068     if args or kwds:
00069       super(ThrottleCommand, self).__init__(*args, **kwds)
00070       #message fields cannot be None, assign default values for those that are
00071       if self.header is None:
00072         self.header = std_msgs.msg.Header()
00073       if self.request is None:
00074         self.request = 0
00075       if self.position is None:
00076         self.position = 0.
00077     else:
00078       self.header = std_msgs.msg.Header()
00079       self.request = 0
00080       self.position = 0.
00081 
00082   def _get_types(self):
00083     """
00084     internal API method
00085     """
00086     return self._slot_types
00087 
00088   def serialize(self, buff):
00089     """
00090     serialize message into buffer
00091     :param buff: buffer, ``StringIO``
00092     """
00093     try:
00094       _x = self
00095       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00096       _x = self.header.frame_id
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       _x = self
00103       buff.write(_struct_If.pack(_x.request, _x.position))
00104     except struct.error as se: self._check_types(se)
00105     except TypeError as te: self._check_types(te)
00106 
00107   def deserialize(self, str):
00108     """
00109     unpack serialized message in str into this message instance
00110     :param str: byte array of serialized message, ``str``
00111     """
00112     try:
00113       if self.header is None:
00114         self.header = std_msgs.msg.Header()
00115       end = 0
00116       _x = self
00117       start = end
00118       end += 12
00119       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00120       start = end
00121       end += 4
00122       (length,) = _struct_I.unpack(str[start:end])
00123       start = end
00124       end += length
00125       if python3:
00126         self.header.frame_id = str[start:end].decode('utf-8')
00127       else:
00128         self.header.frame_id = str[start:end]
00129       _x = self
00130       start = end
00131       end += 8
00132       (_x.request, _x.position,) = _struct_If.unpack(str[start:end])
00133       return self
00134     except struct.error as e:
00135       raise genpy.DeserializationError(e) #most likely buffer underfill
00136 
00137 
00138   def serialize_numpy(self, buff, numpy):
00139     """
00140     serialize message with numpy array types into buffer
00141     :param buff: buffer, ``StringIO``
00142     :param numpy: numpy python module
00143     """
00144     try:
00145       _x = self
00146       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00147       _x = self.header.frame_id
00148       length = len(_x)
00149       if python3 or type(_x) == unicode:
00150         _x = _x.encode('utf-8')
00151         length = len(_x)
00152       buff.write(struct.pack('<I%ss'%length, length, _x))
00153       _x = self
00154       buff.write(_struct_If.pack(_x.request, _x.position))
00155     except struct.error as se: self._check_types(se)
00156     except TypeError as te: self._check_types(te)
00157 
00158   def deserialize_numpy(self, str, numpy):
00159     """
00160     unpack serialized message in str into this message instance using numpy for array types
00161     :param str: byte array of serialized message, ``str``
00162     :param numpy: numpy python module
00163     """
00164     try:
00165       if self.header is None:
00166         self.header = std_msgs.msg.Header()
00167       end = 0
00168       _x = self
00169       start = end
00170       end += 12
00171       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00172       start = end
00173       end += 4
00174       (length,) = _struct_I.unpack(str[start:end])
00175       start = end
00176       end += length
00177       if python3:
00178         self.header.frame_id = str[start:end].decode('utf-8')
00179       else:
00180         self.header.frame_id = str[start:end]
00181       _x = self
00182       start = end
00183       end += 8
00184       (_x.request, _x.position,) = _struct_If.unpack(str[start:end])
00185       return self
00186     except struct.error as e:
00187       raise genpy.DeserializationError(e) #most likely buffer underfill
00188 
00189 _struct_I = genpy.struct_I
00190 _struct_3I = struct.Struct("<3I")
00191 _struct_If = struct.Struct("<If")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


art_msgs
Author(s): Jack O'Quin
autogenerated on Tue Sep 24 2013 10:40:45