_DifferentialControl.py
Go to the documentation of this file.
00001 """autogenerated by genpy from clearpath_base/DifferentialControl.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 DifferentialControl(genpy.Message):
00010   _md5sum = "ae0672163e13fc0bb6491960c53a3259"
00011   _type = "clearpath_base/DifferentialControl"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 float64 l_p
00015 float64 l_i
00016 float64 l_d
00017 float64 l_ffwd
00018 float64 l_stic
00019 float64 l_sat
00020 float64 r_p
00021 float64 r_i
00022 float64 r_d
00023 float64 r_ffwd
00024 float64 r_stic
00025 float64 r_sat
00026 
00027 ================================================================================
00028 MSG: std_msgs/Header
00029 # Standard metadata for higher-level stamped data types.
00030 # This is generally used to communicate timestamped data 
00031 # in a particular coordinate frame.
00032 # 
00033 # sequence ID: consecutively increasing ID 
00034 uint32 seq
00035 #Two-integer timestamp that is expressed as:
00036 # * stamp.secs: seconds (stamp_secs) since epoch
00037 # * stamp.nsecs: nanoseconds since stamp_secs
00038 # time-handling sugar is provided by the client library
00039 time stamp
00040 #Frame this data is associated with
00041 # 0: no frame
00042 # 1: global frame
00043 string frame_id
00044 
00045 """
00046   __slots__ = ['header','l_p','l_i','l_d','l_ffwd','l_stic','l_sat','r_p','r_i','r_d','r_ffwd','r_stic','r_sat']
00047   _slot_types = ['std_msgs/Header','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64']
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,l_p,l_i,l_d,l_ffwd,l_stic,l_sat,r_p,r_i,r_d,r_ffwd,r_stic,r_sat
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(DifferentialControl, self).__init__(*args, **kwds)
00065       #message fields cannot be None, assign default values for those that are
00066       if self.header is None:
00067         self.header = std_msgs.msg.Header()
00068       if self.l_p is None:
00069         self.l_p = 0.
00070       if self.l_i is None:
00071         self.l_i = 0.
00072       if self.l_d is None:
00073         self.l_d = 0.
00074       if self.l_ffwd is None:
00075         self.l_ffwd = 0.
00076       if self.l_stic is None:
00077         self.l_stic = 0.
00078       if self.l_sat is None:
00079         self.l_sat = 0.
00080       if self.r_p is None:
00081         self.r_p = 0.
00082       if self.r_i is None:
00083         self.r_i = 0.
00084       if self.r_d is None:
00085         self.r_d = 0.
00086       if self.r_ffwd is None:
00087         self.r_ffwd = 0.
00088       if self.r_stic is None:
00089         self.r_stic = 0.
00090       if self.r_sat is None:
00091         self.r_sat = 0.
00092     else:
00093       self.header = std_msgs.msg.Header()
00094       self.l_p = 0.
00095       self.l_i = 0.
00096       self.l_d = 0.
00097       self.l_ffwd = 0.
00098       self.l_stic = 0.
00099       self.l_sat = 0.
00100       self.r_p = 0.
00101       self.r_i = 0.
00102       self.r_d = 0.
00103       self.r_ffwd = 0.
00104       self.r_stic = 0.
00105       self.r_sat = 0.
00106 
00107   def _get_types(self):
00108     """
00109     internal API method
00110     """
00111     return self._slot_types
00112 
00113   def serialize(self, buff):
00114     """
00115     serialize message into buffer
00116     :param buff: buffer, ``StringIO``
00117     """
00118     try:
00119       _x = self
00120       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00121       _x = self.header.frame_id
00122       length = len(_x)
00123       if python3 or type(_x) == unicode:
00124         _x = _x.encode('utf-8')
00125         length = len(_x)
00126       buff.write(struct.pack('<I%ss'%length, length, _x))
00127       _x = self
00128       buff.write(_struct_12d.pack(_x.l_p, _x.l_i, _x.l_d, _x.l_ffwd, _x.l_stic, _x.l_sat, _x.r_p, _x.r_i, _x.r_d, _x.r_ffwd, _x.r_stic, _x.r_sat))
00129     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00130     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00131 
00132   def deserialize(self, str):
00133     """
00134     unpack serialized message in str into this message instance
00135     :param str: byte array of serialized message, ``str``
00136     """
00137     try:
00138       if self.header is None:
00139         self.header = std_msgs.msg.Header()
00140       end = 0
00141       _x = self
00142       start = end
00143       end += 12
00144       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       start = end
00149       end += length
00150       if python3:
00151         self.header.frame_id = str[start:end].decode('utf-8')
00152       else:
00153         self.header.frame_id = str[start:end]
00154       _x = self
00155       start = end
00156       end += 96
00157       (_x.l_p, _x.l_i, _x.l_d, _x.l_ffwd, _x.l_stic, _x.l_sat, _x.r_p, _x.r_i, _x.r_d, _x.r_ffwd, _x.r_stic, _x.r_sat,) = _struct_12d.unpack(str[start:end])
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 
00163   def serialize_numpy(self, buff, numpy):
00164     """
00165     serialize message with numpy array types into buffer
00166     :param buff: buffer, ``StringIO``
00167     :param numpy: numpy python module
00168     """
00169     try:
00170       _x = self
00171       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00172       _x = self.header.frame_id
00173       length = len(_x)
00174       if python3 or type(_x) == unicode:
00175         _x = _x.encode('utf-8')
00176         length = len(_x)
00177       buff.write(struct.pack('<I%ss'%length, length, _x))
00178       _x = self
00179       buff.write(_struct_12d.pack(_x.l_p, _x.l_i, _x.l_d, _x.l_ffwd, _x.l_stic, _x.l_sat, _x.r_p, _x.r_i, _x.r_d, _x.r_ffwd, _x.r_stic, _x.r_sat))
00180     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00181     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00182 
00183   def deserialize_numpy(self, str, numpy):
00184     """
00185     unpack serialized message in str into this message instance using numpy for array types
00186     :param str: byte array of serialized message, ``str``
00187     :param numpy: numpy python module
00188     """
00189     try:
00190       if self.header is None:
00191         self.header = std_msgs.msg.Header()
00192       end = 0
00193       _x = self
00194       start = end
00195       end += 12
00196       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00197       start = end
00198       end += 4
00199       (length,) = _struct_I.unpack(str[start:end])
00200       start = end
00201       end += length
00202       if python3:
00203         self.header.frame_id = str[start:end].decode('utf-8')
00204       else:
00205         self.header.frame_id = str[start:end]
00206       _x = self
00207       start = end
00208       end += 96
00209       (_x.l_p, _x.l_i, _x.l_d, _x.l_ffwd, _x.l_stic, _x.l_sat, _x.r_p, _x.r_i, _x.r_d, _x.r_ffwd, _x.r_stic, _x.r_sat,) = _struct_12d.unpack(str[start:end])
00210       return self
00211     except struct.error as e:
00212       raise genpy.DeserializationError(e) #most likely buffer underfill
00213 
00214 _struct_I = genpy.struct_I
00215 _struct_3I = struct.Struct("<3I")
00216 _struct_12d = struct.Struct("<12d")


clearpath_base
Author(s): Mike Purvis
autogenerated on Sun Oct 5 2014 22:52:07