$search
00001 """autogenerated by genmsg_py from Float64.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class Float64(roslib.message.Message): 00008 _md5sum = "e6c99c37e6f9fe98e071d524cc164e65" 00009 _type = "hector_std_msgs/Float64" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """Header header 00012 float64 data 00013 00014 ================================================================================ 00015 MSG: std_msgs/Header 00016 # Standard metadata for higher-level stamped data types. 00017 # This is generally used to communicate timestamped data 00018 # in a particular coordinate frame. 00019 # 00020 # sequence ID: consecutively increasing ID 00021 uint32 seq 00022 #Two-integer timestamp that is expressed as: 00023 # * stamp.secs: seconds (stamp_secs) since epoch 00024 # * stamp.nsecs: nanoseconds since stamp_secs 00025 # time-handling sugar is provided by the client library 00026 time stamp 00027 #Frame this data is associated with 00028 # 0: no frame 00029 # 1: global frame 00030 string frame_id 00031 00032 """ 00033 __slots__ = ['header','data'] 00034 _slot_types = ['Header','float64'] 00035 00036 def __init__(self, *args, **kwds): 00037 """ 00038 Constructor. Any message fields that are implicitly/explicitly 00039 set to None will be assigned a default value. The recommend 00040 use is keyword arguments as this is more robust to future message 00041 changes. You cannot mix in-order arguments and keyword arguments. 00042 00043 The available fields are: 00044 header,data 00045 00046 @param args: complete set of field values, in .msg order 00047 @param kwds: use keyword arguments corresponding to message field names 00048 to set specific fields. 00049 """ 00050 if args or kwds: 00051 super(Float64, self).__init__(*args, **kwds) 00052 #message fields cannot be None, assign default values for those that are 00053 if self.header is None: 00054 self.header = std_msgs.msg._Header.Header() 00055 if self.data is None: 00056 self.data = 0. 00057 else: 00058 self.header = std_msgs.msg._Header.Header() 00059 self.data = 0. 00060 00061 def _get_types(self): 00062 """ 00063 internal API method 00064 """ 00065 return self._slot_types 00066 00067 def serialize(self, buff): 00068 """ 00069 serialize message into buffer 00070 @param buff: buffer 00071 @type buff: StringIO 00072 """ 00073 try: 00074 _x = self 00075 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00076 _x = self.header.frame_id 00077 length = len(_x) 00078 buff.write(struct.pack('<I%ss'%length, length, _x)) 00079 buff.write(_struct_d.pack(self.data)) 00080 except struct.error as se: self._check_types(se) 00081 except TypeError as te: self._check_types(te) 00082 00083 def deserialize(self, str): 00084 """ 00085 unpack serialized message in str into this message instance 00086 @param str: byte array of serialized message 00087 @type str: str 00088 """ 00089 try: 00090 if self.header is None: 00091 self.header = std_msgs.msg._Header.Header() 00092 end = 0 00093 _x = self 00094 start = end 00095 end += 12 00096 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00097 start = end 00098 end += 4 00099 (length,) = _struct_I.unpack(str[start:end]) 00100 start = end 00101 end += length 00102 self.header.frame_id = str[start:end] 00103 start = end 00104 end += 8 00105 (self.data,) = _struct_d.unpack(str[start:end]) 00106 return self 00107 except struct.error as e: 00108 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00109 00110 00111 def serialize_numpy(self, buff, numpy): 00112 """ 00113 serialize message with numpy array types into buffer 00114 @param buff: buffer 00115 @type buff: StringIO 00116 @param numpy: numpy python module 00117 @type numpy module 00118 """ 00119 try: 00120 _x = self 00121 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00122 _x = self.header.frame_id 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 buff.write(_struct_d.pack(self.data)) 00126 except struct.error as se: self._check_types(se) 00127 except TypeError as te: self._check_types(te) 00128 00129 def deserialize_numpy(self, str, numpy): 00130 """ 00131 unpack serialized message in str into this message instance using numpy for array types 00132 @param str: byte array of serialized message 00133 @type str: str 00134 @param numpy: numpy python module 00135 @type numpy: module 00136 """ 00137 try: 00138 if self.header is None: 00139 self.header = std_msgs.msg._Header.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 self.header.frame_id = str[start:end] 00151 start = end 00152 end += 8 00153 (self.data,) = _struct_d.unpack(str[start:end]) 00154 return self 00155 except struct.error as e: 00156 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00157 00158 _struct_I = roslib.message.struct_I 00159 _struct_3I = struct.Struct("<3I") 00160 _struct_d = struct.Struct("<d")