$search
00001 """autogenerated by genmsg_py from Point2dStamped.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import walk_msgs.msg 00006 import std_msgs.msg 00007 00008 class Point2dStamped(roslib.message.Message): 00009 _md5sum = "9f7db918fde9989a73131d0d083d049d" 00010 _type = "walk_msgs/Point2dStamped" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 Point2d point 00014 00015 ================================================================================ 00016 MSG: std_msgs/Header 00017 # Standard metadata for higher-level stamped data types. 00018 # This is generally used to communicate timestamped data 00019 # in a particular coordinate frame. 00020 # 00021 # sequence ID: consecutively increasing ID 00022 uint32 seq 00023 #Two-integer timestamp that is expressed as: 00024 # * stamp.secs: seconds (stamp_secs) since epoch 00025 # * stamp.nsecs: nanoseconds since stamp_secs 00026 # time-handling sugar is provided by the client library 00027 time stamp 00028 #Frame this data is associated with 00029 # 0: no frame 00030 # 1: global frame 00031 string frame_id 00032 00033 ================================================================================ 00034 MSG: walk_msgs/Point2d 00035 float64 x 00036 float64 y 00037 00038 """ 00039 __slots__ = ['header','point'] 00040 _slot_types = ['Header','walk_msgs/Point2d'] 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,point 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(Point2dStamped, 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.Header() 00061 if self.point is None: 00062 self.point = walk_msgs.msg.Point2d() 00063 else: 00064 self.header = std_msgs.msg._Header.Header() 00065 self.point = walk_msgs.msg.Point2d() 00066 00067 def _get_types(self): 00068 """ 00069 internal API method 00070 """ 00071 return self._slot_types 00072 00073 def serialize(self, buff): 00074 """ 00075 serialize message into buffer 00076 @param buff: buffer 00077 @type buff: StringIO 00078 """ 00079 try: 00080 _x = self 00081 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00082 _x = self.header.frame_id 00083 length = len(_x) 00084 buff.write(struct.pack('<I%ss'%length, length, _x)) 00085 _x = self 00086 buff.write(_struct_2d.pack(_x.point.x, _x.point.y)) 00087 except struct.error as se: self._check_types(se) 00088 except TypeError as te: self._check_types(te) 00089 00090 def deserialize(self, str): 00091 """ 00092 unpack serialized message in str into this message instance 00093 @param str: byte array of serialized message 00094 @type str: str 00095 """ 00096 try: 00097 if self.header is None: 00098 self.header = std_msgs.msg._Header.Header() 00099 if self.point is None: 00100 self.point = walk_msgs.msg.Point2d() 00101 end = 0 00102 _x = self 00103 start = end 00104 end += 12 00105 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00106 start = end 00107 end += 4 00108 (length,) = _struct_I.unpack(str[start:end]) 00109 start = end 00110 end += length 00111 self.header.frame_id = str[start:end] 00112 _x = self 00113 start = end 00114 end += 16 00115 (_x.point.x, _x.point.y,) = _struct_2d.unpack(str[start:end]) 00116 return self 00117 except struct.error as e: 00118 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00119 00120 00121 def serialize_numpy(self, buff, numpy): 00122 """ 00123 serialize message with numpy array types into buffer 00124 @param buff: buffer 00125 @type buff: StringIO 00126 @param numpy: numpy python module 00127 @type numpy module 00128 """ 00129 try: 00130 _x = self 00131 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00132 _x = self.header.frame_id 00133 length = len(_x) 00134 buff.write(struct.pack('<I%ss'%length, length, _x)) 00135 _x = self 00136 buff.write(_struct_2d.pack(_x.point.x, _x.point.y)) 00137 except struct.error as se: self._check_types(se) 00138 except TypeError as te: self._check_types(te) 00139 00140 def deserialize_numpy(self, str, numpy): 00141 """ 00142 unpack serialized message in str into this message instance using numpy for array types 00143 @param str: byte array of serialized message 00144 @type str: str 00145 @param numpy: numpy python module 00146 @type numpy: module 00147 """ 00148 try: 00149 if self.header is None: 00150 self.header = std_msgs.msg._Header.Header() 00151 if self.point is None: 00152 self.point = walk_msgs.msg.Point2d() 00153 end = 0 00154 _x = self 00155 start = end 00156 end += 12 00157 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00158 start = end 00159 end += 4 00160 (length,) = _struct_I.unpack(str[start:end]) 00161 start = end 00162 end += length 00163 self.header.frame_id = str[start:end] 00164 _x = self 00165 start = end 00166 end += 16 00167 (_x.point.x, _x.point.y,) = _struct_2d.unpack(str[start:end]) 00168 return self 00169 except struct.error as e: 00170 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00171 00172 _struct_I = roslib.message.struct_I 00173 _struct_2d = struct.Struct("<2d") 00174 _struct_3I = struct.Struct("<3I")