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