$search
00001 """autogenerated by genmsg_py from PositionString.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class PositionString(roslib.message.Message): 00009 _md5sum = "7adb59260ef1ce9ab7745ed4e7582f92" 00010 _type = "position_string_msgs/PositionString" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 geometry_msgs/Point32 pose 00014 string text 00015 00016 00017 ================================================================================ 00018 MSG: std_msgs/Header 00019 # Standard metadata for higher-level stamped data types. 00020 # This is generally used to communicate timestamped data 00021 # in a particular coordinate frame. 00022 # 00023 # sequence ID: consecutively increasing ID 00024 uint32 seq 00025 #Two-integer timestamp that is expressed as: 00026 # * stamp.secs: seconds (stamp_secs) since epoch 00027 # * stamp.nsecs: nanoseconds since stamp_secs 00028 # time-handling sugar is provided by the client library 00029 time stamp 00030 #Frame this data is associated with 00031 # 0: no frame 00032 # 1: global frame 00033 string frame_id 00034 00035 ================================================================================ 00036 MSG: geometry_msgs/Point32 00037 # This contains the position of a point in free space(with 32 bits of precision). 00038 # It is recommeded to use Point wherever possible instead of Point32. 00039 # 00040 # This recommendation is to promote interoperability. 00041 # 00042 # This message is designed to take up less space when sending 00043 # lots of points at once, as in the case of a PointCloud. 00044 00045 float32 x 00046 float32 y 00047 float32 z 00048 """ 00049 __slots__ = ['header','pose','text'] 00050 _slot_types = ['Header','geometry_msgs/Point32','string'] 00051 00052 def __init__(self, *args, **kwds): 00053 """ 00054 Constructor. Any message fields that are implicitly/explicitly 00055 set to None will be assigned a default value. The recommend 00056 use is keyword arguments as this is more robust to future message 00057 changes. You cannot mix in-order arguments and keyword arguments. 00058 00059 The available fields are: 00060 header,pose,text 00061 00062 @param args: complete set of field values, in .msg order 00063 @param kwds: use keyword arguments corresponding to message field names 00064 to set specific fields. 00065 """ 00066 if args or kwds: 00067 super(PositionString, self).__init__(*args, **kwds) 00068 #message fields cannot be None, assign default values for those that are 00069 if self.header is None: 00070 self.header = std_msgs.msg._Header.Header() 00071 if self.pose is None: 00072 self.pose = geometry_msgs.msg.Point32() 00073 if self.text is None: 00074 self.text = '' 00075 else: 00076 self.header = std_msgs.msg._Header.Header() 00077 self.pose = geometry_msgs.msg.Point32() 00078 self.text = '' 00079 00080 def _get_types(self): 00081 """ 00082 internal API method 00083 """ 00084 return self._slot_types 00085 00086 def serialize(self, buff): 00087 """ 00088 serialize message into buffer 00089 @param buff: buffer 00090 @type buff: StringIO 00091 """ 00092 try: 00093 _x = self 00094 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00095 _x = self.header.frame_id 00096 length = len(_x) 00097 buff.write(struct.pack('<I%ss'%length, length, _x)) 00098 _x = self 00099 buff.write(_struct_3f.pack(_x.pose.x, _x.pose.y, _x.pose.z)) 00100 _x = self.text 00101 length = len(_x) 00102 buff.write(struct.pack('<I%ss'%length, length, _x)) 00103 except struct.error as se: self._check_types(se) 00104 except TypeError as te: self._check_types(te) 00105 00106 def deserialize(self, str): 00107 """ 00108 unpack serialized message in str into this message instance 00109 @param str: byte array of serialized message 00110 @type str: str 00111 """ 00112 try: 00113 if self.header is None: 00114 self.header = std_msgs.msg._Header.Header() 00115 if self.pose is None: 00116 self.pose = geometry_msgs.msg.Point32() 00117 end = 0 00118 _x = self 00119 start = end 00120 end += 12 00121 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00122 start = end 00123 end += 4 00124 (length,) = _struct_I.unpack(str[start:end]) 00125 start = end 00126 end += length 00127 self.header.frame_id = str[start:end] 00128 _x = self 00129 start = end 00130 end += 12 00131 (_x.pose.x, _x.pose.y, _x.pose.z,) = _struct_3f.unpack(str[start:end]) 00132 start = end 00133 end += 4 00134 (length,) = _struct_I.unpack(str[start:end]) 00135 start = end 00136 end += length 00137 self.text = str[start:end] 00138 return self 00139 except struct.error as e: 00140 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00141 00142 00143 def serialize_numpy(self, buff, numpy): 00144 """ 00145 serialize message with numpy array types into buffer 00146 @param buff: buffer 00147 @type buff: StringIO 00148 @param numpy: numpy python module 00149 @type numpy module 00150 """ 00151 try: 00152 _x = self 00153 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00154 _x = self.header.frame_id 00155 length = len(_x) 00156 buff.write(struct.pack('<I%ss'%length, length, _x)) 00157 _x = self 00158 buff.write(_struct_3f.pack(_x.pose.x, _x.pose.y, _x.pose.z)) 00159 _x = self.text 00160 length = len(_x) 00161 buff.write(struct.pack('<I%ss'%length, length, _x)) 00162 except struct.error as se: self._check_types(se) 00163 except TypeError as te: self._check_types(te) 00164 00165 def deserialize_numpy(self, str, numpy): 00166 """ 00167 unpack serialized message in str into this message instance using numpy for array types 00168 @param str: byte array of serialized message 00169 @type str: str 00170 @param numpy: numpy python module 00171 @type numpy: module 00172 """ 00173 try: 00174 if self.header is None: 00175 self.header = std_msgs.msg._Header.Header() 00176 if self.pose is None: 00177 self.pose = geometry_msgs.msg.Point32() 00178 end = 0 00179 _x = self 00180 start = end 00181 end += 12 00182 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00183 start = end 00184 end += 4 00185 (length,) = _struct_I.unpack(str[start:end]) 00186 start = end 00187 end += length 00188 self.header.frame_id = str[start:end] 00189 _x = self 00190 start = end 00191 end += 12 00192 (_x.pose.x, _x.pose.y, _x.pose.z,) = _struct_3f.unpack(str[start:end]) 00193 start = end 00194 end += 4 00195 (length,) = _struct_I.unpack(str[start:end]) 00196 start = end 00197 end += length 00198 self.text = str[start:end] 00199 return self 00200 except struct.error as e: 00201 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00202 00203 _struct_I = roslib.message.struct_I 00204 _struct_3I = struct.Struct("<3I") 00205 _struct_3f = struct.Struct("<3f")