$search
00001 """autogenerated by genmsg_py from BaseOdometryState.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 00007 class BaseOdometryState(roslib.message.Message): 00008 _md5sum = "8a483e137ebc37abafa4c26549091dd6" 00009 _type = "pr2_mechanism_controllers/BaseOdometryState" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """geometry_msgs/Twist velocity 00012 string[] wheel_link_names 00013 float64[] drive_constraint_errors 00014 float64[] longitudinal_slip_constraint_errors 00015 ================================================================================ 00016 MSG: geometry_msgs/Twist 00017 # This expresses velocity in free space broken into it's linear and angular parts. 00018 Vector3 linear 00019 Vector3 angular 00020 00021 ================================================================================ 00022 MSG: geometry_msgs/Vector3 00023 # This represents a vector in free space. 00024 00025 float64 x 00026 float64 y 00027 float64 z 00028 """ 00029 __slots__ = ['velocity','wheel_link_names','drive_constraint_errors','longitudinal_slip_constraint_errors'] 00030 _slot_types = ['geometry_msgs/Twist','string[]','float64[]','float64[]'] 00031 00032 def __init__(self, *args, **kwds): 00033 """ 00034 Constructor. Any message fields that are implicitly/explicitly 00035 set to None will be assigned a default value. The recommend 00036 use is keyword arguments as this is more robust to future message 00037 changes. You cannot mix in-order arguments and keyword arguments. 00038 00039 The available fields are: 00040 velocity,wheel_link_names,drive_constraint_errors,longitudinal_slip_constraint_errors 00041 00042 @param args: complete set of field values, in .msg order 00043 @param kwds: use keyword arguments corresponding to message field names 00044 to set specific fields. 00045 """ 00046 if args or kwds: 00047 super(BaseOdometryState, self).__init__(*args, **kwds) 00048 #message fields cannot be None, assign default values for those that are 00049 if self.velocity is None: 00050 self.velocity = geometry_msgs.msg.Twist() 00051 if self.wheel_link_names is None: 00052 self.wheel_link_names = [] 00053 if self.drive_constraint_errors is None: 00054 self.drive_constraint_errors = [] 00055 if self.longitudinal_slip_constraint_errors is None: 00056 self.longitudinal_slip_constraint_errors = [] 00057 else: 00058 self.velocity = geometry_msgs.msg.Twist() 00059 self.wheel_link_names = [] 00060 self.drive_constraint_errors = [] 00061 self.longitudinal_slip_constraint_errors = [] 00062 00063 def _get_types(self): 00064 """ 00065 internal API method 00066 """ 00067 return self._slot_types 00068 00069 def serialize(self, buff): 00070 """ 00071 serialize message into buffer 00072 @param buff: buffer 00073 @type buff: StringIO 00074 """ 00075 try: 00076 _x = self 00077 buff.write(_struct_6d.pack(_x.velocity.linear.x, _x.velocity.linear.y, _x.velocity.linear.z, _x.velocity.angular.x, _x.velocity.angular.y, _x.velocity.angular.z)) 00078 length = len(self.wheel_link_names) 00079 buff.write(_struct_I.pack(length)) 00080 for val1 in self.wheel_link_names: 00081 length = len(val1) 00082 buff.write(struct.pack('<I%ss'%length, length, val1)) 00083 length = len(self.drive_constraint_errors) 00084 buff.write(_struct_I.pack(length)) 00085 pattern = '<%sd'%length 00086 buff.write(struct.pack(pattern, *self.drive_constraint_errors)) 00087 length = len(self.longitudinal_slip_constraint_errors) 00088 buff.write(_struct_I.pack(length)) 00089 pattern = '<%sd'%length 00090 buff.write(struct.pack(pattern, *self.longitudinal_slip_constraint_errors)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 if self.velocity is None: 00102 self.velocity = geometry_msgs.msg.Twist() 00103 end = 0 00104 _x = self 00105 start = end 00106 end += 48 00107 (_x.velocity.linear.x, _x.velocity.linear.y, _x.velocity.linear.z, _x.velocity.angular.x, _x.velocity.angular.y, _x.velocity.angular.z,) = _struct_6d.unpack(str[start:end]) 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 self.wheel_link_names = [] 00112 for i in range(0, length): 00113 start = end 00114 end += 4 00115 (length,) = _struct_I.unpack(str[start:end]) 00116 start = end 00117 end += length 00118 val1 = str[start:end] 00119 self.wheel_link_names.append(val1) 00120 start = end 00121 end += 4 00122 (length,) = _struct_I.unpack(str[start:end]) 00123 pattern = '<%sd'%length 00124 start = end 00125 end += struct.calcsize(pattern) 00126 self.drive_constraint_errors = struct.unpack(pattern, str[start:end]) 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 pattern = '<%sd'%length 00131 start = end 00132 end += struct.calcsize(pattern) 00133 self.longitudinal_slip_constraint_errors = struct.unpack(pattern, str[start:end]) 00134 return self 00135 except struct.error as e: 00136 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00137 00138 00139 def serialize_numpy(self, buff, numpy): 00140 """ 00141 serialize message with numpy array types into buffer 00142 @param buff: buffer 00143 @type buff: StringIO 00144 @param numpy: numpy python module 00145 @type numpy module 00146 """ 00147 try: 00148 _x = self 00149 buff.write(_struct_6d.pack(_x.velocity.linear.x, _x.velocity.linear.y, _x.velocity.linear.z, _x.velocity.angular.x, _x.velocity.angular.y, _x.velocity.angular.z)) 00150 length = len(self.wheel_link_names) 00151 buff.write(_struct_I.pack(length)) 00152 for val1 in self.wheel_link_names: 00153 length = len(val1) 00154 buff.write(struct.pack('<I%ss'%length, length, val1)) 00155 length = len(self.drive_constraint_errors) 00156 buff.write(_struct_I.pack(length)) 00157 pattern = '<%sd'%length 00158 buff.write(self.drive_constraint_errors.tostring()) 00159 length = len(self.longitudinal_slip_constraint_errors) 00160 buff.write(_struct_I.pack(length)) 00161 pattern = '<%sd'%length 00162 buff.write(self.longitudinal_slip_constraint_errors.tostring()) 00163 except struct.error as se: self._check_types(se) 00164 except TypeError as te: self._check_types(te) 00165 00166 def deserialize_numpy(self, str, numpy): 00167 """ 00168 unpack serialized message in str into this message instance using numpy for array types 00169 @param str: byte array of serialized message 00170 @type str: str 00171 @param numpy: numpy python module 00172 @type numpy: module 00173 """ 00174 try: 00175 if self.velocity is None: 00176 self.velocity = geometry_msgs.msg.Twist() 00177 end = 0 00178 _x = self 00179 start = end 00180 end += 48 00181 (_x.velocity.linear.x, _x.velocity.linear.y, _x.velocity.linear.z, _x.velocity.angular.x, _x.velocity.angular.y, _x.velocity.angular.z,) = _struct_6d.unpack(str[start:end]) 00182 start = end 00183 end += 4 00184 (length,) = _struct_I.unpack(str[start:end]) 00185 self.wheel_link_names = [] 00186 for i in range(0, length): 00187 start = end 00188 end += 4 00189 (length,) = _struct_I.unpack(str[start:end]) 00190 start = end 00191 end += length 00192 val1 = str[start:end] 00193 self.wheel_link_names.append(val1) 00194 start = end 00195 end += 4 00196 (length,) = _struct_I.unpack(str[start:end]) 00197 pattern = '<%sd'%length 00198 start = end 00199 end += struct.calcsize(pattern) 00200 self.drive_constraint_errors = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 pattern = '<%sd'%length 00205 start = end 00206 end += struct.calcsize(pattern) 00207 self.longitudinal_slip_constraint_errors = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00208 return self 00209 except struct.error as e: 00210 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00211 00212 _struct_I = roslib.message.struct_I 00213 _struct_6d = struct.Struct("<6d")