Go to the documentation of this file.00001 """autogenerated by genpy from re_msgs/Pose2DStamped.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 geometry_msgs.msg
00008 import std_msgs.msg
00009
00010 class Pose2DStamped(genpy.Message):
00011 _md5sum = "b5f1e28823201bc5ea7e310fc49d253f"
00012 _type = "re_msgs/Pose2DStamped"
00013 _has_header = True
00014 _full_text = """#This represents a Pose2D with reference coordinate frame and timestamp
00015 Header header
00016 geometry_msgs/Pose2D pose
00017
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data
00022 # in a particular coordinate frame.
00023 #
00024 # sequence ID: consecutively increasing ID
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035
00036 ================================================================================
00037 MSG: geometry_msgs/Pose2D
00038 # This expresses a position and orientation on a 2D manifold.
00039
00040 float64 x
00041 float64 y
00042 float64 theta
00043 """
00044 __slots__ = ['header','pose']
00045 _slot_types = ['std_msgs/Header','geometry_msgs/Pose2D']
00046
00047 def __init__(self, *args, **kwds):
00048 """
00049 Constructor. Any message fields that are implicitly/explicitly
00050 set to None will be assigned a default value. The recommend
00051 use is keyword arguments as this is more robust to future message
00052 changes. You cannot mix in-order arguments and keyword arguments.
00053
00054 The available fields are:
00055 header,pose
00056
00057 :param args: complete set of field values, in .msg order
00058 :param kwds: use keyword arguments corresponding to message field names
00059 to set specific fields.
00060 """
00061 if args or kwds:
00062 super(Pose2DStamped, self).__init__(*args, **kwds)
00063
00064 if self.header is None:
00065 self.header = std_msgs.msg.Header()
00066 if self.pose is None:
00067 self.pose = geometry_msgs.msg.Pose2D()
00068 else:
00069 self.header = std_msgs.msg.Header()
00070 self.pose = geometry_msgs.msg.Pose2D()
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.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00086 _x = self.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
00093 buff.write(_struct_3d.pack(_x.pose.x, _x.pose.y, _x.pose.theta))
00094 except struct.error as se: self._check_types(se)
00095 except TypeError as te: self._check_types(te)
00096
00097 def deserialize(self, str):
00098 """
00099 unpack serialized message in str into this message instance
00100 :param str: byte array of serialized message, ``str``
00101 """
00102 try:
00103 if self.header is None:
00104 self.header = std_msgs.msg.Header()
00105 if self.pose is None:
00106 self.pose = geometry_msgs.msg.Pose2D()
00107 end = 0
00108 _x = self
00109 start = end
00110 end += 12
00111 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00112 start = end
00113 end += 4
00114 (length,) = _struct_I.unpack(str[start:end])
00115 start = end
00116 end += length
00117 if python3:
00118 self.header.frame_id = str[start:end].decode('utf-8')
00119 else:
00120 self.header.frame_id = str[start:end]
00121 _x = self
00122 start = end
00123 end += 24
00124 (_x.pose.x, _x.pose.y, _x.pose.theta,) = _struct_3d.unpack(str[start:end])
00125 return self
00126 except struct.error as e:
00127 raise genpy.DeserializationError(e)
00128
00129
00130 def serialize_numpy(self, buff, numpy):
00131 """
00132 serialize message with numpy array types into buffer
00133 :param buff: buffer, ``StringIO``
00134 :param numpy: numpy python module
00135 """
00136 try:
00137 _x = self
00138 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00139 _x = self.header.frame_id
00140 length = len(_x)
00141 if python3 or type(_x) == unicode:
00142 _x = _x.encode('utf-8')
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = self
00146 buff.write(_struct_3d.pack(_x.pose.x, _x.pose.y, _x.pose.theta))
00147 except struct.error as se: self._check_types(se)
00148 except TypeError as te: self._check_types(te)
00149
00150 def deserialize_numpy(self, str, numpy):
00151 """
00152 unpack serialized message in str into this message instance using numpy for array types
00153 :param str: byte array of serialized message, ``str``
00154 :param numpy: numpy python module
00155 """
00156 try:
00157 if self.header is None:
00158 self.header = std_msgs.msg.Header()
00159 if self.pose is None:
00160 self.pose = geometry_msgs.msg.Pose2D()
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 += 24
00178 (_x.pose.x, _x.pose.y, _x.pose.theta,) = _struct_3d.unpack(str[start:end])
00179 return self
00180 except struct.error as e:
00181 raise genpy.DeserializationError(e)
00182
00183 _struct_I = genpy.struct_I
00184 _struct_3I = struct.Struct("<3I")
00185 _struct_3d = struct.Struct("<3d")