_Pose3DOF.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hrl_lib/Pose3DOF.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 Pose3DOF(genpy.Message):
00010   _md5sum = "646ead44a0e6fecf4e14ca116f12b08b"
00011   _type = "hrl_lib/Pose3DOF"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 float64 x
00015 float64 y
00016 float64 theta
00017 float64 dt
00018 
00019 
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data 
00024 # in a particular coordinate frame.
00025 # 
00026 # sequence ID: consecutively increasing ID 
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037 
00038 """
00039   __slots__ = ['header','x','y','theta','dt']
00040   _slot_types = ['std_msgs/Header','float64','float64','float64','float64']
00041 
00042   def __init__(self, *args, **kwds):
00043     """
00044     Constructor. Any message fields that are implicitly/explicitly
00045     set to None will be assigned a default value. The recommend
00046     use is keyword arguments as this is more robust to future message
00047     changes.  You cannot mix in-order arguments and keyword arguments.
00048 
00049     The available fields are:
00050        header,x,y,theta,dt
00051 
00052     :param args: complete set of field values, in .msg order
00053     :param kwds: use keyword arguments corresponding to message field names
00054     to set specific fields.
00055     """
00056     if args or kwds:
00057       super(Pose3DOF, self).__init__(*args, **kwds)
00058       #message fields cannot be None, assign default values for those that are
00059       if self.header is None:
00060         self.header = std_msgs.msg.Header()
00061       if self.x is None:
00062         self.x = 0.
00063       if self.y is None:
00064         self.y = 0.
00065       if self.theta is None:
00066         self.theta = 0.
00067       if self.dt is None:
00068         self.dt = 0.
00069     else:
00070       self.header = std_msgs.msg.Header()
00071       self.x = 0.
00072       self.y = 0.
00073       self.theta = 0.
00074       self.dt = 0.
00075 
00076   def _get_types(self):
00077     """
00078     internal API method
00079     """
00080     return self._slot_types
00081 
00082   def serialize(self, buff):
00083     """
00084     serialize message into buffer
00085     :param buff: buffer, ``StringIO``
00086     """
00087     try:
00088       _x = self
00089       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00090       _x = self.header.frame_id
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_4d.pack(_x.x, _x.y, _x.theta, _x.dt))
00098     except struct.error as se: self._check_types(se)
00099     except TypeError as te: self._check_types(te)
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.header is None:
00108         self.header = std_msgs.msg.Header()
00109       end = 0
00110       _x = self
00111       start = end
00112       end += 12
00113       (_x.header.seq, _x.header.stamp.secs, _x.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.header.frame_id = str[start:end].decode('utf-8')
00121       else:
00122         self.header.frame_id = str[start:end]
00123       _x = self
00124       start = end
00125       end += 32
00126       (_x.x, _x.y, _x.theta, _x.dt,) = _struct_4d.unpack(str[start:end])
00127       return self
00128     except struct.error as e:
00129       raise genpy.DeserializationError(e) #most likely buffer underfill
00130 
00131 
00132   def serialize_numpy(self, buff, numpy):
00133     """
00134     serialize message with numpy array types into buffer
00135     :param buff: buffer, ``StringIO``
00136     :param numpy: numpy python module
00137     """
00138     try:
00139       _x = self
00140       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00141       _x = self.header.frame_id
00142       length = len(_x)
00143       if python3 or type(_x) == unicode:
00144         _x = _x.encode('utf-8')
00145         length = len(_x)
00146       buff.write(struct.pack('<I%ss'%length, length, _x))
00147       _x = self
00148       buff.write(_struct_4d.pack(_x.x, _x.y, _x.theta, _x.dt))
00149     except struct.error as se: self._check_types(se)
00150     except TypeError as te: self._check_types(te)
00151 
00152   def deserialize_numpy(self, str, numpy):
00153     """
00154     unpack serialized message in str into this message instance using numpy for array types
00155     :param str: byte array of serialized message, ``str``
00156     :param numpy: numpy python module
00157     """
00158     try:
00159       if self.header is None:
00160         self.header = std_msgs.msg.Header()
00161       end = 0
00162       _x = self
00163       start = end
00164       end += 12
00165       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       start = end
00170       end += length
00171       if python3:
00172         self.header.frame_id = str[start:end].decode('utf-8')
00173       else:
00174         self.header.frame_id = str[start:end]
00175       _x = self
00176       start = end
00177       end += 32
00178       (_x.x, _x.y, _x.theta, _x.dt,) = _struct_4d.unpack(str[start:end])
00179       return self
00180     except struct.error as e:
00181       raise genpy.DeserializationError(e) #most likely buffer underfill
00182 
00183 _struct_I = genpy.struct_I
00184 _struct_3I = struct.Struct("<3I")
00185 _struct_4d = struct.Struct("<4d")


hrl_lib
Author(s): Cressel Anderson, Travis Deyle, Advait Jain, Hai Nguyen, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:34:06