$search
00001 """autogenerated by genmsg_py from JTCartesianControllerState.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 JTCartesianControllerState(roslib.message.Message): 00009 _md5sum = "6ecdaa599ea0d27643819ae4cd4c43d0" 00010 _type = "robot_mechanism_controllers/JTCartesianControllerState" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """Header header 00013 geometry_msgs/PoseStamped x 00014 geometry_msgs/PoseStamped x_desi 00015 geometry_msgs/PoseStamped x_desi_filtered 00016 geometry_msgs/Twist x_err 00017 geometry_msgs/Twist xd 00018 geometry_msgs/Twist xd_desi 00019 geometry_msgs/Wrench F 00020 float64[] tau_pose 00021 float64[] tau_posture 00022 float64[] tau 00023 std_msgs/Float64MultiArray J 00024 std_msgs/Float64MultiArray N 00025 00026 ================================================================================ 00027 MSG: std_msgs/Header 00028 # Standard metadata for higher-level stamped data types. 00029 # This is generally used to communicate timestamped data 00030 # in a particular coordinate frame. 00031 # 00032 # sequence ID: consecutively increasing ID 00033 uint32 seq 00034 #Two-integer timestamp that is expressed as: 00035 # * stamp.secs: seconds (stamp_secs) since epoch 00036 # * stamp.nsecs: nanoseconds since stamp_secs 00037 # time-handling sugar is provided by the client library 00038 time stamp 00039 #Frame this data is associated with 00040 # 0: no frame 00041 # 1: global frame 00042 string frame_id 00043 00044 ================================================================================ 00045 MSG: geometry_msgs/PoseStamped 00046 # A Pose with reference coordinate frame and timestamp 00047 Header header 00048 Pose pose 00049 00050 ================================================================================ 00051 MSG: geometry_msgs/Pose 00052 # A representation of pose in free space, composed of postion and orientation. 00053 Point position 00054 Quaternion orientation 00055 00056 ================================================================================ 00057 MSG: geometry_msgs/Point 00058 # This contains the position of a point in free space 00059 float64 x 00060 float64 y 00061 float64 z 00062 00063 ================================================================================ 00064 MSG: geometry_msgs/Quaternion 00065 # This represents an orientation in free space in quaternion form. 00066 00067 float64 x 00068 float64 y 00069 float64 z 00070 float64 w 00071 00072 ================================================================================ 00073 MSG: geometry_msgs/Twist 00074 # This expresses velocity in free space broken into it's linear and angular parts. 00075 Vector3 linear 00076 Vector3 angular 00077 00078 ================================================================================ 00079 MSG: geometry_msgs/Vector3 00080 # This represents a vector in free space. 00081 00082 float64 x 00083 float64 y 00084 float64 z 00085 ================================================================================ 00086 MSG: geometry_msgs/Wrench 00087 # This represents force in free space, seperated into 00088 # it's linear and angular parts. 00089 Vector3 force 00090 Vector3 torque 00091 00092 ================================================================================ 00093 MSG: std_msgs/Float64MultiArray 00094 # Please look at the MultiArrayLayout message definition for 00095 # documentation on all multiarrays. 00096 00097 MultiArrayLayout layout # specification of data layout 00098 float64[] data # array of data 00099 00100 00101 ================================================================================ 00102 MSG: std_msgs/MultiArrayLayout 00103 # The multiarray declares a generic multi-dimensional array of a 00104 # particular data type. Dimensions are ordered from outer most 00105 # to inner most. 00106 00107 MultiArrayDimension[] dim # Array of dimension properties 00108 uint32 data_offset # padding bytes at front of data 00109 00110 # Accessors should ALWAYS be written in terms of dimension stride 00111 # and specified outer-most dimension first. 00112 # 00113 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k] 00114 # 00115 # A standard, 3-channel 640x480 image with interleaved color channels 00116 # would be specified as: 00117 # 00118 # dim[0].label = "height" 00119 # dim[0].size = 480 00120 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) 00121 # dim[1].label = "width" 00122 # dim[1].size = 640 00123 # dim[1].stride = 3*640 = 1920 00124 # dim[2].label = "channel" 00125 # dim[2].size = 3 00126 # dim[2].stride = 3 00127 # 00128 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel. 00129 ================================================================================ 00130 MSG: std_msgs/MultiArrayDimension 00131 string label # label of given dimension 00132 uint32 size # size of given dimension (in type units) 00133 uint32 stride # stride of given dimension 00134 """ 00135 __slots__ = ['header','x','x_desi','x_desi_filtered','x_err','xd','xd_desi','F','tau_pose','tau_posture','tau','J','N'] 00136 _slot_types = ['Header','geometry_msgs/PoseStamped','geometry_msgs/PoseStamped','geometry_msgs/PoseStamped','geometry_msgs/Twist','geometry_msgs/Twist','geometry_msgs/Twist','geometry_msgs/Wrench','float64[]','float64[]','float64[]','std_msgs/Float64MultiArray','std_msgs/Float64MultiArray'] 00137 00138 def __init__(self, *args, **kwds): 00139 """ 00140 Constructor. Any message fields that are implicitly/explicitly 00141 set to None will be assigned a default value. The recommend 00142 use is keyword arguments as this is more robust to future message 00143 changes. You cannot mix in-order arguments and keyword arguments. 00144 00145 The available fields are: 00146 header,x,x_desi,x_desi_filtered,x_err,xd,xd_desi,F,tau_pose,tau_posture,tau,J,N 00147 00148 @param args: complete set of field values, in .msg order 00149 @param kwds: use keyword arguments corresponding to message field names 00150 to set specific fields. 00151 """ 00152 if args or kwds: 00153 super(JTCartesianControllerState, self).__init__(*args, **kwds) 00154 #message fields cannot be None, assign default values for those that are 00155 if self.header is None: 00156 self.header = std_msgs.msg._Header.Header() 00157 if self.x is None: 00158 self.x = geometry_msgs.msg.PoseStamped() 00159 if self.x_desi is None: 00160 self.x_desi = geometry_msgs.msg.PoseStamped() 00161 if self.x_desi_filtered is None: 00162 self.x_desi_filtered = geometry_msgs.msg.PoseStamped() 00163 if self.x_err is None: 00164 self.x_err = geometry_msgs.msg.Twist() 00165 if self.xd is None: 00166 self.xd = geometry_msgs.msg.Twist() 00167 if self.xd_desi is None: 00168 self.xd_desi = geometry_msgs.msg.Twist() 00169 if self.F is None: 00170 self.F = geometry_msgs.msg.Wrench() 00171 if self.tau_pose is None: 00172 self.tau_pose = [] 00173 if self.tau_posture is None: 00174 self.tau_posture = [] 00175 if self.tau is None: 00176 self.tau = [] 00177 if self.J is None: 00178 self.J = std_msgs.msg.Float64MultiArray() 00179 if self.N is None: 00180 self.N = std_msgs.msg.Float64MultiArray() 00181 else: 00182 self.header = std_msgs.msg._Header.Header() 00183 self.x = geometry_msgs.msg.PoseStamped() 00184 self.x_desi = geometry_msgs.msg.PoseStamped() 00185 self.x_desi_filtered = geometry_msgs.msg.PoseStamped() 00186 self.x_err = geometry_msgs.msg.Twist() 00187 self.xd = geometry_msgs.msg.Twist() 00188 self.xd_desi = geometry_msgs.msg.Twist() 00189 self.F = geometry_msgs.msg.Wrench() 00190 self.tau_pose = [] 00191 self.tau_posture = [] 00192 self.tau = [] 00193 self.J = std_msgs.msg.Float64MultiArray() 00194 self.N = std_msgs.msg.Float64MultiArray() 00195 00196 def _get_types(self): 00197 """ 00198 internal API method 00199 """ 00200 return self._slot_types 00201 00202 def serialize(self, buff): 00203 """ 00204 serialize message into buffer 00205 @param buff: buffer 00206 @type buff: StringIO 00207 """ 00208 try: 00209 _x = self 00210 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00211 _x = self.header.frame_id 00212 length = len(_x) 00213 buff.write(struct.pack('<I%ss'%length, length, _x)) 00214 _x = self 00215 buff.write(_struct_3I.pack(_x.x.header.seq, _x.x.header.stamp.secs, _x.x.header.stamp.nsecs)) 00216 _x = self.x.header.frame_id 00217 length = len(_x) 00218 buff.write(struct.pack('<I%ss'%length, length, _x)) 00219 _x = self 00220 buff.write(_struct_7d3I.pack(_x.x.pose.position.x, _x.x.pose.position.y, _x.x.pose.position.z, _x.x.pose.orientation.x, _x.x.pose.orientation.y, _x.x.pose.orientation.z, _x.x.pose.orientation.w, _x.x_desi.header.seq, _x.x_desi.header.stamp.secs, _x.x_desi.header.stamp.nsecs)) 00221 _x = self.x_desi.header.frame_id 00222 length = len(_x) 00223 buff.write(struct.pack('<I%ss'%length, length, _x)) 00224 _x = self 00225 buff.write(_struct_7d3I.pack(_x.x_desi.pose.position.x, _x.x_desi.pose.position.y, _x.x_desi.pose.position.z, _x.x_desi.pose.orientation.x, _x.x_desi.pose.orientation.y, _x.x_desi.pose.orientation.z, _x.x_desi.pose.orientation.w, _x.x_desi_filtered.header.seq, _x.x_desi_filtered.header.stamp.secs, _x.x_desi_filtered.header.stamp.nsecs)) 00226 _x = self.x_desi_filtered.header.frame_id 00227 length = len(_x) 00228 buff.write(struct.pack('<I%ss'%length, length, _x)) 00229 _x = self 00230 buff.write(_struct_31d.pack(_x.x_desi_filtered.pose.position.x, _x.x_desi_filtered.pose.position.y, _x.x_desi_filtered.pose.position.z, _x.x_desi_filtered.pose.orientation.x, _x.x_desi_filtered.pose.orientation.y, _x.x_desi_filtered.pose.orientation.z, _x.x_desi_filtered.pose.orientation.w, _x.x_err.linear.x, _x.x_err.linear.y, _x.x_err.linear.z, _x.x_err.angular.x, _x.x_err.angular.y, _x.x_err.angular.z, _x.xd.linear.x, _x.xd.linear.y, _x.xd.linear.z, _x.xd.angular.x, _x.xd.angular.y, _x.xd.angular.z, _x.xd_desi.linear.x, _x.xd_desi.linear.y, _x.xd_desi.linear.z, _x.xd_desi.angular.x, _x.xd_desi.angular.y, _x.xd_desi.angular.z, _x.F.force.x, _x.F.force.y, _x.F.force.z, _x.F.torque.x, _x.F.torque.y, _x.F.torque.z)) 00231 length = len(self.tau_pose) 00232 buff.write(_struct_I.pack(length)) 00233 pattern = '<%sd'%length 00234 buff.write(struct.pack(pattern, *self.tau_pose)) 00235 length = len(self.tau_posture) 00236 buff.write(_struct_I.pack(length)) 00237 pattern = '<%sd'%length 00238 buff.write(struct.pack(pattern, *self.tau_posture)) 00239 length = len(self.tau) 00240 buff.write(_struct_I.pack(length)) 00241 pattern = '<%sd'%length 00242 buff.write(struct.pack(pattern, *self.tau)) 00243 length = len(self.J.layout.dim) 00244 buff.write(_struct_I.pack(length)) 00245 for val1 in self.J.layout.dim: 00246 _x = val1.label 00247 length = len(_x) 00248 buff.write(struct.pack('<I%ss'%length, length, _x)) 00249 _x = val1 00250 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00251 buff.write(_struct_I.pack(self.J.layout.data_offset)) 00252 length = len(self.J.data) 00253 buff.write(_struct_I.pack(length)) 00254 pattern = '<%sd'%length 00255 buff.write(struct.pack(pattern, *self.J.data)) 00256 length = len(self.N.layout.dim) 00257 buff.write(_struct_I.pack(length)) 00258 for val1 in self.N.layout.dim: 00259 _x = val1.label 00260 length = len(_x) 00261 buff.write(struct.pack('<I%ss'%length, length, _x)) 00262 _x = val1 00263 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00264 buff.write(_struct_I.pack(self.N.layout.data_offset)) 00265 length = len(self.N.data) 00266 buff.write(_struct_I.pack(length)) 00267 pattern = '<%sd'%length 00268 buff.write(struct.pack(pattern, *self.N.data)) 00269 except struct.error as se: self._check_types(se) 00270 except TypeError as te: self._check_types(te) 00271 00272 def deserialize(self, str): 00273 """ 00274 unpack serialized message in str into this message instance 00275 @param str: byte array of serialized message 00276 @type str: str 00277 """ 00278 try: 00279 if self.header is None: 00280 self.header = std_msgs.msg._Header.Header() 00281 if self.x is None: 00282 self.x = geometry_msgs.msg.PoseStamped() 00283 if self.x_desi is None: 00284 self.x_desi = geometry_msgs.msg.PoseStamped() 00285 if self.x_desi_filtered is None: 00286 self.x_desi_filtered = geometry_msgs.msg.PoseStamped() 00287 if self.x_err is None: 00288 self.x_err = geometry_msgs.msg.Twist() 00289 if self.xd is None: 00290 self.xd = geometry_msgs.msg.Twist() 00291 if self.xd_desi is None: 00292 self.xd_desi = geometry_msgs.msg.Twist() 00293 if self.F is None: 00294 self.F = geometry_msgs.msg.Wrench() 00295 if self.J is None: 00296 self.J = std_msgs.msg.Float64MultiArray() 00297 if self.N is None: 00298 self.N = std_msgs.msg.Float64MultiArray() 00299 end = 0 00300 _x = self 00301 start = end 00302 end += 12 00303 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00304 start = end 00305 end += 4 00306 (length,) = _struct_I.unpack(str[start:end]) 00307 start = end 00308 end += length 00309 self.header.frame_id = str[start:end] 00310 _x = self 00311 start = end 00312 end += 12 00313 (_x.x.header.seq, _x.x.header.stamp.secs, _x.x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00314 start = end 00315 end += 4 00316 (length,) = _struct_I.unpack(str[start:end]) 00317 start = end 00318 end += length 00319 self.x.header.frame_id = str[start:end] 00320 _x = self 00321 start = end 00322 end += 68 00323 (_x.x.pose.position.x, _x.x.pose.position.y, _x.x.pose.position.z, _x.x.pose.orientation.x, _x.x.pose.orientation.y, _x.x.pose.orientation.z, _x.x.pose.orientation.w, _x.x_desi.header.seq, _x.x_desi.header.stamp.secs, _x.x_desi.header.stamp.nsecs,) = _struct_7d3I.unpack(str[start:end]) 00324 start = end 00325 end += 4 00326 (length,) = _struct_I.unpack(str[start:end]) 00327 start = end 00328 end += length 00329 self.x_desi.header.frame_id = str[start:end] 00330 _x = self 00331 start = end 00332 end += 68 00333 (_x.x_desi.pose.position.x, _x.x_desi.pose.position.y, _x.x_desi.pose.position.z, _x.x_desi.pose.orientation.x, _x.x_desi.pose.orientation.y, _x.x_desi.pose.orientation.z, _x.x_desi.pose.orientation.w, _x.x_desi_filtered.header.seq, _x.x_desi_filtered.header.stamp.secs, _x.x_desi_filtered.header.stamp.nsecs,) = _struct_7d3I.unpack(str[start:end]) 00334 start = end 00335 end += 4 00336 (length,) = _struct_I.unpack(str[start:end]) 00337 start = end 00338 end += length 00339 self.x_desi_filtered.header.frame_id = str[start:end] 00340 _x = self 00341 start = end 00342 end += 248 00343 (_x.x_desi_filtered.pose.position.x, _x.x_desi_filtered.pose.position.y, _x.x_desi_filtered.pose.position.z, _x.x_desi_filtered.pose.orientation.x, _x.x_desi_filtered.pose.orientation.y, _x.x_desi_filtered.pose.orientation.z, _x.x_desi_filtered.pose.orientation.w, _x.x_err.linear.x, _x.x_err.linear.y, _x.x_err.linear.z, _x.x_err.angular.x, _x.x_err.angular.y, _x.x_err.angular.z, _x.xd.linear.x, _x.xd.linear.y, _x.xd.linear.z, _x.xd.angular.x, _x.xd.angular.y, _x.xd.angular.z, _x.xd_desi.linear.x, _x.xd_desi.linear.y, _x.xd_desi.linear.z, _x.xd_desi.angular.x, _x.xd_desi.angular.y, _x.xd_desi.angular.z, _x.F.force.x, _x.F.force.y, _x.F.force.z, _x.F.torque.x, _x.F.torque.y, _x.F.torque.z,) = _struct_31d.unpack(str[start:end]) 00344 start = end 00345 end += 4 00346 (length,) = _struct_I.unpack(str[start:end]) 00347 pattern = '<%sd'%length 00348 start = end 00349 end += struct.calcsize(pattern) 00350 self.tau_pose = struct.unpack(pattern, str[start:end]) 00351 start = end 00352 end += 4 00353 (length,) = _struct_I.unpack(str[start:end]) 00354 pattern = '<%sd'%length 00355 start = end 00356 end += struct.calcsize(pattern) 00357 self.tau_posture = struct.unpack(pattern, str[start:end]) 00358 start = end 00359 end += 4 00360 (length,) = _struct_I.unpack(str[start:end]) 00361 pattern = '<%sd'%length 00362 start = end 00363 end += struct.calcsize(pattern) 00364 self.tau = struct.unpack(pattern, str[start:end]) 00365 start = end 00366 end += 4 00367 (length,) = _struct_I.unpack(str[start:end]) 00368 self.J.layout.dim = [] 00369 for i in range(0, length): 00370 val1 = std_msgs.msg.MultiArrayDimension() 00371 start = end 00372 end += 4 00373 (length,) = _struct_I.unpack(str[start:end]) 00374 start = end 00375 end += length 00376 val1.label = str[start:end] 00377 _x = val1 00378 start = end 00379 end += 8 00380 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00381 self.J.layout.dim.append(val1) 00382 start = end 00383 end += 4 00384 (self.J.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00385 start = end 00386 end += 4 00387 (length,) = _struct_I.unpack(str[start:end]) 00388 pattern = '<%sd'%length 00389 start = end 00390 end += struct.calcsize(pattern) 00391 self.J.data = struct.unpack(pattern, str[start:end]) 00392 start = end 00393 end += 4 00394 (length,) = _struct_I.unpack(str[start:end]) 00395 self.N.layout.dim = [] 00396 for i in range(0, length): 00397 val1 = std_msgs.msg.MultiArrayDimension() 00398 start = end 00399 end += 4 00400 (length,) = _struct_I.unpack(str[start:end]) 00401 start = end 00402 end += length 00403 val1.label = str[start:end] 00404 _x = val1 00405 start = end 00406 end += 8 00407 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00408 self.N.layout.dim.append(val1) 00409 start = end 00410 end += 4 00411 (self.N.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00412 start = end 00413 end += 4 00414 (length,) = _struct_I.unpack(str[start:end]) 00415 pattern = '<%sd'%length 00416 start = end 00417 end += struct.calcsize(pattern) 00418 self.N.data = struct.unpack(pattern, str[start:end]) 00419 return self 00420 except struct.error as e: 00421 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00422 00423 00424 def serialize_numpy(self, buff, numpy): 00425 """ 00426 serialize message with numpy array types into buffer 00427 @param buff: buffer 00428 @type buff: StringIO 00429 @param numpy: numpy python module 00430 @type numpy module 00431 """ 00432 try: 00433 _x = self 00434 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00435 _x = self.header.frame_id 00436 length = len(_x) 00437 buff.write(struct.pack('<I%ss'%length, length, _x)) 00438 _x = self 00439 buff.write(_struct_3I.pack(_x.x.header.seq, _x.x.header.stamp.secs, _x.x.header.stamp.nsecs)) 00440 _x = self.x.header.frame_id 00441 length = len(_x) 00442 buff.write(struct.pack('<I%ss'%length, length, _x)) 00443 _x = self 00444 buff.write(_struct_7d3I.pack(_x.x.pose.position.x, _x.x.pose.position.y, _x.x.pose.position.z, _x.x.pose.orientation.x, _x.x.pose.orientation.y, _x.x.pose.orientation.z, _x.x.pose.orientation.w, _x.x_desi.header.seq, _x.x_desi.header.stamp.secs, _x.x_desi.header.stamp.nsecs)) 00445 _x = self.x_desi.header.frame_id 00446 length = len(_x) 00447 buff.write(struct.pack('<I%ss'%length, length, _x)) 00448 _x = self 00449 buff.write(_struct_7d3I.pack(_x.x_desi.pose.position.x, _x.x_desi.pose.position.y, _x.x_desi.pose.position.z, _x.x_desi.pose.orientation.x, _x.x_desi.pose.orientation.y, _x.x_desi.pose.orientation.z, _x.x_desi.pose.orientation.w, _x.x_desi_filtered.header.seq, _x.x_desi_filtered.header.stamp.secs, _x.x_desi_filtered.header.stamp.nsecs)) 00450 _x = self.x_desi_filtered.header.frame_id 00451 length = len(_x) 00452 buff.write(struct.pack('<I%ss'%length, length, _x)) 00453 _x = self 00454 buff.write(_struct_31d.pack(_x.x_desi_filtered.pose.position.x, _x.x_desi_filtered.pose.position.y, _x.x_desi_filtered.pose.position.z, _x.x_desi_filtered.pose.orientation.x, _x.x_desi_filtered.pose.orientation.y, _x.x_desi_filtered.pose.orientation.z, _x.x_desi_filtered.pose.orientation.w, _x.x_err.linear.x, _x.x_err.linear.y, _x.x_err.linear.z, _x.x_err.angular.x, _x.x_err.angular.y, _x.x_err.angular.z, _x.xd.linear.x, _x.xd.linear.y, _x.xd.linear.z, _x.xd.angular.x, _x.xd.angular.y, _x.xd.angular.z, _x.xd_desi.linear.x, _x.xd_desi.linear.y, _x.xd_desi.linear.z, _x.xd_desi.angular.x, _x.xd_desi.angular.y, _x.xd_desi.angular.z, _x.F.force.x, _x.F.force.y, _x.F.force.z, _x.F.torque.x, _x.F.torque.y, _x.F.torque.z)) 00455 length = len(self.tau_pose) 00456 buff.write(_struct_I.pack(length)) 00457 pattern = '<%sd'%length 00458 buff.write(self.tau_pose.tostring()) 00459 length = len(self.tau_posture) 00460 buff.write(_struct_I.pack(length)) 00461 pattern = '<%sd'%length 00462 buff.write(self.tau_posture.tostring()) 00463 length = len(self.tau) 00464 buff.write(_struct_I.pack(length)) 00465 pattern = '<%sd'%length 00466 buff.write(self.tau.tostring()) 00467 length = len(self.J.layout.dim) 00468 buff.write(_struct_I.pack(length)) 00469 for val1 in self.J.layout.dim: 00470 _x = val1.label 00471 length = len(_x) 00472 buff.write(struct.pack('<I%ss'%length, length, _x)) 00473 _x = val1 00474 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00475 buff.write(_struct_I.pack(self.J.layout.data_offset)) 00476 length = len(self.J.data) 00477 buff.write(_struct_I.pack(length)) 00478 pattern = '<%sd'%length 00479 buff.write(self.J.data.tostring()) 00480 length = len(self.N.layout.dim) 00481 buff.write(_struct_I.pack(length)) 00482 for val1 in self.N.layout.dim: 00483 _x = val1.label 00484 length = len(_x) 00485 buff.write(struct.pack('<I%ss'%length, length, _x)) 00486 _x = val1 00487 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00488 buff.write(_struct_I.pack(self.N.layout.data_offset)) 00489 length = len(self.N.data) 00490 buff.write(_struct_I.pack(length)) 00491 pattern = '<%sd'%length 00492 buff.write(self.N.data.tostring()) 00493 except struct.error as se: self._check_types(se) 00494 except TypeError as te: self._check_types(te) 00495 00496 def deserialize_numpy(self, str, numpy): 00497 """ 00498 unpack serialized message in str into this message instance using numpy for array types 00499 @param str: byte array of serialized message 00500 @type str: str 00501 @param numpy: numpy python module 00502 @type numpy: module 00503 """ 00504 try: 00505 if self.header is None: 00506 self.header = std_msgs.msg._Header.Header() 00507 if self.x is None: 00508 self.x = geometry_msgs.msg.PoseStamped() 00509 if self.x_desi is None: 00510 self.x_desi = geometry_msgs.msg.PoseStamped() 00511 if self.x_desi_filtered is None: 00512 self.x_desi_filtered = geometry_msgs.msg.PoseStamped() 00513 if self.x_err is None: 00514 self.x_err = geometry_msgs.msg.Twist() 00515 if self.xd is None: 00516 self.xd = geometry_msgs.msg.Twist() 00517 if self.xd_desi is None: 00518 self.xd_desi = geometry_msgs.msg.Twist() 00519 if self.F is None: 00520 self.F = geometry_msgs.msg.Wrench() 00521 if self.J is None: 00522 self.J = std_msgs.msg.Float64MultiArray() 00523 if self.N is None: 00524 self.N = std_msgs.msg.Float64MultiArray() 00525 end = 0 00526 _x = self 00527 start = end 00528 end += 12 00529 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00530 start = end 00531 end += 4 00532 (length,) = _struct_I.unpack(str[start:end]) 00533 start = end 00534 end += length 00535 self.header.frame_id = str[start:end] 00536 _x = self 00537 start = end 00538 end += 12 00539 (_x.x.header.seq, _x.x.header.stamp.secs, _x.x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00540 start = end 00541 end += 4 00542 (length,) = _struct_I.unpack(str[start:end]) 00543 start = end 00544 end += length 00545 self.x.header.frame_id = str[start:end] 00546 _x = self 00547 start = end 00548 end += 68 00549 (_x.x.pose.position.x, _x.x.pose.position.y, _x.x.pose.position.z, _x.x.pose.orientation.x, _x.x.pose.orientation.y, _x.x.pose.orientation.z, _x.x.pose.orientation.w, _x.x_desi.header.seq, _x.x_desi.header.stamp.secs, _x.x_desi.header.stamp.nsecs,) = _struct_7d3I.unpack(str[start:end]) 00550 start = end 00551 end += 4 00552 (length,) = _struct_I.unpack(str[start:end]) 00553 start = end 00554 end += length 00555 self.x_desi.header.frame_id = str[start:end] 00556 _x = self 00557 start = end 00558 end += 68 00559 (_x.x_desi.pose.position.x, _x.x_desi.pose.position.y, _x.x_desi.pose.position.z, _x.x_desi.pose.orientation.x, _x.x_desi.pose.orientation.y, _x.x_desi.pose.orientation.z, _x.x_desi.pose.orientation.w, _x.x_desi_filtered.header.seq, _x.x_desi_filtered.header.stamp.secs, _x.x_desi_filtered.header.stamp.nsecs,) = _struct_7d3I.unpack(str[start:end]) 00560 start = end 00561 end += 4 00562 (length,) = _struct_I.unpack(str[start:end]) 00563 start = end 00564 end += length 00565 self.x_desi_filtered.header.frame_id = str[start:end] 00566 _x = self 00567 start = end 00568 end += 248 00569 (_x.x_desi_filtered.pose.position.x, _x.x_desi_filtered.pose.position.y, _x.x_desi_filtered.pose.position.z, _x.x_desi_filtered.pose.orientation.x, _x.x_desi_filtered.pose.orientation.y, _x.x_desi_filtered.pose.orientation.z, _x.x_desi_filtered.pose.orientation.w, _x.x_err.linear.x, _x.x_err.linear.y, _x.x_err.linear.z, _x.x_err.angular.x, _x.x_err.angular.y, _x.x_err.angular.z, _x.xd.linear.x, _x.xd.linear.y, _x.xd.linear.z, _x.xd.angular.x, _x.xd.angular.y, _x.xd.angular.z, _x.xd_desi.linear.x, _x.xd_desi.linear.y, _x.xd_desi.linear.z, _x.xd_desi.angular.x, _x.xd_desi.angular.y, _x.xd_desi.angular.z, _x.F.force.x, _x.F.force.y, _x.F.force.z, _x.F.torque.x, _x.F.torque.y, _x.F.torque.z,) = _struct_31d.unpack(str[start:end]) 00570 start = end 00571 end += 4 00572 (length,) = _struct_I.unpack(str[start:end]) 00573 pattern = '<%sd'%length 00574 start = end 00575 end += struct.calcsize(pattern) 00576 self.tau_pose = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00577 start = end 00578 end += 4 00579 (length,) = _struct_I.unpack(str[start:end]) 00580 pattern = '<%sd'%length 00581 start = end 00582 end += struct.calcsize(pattern) 00583 self.tau_posture = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00584 start = end 00585 end += 4 00586 (length,) = _struct_I.unpack(str[start:end]) 00587 pattern = '<%sd'%length 00588 start = end 00589 end += struct.calcsize(pattern) 00590 self.tau = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00591 start = end 00592 end += 4 00593 (length,) = _struct_I.unpack(str[start:end]) 00594 self.J.layout.dim = [] 00595 for i in range(0, length): 00596 val1 = std_msgs.msg.MultiArrayDimension() 00597 start = end 00598 end += 4 00599 (length,) = _struct_I.unpack(str[start:end]) 00600 start = end 00601 end += length 00602 val1.label = str[start:end] 00603 _x = val1 00604 start = end 00605 end += 8 00606 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00607 self.J.layout.dim.append(val1) 00608 start = end 00609 end += 4 00610 (self.J.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00611 start = end 00612 end += 4 00613 (length,) = _struct_I.unpack(str[start:end]) 00614 pattern = '<%sd'%length 00615 start = end 00616 end += struct.calcsize(pattern) 00617 self.J.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00618 start = end 00619 end += 4 00620 (length,) = _struct_I.unpack(str[start:end]) 00621 self.N.layout.dim = [] 00622 for i in range(0, length): 00623 val1 = std_msgs.msg.MultiArrayDimension() 00624 start = end 00625 end += 4 00626 (length,) = _struct_I.unpack(str[start:end]) 00627 start = end 00628 end += length 00629 val1.label = str[start:end] 00630 _x = val1 00631 start = end 00632 end += 8 00633 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00634 self.N.layout.dim.append(val1) 00635 start = end 00636 end += 4 00637 (self.N.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00638 start = end 00639 end += 4 00640 (length,) = _struct_I.unpack(str[start:end]) 00641 pattern = '<%sd'%length 00642 start = end 00643 end += struct.calcsize(pattern) 00644 self.N.data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00645 return self 00646 except struct.error as e: 00647 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00648 00649 _struct_I = roslib.message.struct_I 00650 _struct_3I = struct.Struct("<3I") 00651 _struct_7d3I = struct.Struct("<7d3I") 00652 _struct_2I = struct.Struct("<2I") 00653 _struct_31d = struct.Struct("<31d")