$search
00001 """autogenerated by genmsg_py from JointStateCalibrationPattern.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import sensor_msgs.msg 00006 import geometry_msgs.msg 00007 import std_msgs.msg 00008 00009 class JointStateCalibrationPattern(roslib.message.Message): 00010 _md5sum = "2a9763ecd4115aab77fac06c99ae1fb7" 00011 _type = "calibration_msgs/JointStateCalibrationPattern" 00012 _has_header = True #flag to mark the presence of a Header object 00013 _full_text = """Header header 00014 geometry_msgs/Point32[] object_points 00015 sensor_msgs/JointState[] joint_points 00016 00017 00018 ================================================================================ 00019 MSG: std_msgs/Header 00020 # Standard metadata for higher-level stamped data types. 00021 # This is generally used to communicate timestamped data 00022 # in a particular coordinate frame. 00023 # 00024 # sequence ID: consecutively increasing ID 00025 uint32 seq 00026 #Two-integer timestamp that is expressed as: 00027 # * stamp.secs: seconds (stamp_secs) since epoch 00028 # * stamp.nsecs: nanoseconds since stamp_secs 00029 # time-handling sugar is provided by the client library 00030 time stamp 00031 #Frame this data is associated with 00032 # 0: no frame 00033 # 1: global frame 00034 string frame_id 00035 00036 ================================================================================ 00037 MSG: geometry_msgs/Point32 00038 # This contains the position of a point in free space(with 32 bits of precision). 00039 # It is recommeded to use Point wherever possible instead of Point32. 00040 # 00041 # This recommendation is to promote interoperability. 00042 # 00043 # This message is designed to take up less space when sending 00044 # lots of points at once, as in the case of a PointCloud. 00045 00046 float32 x 00047 float32 y 00048 float32 z 00049 ================================================================================ 00050 MSG: sensor_msgs/JointState 00051 # This is a message that holds data to describe the state of a set of torque controlled joints. 00052 # 00053 # The state of each joint (revolute or prismatic) is defined by: 00054 # * the position of the joint (rad or m), 00055 # * the velocity of the joint (rad/s or m/s) and 00056 # * the effort that is applied in the joint (Nm or N). 00057 # 00058 # Each joint is uniquely identified by its name 00059 # The header specifies the time at which the joint states were recorded. All the joint states 00060 # in one message have to be recorded at the same time. 00061 # 00062 # This message consists of a multiple arrays, one for each part of the joint state. 00063 # The goal is to make each of the fields optional. When e.g. your joints have no 00064 # effort associated with them, you can leave the effort array empty. 00065 # 00066 # All arrays in this message should have the same size, or be empty. 00067 # This is the only way to uniquely associate the joint name with the correct 00068 # states. 00069 00070 00071 Header header 00072 00073 string[] name 00074 float64[] position 00075 float64[] velocity 00076 float64[] effort 00077 00078 """ 00079 __slots__ = ['header','object_points','joint_points'] 00080 _slot_types = ['Header','geometry_msgs/Point32[]','sensor_msgs/JointState[]'] 00081 00082 def __init__(self, *args, **kwds): 00083 """ 00084 Constructor. Any message fields that are implicitly/explicitly 00085 set to None will be assigned a default value. The recommend 00086 use is keyword arguments as this is more robust to future message 00087 changes. You cannot mix in-order arguments and keyword arguments. 00088 00089 The available fields are: 00090 header,object_points,joint_points 00091 00092 @param args: complete set of field values, in .msg order 00093 @param kwds: use keyword arguments corresponding to message field names 00094 to set specific fields. 00095 """ 00096 if args or kwds: 00097 super(JointStateCalibrationPattern, self).__init__(*args, **kwds) 00098 #message fields cannot be None, assign default values for those that are 00099 if self.header is None: 00100 self.header = std_msgs.msg._Header.Header() 00101 if self.object_points is None: 00102 self.object_points = [] 00103 if self.joint_points is None: 00104 self.joint_points = [] 00105 else: 00106 self.header = std_msgs.msg._Header.Header() 00107 self.object_points = [] 00108 self.joint_points = [] 00109 00110 def _get_types(self): 00111 """ 00112 internal API method 00113 """ 00114 return self._slot_types 00115 00116 def serialize(self, buff): 00117 """ 00118 serialize message into buffer 00119 @param buff: buffer 00120 @type buff: StringIO 00121 """ 00122 try: 00123 _x = self 00124 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00125 _x = self.header.frame_id 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 length = len(self.object_points) 00129 buff.write(_struct_I.pack(length)) 00130 for val1 in self.object_points: 00131 _x = val1 00132 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00133 length = len(self.joint_points) 00134 buff.write(_struct_I.pack(length)) 00135 for val1 in self.joint_points: 00136 _v1 = val1.header 00137 buff.write(_struct_I.pack(_v1.seq)) 00138 _v2 = _v1.stamp 00139 _x = _v2 00140 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00141 _x = _v1.frame_id 00142 length = len(_x) 00143 buff.write(struct.pack('<I%ss'%length, length, _x)) 00144 length = len(val1.name) 00145 buff.write(_struct_I.pack(length)) 00146 for val2 in val1.name: 00147 length = len(val2) 00148 buff.write(struct.pack('<I%ss'%length, length, val2)) 00149 length = len(val1.position) 00150 buff.write(_struct_I.pack(length)) 00151 pattern = '<%sd'%length 00152 buff.write(struct.pack(pattern, *val1.position)) 00153 length = len(val1.velocity) 00154 buff.write(_struct_I.pack(length)) 00155 pattern = '<%sd'%length 00156 buff.write(struct.pack(pattern, *val1.velocity)) 00157 length = len(val1.effort) 00158 buff.write(_struct_I.pack(length)) 00159 pattern = '<%sd'%length 00160 buff.write(struct.pack(pattern, *val1.effort)) 00161 except struct.error as se: self._check_types(se) 00162 except TypeError as te: self._check_types(te) 00163 00164 def deserialize(self, str): 00165 """ 00166 unpack serialized message in str into this message instance 00167 @param str: byte array of serialized message 00168 @type str: str 00169 """ 00170 try: 00171 if self.header is None: 00172 self.header = std_msgs.msg._Header.Header() 00173 end = 0 00174 _x = self 00175 start = end 00176 end += 12 00177 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00178 start = end 00179 end += 4 00180 (length,) = _struct_I.unpack(str[start:end]) 00181 start = end 00182 end += length 00183 self.header.frame_id = str[start:end] 00184 start = end 00185 end += 4 00186 (length,) = _struct_I.unpack(str[start:end]) 00187 self.object_points = [] 00188 for i in range(0, length): 00189 val1 = geometry_msgs.msg.Point32() 00190 _x = val1 00191 start = end 00192 end += 12 00193 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00194 self.object_points.append(val1) 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 self.joint_points = [] 00199 for i in range(0, length): 00200 val1 = sensor_msgs.msg.JointState() 00201 _v3 = val1.header 00202 start = end 00203 end += 4 00204 (_v3.seq,) = _struct_I.unpack(str[start:end]) 00205 _v4 = _v3.stamp 00206 _x = _v4 00207 start = end 00208 end += 8 00209 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 start = end 00214 end += length 00215 _v3.frame_id = str[start:end] 00216 start = end 00217 end += 4 00218 (length,) = _struct_I.unpack(str[start:end]) 00219 val1.name = [] 00220 for i in range(0, length): 00221 start = end 00222 end += 4 00223 (length,) = _struct_I.unpack(str[start:end]) 00224 start = end 00225 end += length 00226 val2 = str[start:end] 00227 val1.name.append(val2) 00228 start = end 00229 end += 4 00230 (length,) = _struct_I.unpack(str[start:end]) 00231 pattern = '<%sd'%length 00232 start = end 00233 end += struct.calcsize(pattern) 00234 val1.position = struct.unpack(pattern, str[start:end]) 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 pattern = '<%sd'%length 00239 start = end 00240 end += struct.calcsize(pattern) 00241 val1.velocity = struct.unpack(pattern, str[start:end]) 00242 start = end 00243 end += 4 00244 (length,) = _struct_I.unpack(str[start:end]) 00245 pattern = '<%sd'%length 00246 start = end 00247 end += struct.calcsize(pattern) 00248 val1.effort = struct.unpack(pattern, str[start:end]) 00249 self.joint_points.append(val1) 00250 return self 00251 except struct.error as e: 00252 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00253 00254 00255 def serialize_numpy(self, buff, numpy): 00256 """ 00257 serialize message with numpy array types into buffer 00258 @param buff: buffer 00259 @type buff: StringIO 00260 @param numpy: numpy python module 00261 @type numpy module 00262 """ 00263 try: 00264 _x = self 00265 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00266 _x = self.header.frame_id 00267 length = len(_x) 00268 buff.write(struct.pack('<I%ss'%length, length, _x)) 00269 length = len(self.object_points) 00270 buff.write(_struct_I.pack(length)) 00271 for val1 in self.object_points: 00272 _x = val1 00273 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00274 length = len(self.joint_points) 00275 buff.write(_struct_I.pack(length)) 00276 for val1 in self.joint_points: 00277 _v5 = val1.header 00278 buff.write(_struct_I.pack(_v5.seq)) 00279 _v6 = _v5.stamp 00280 _x = _v6 00281 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00282 _x = _v5.frame_id 00283 length = len(_x) 00284 buff.write(struct.pack('<I%ss'%length, length, _x)) 00285 length = len(val1.name) 00286 buff.write(_struct_I.pack(length)) 00287 for val2 in val1.name: 00288 length = len(val2) 00289 buff.write(struct.pack('<I%ss'%length, length, val2)) 00290 length = len(val1.position) 00291 buff.write(_struct_I.pack(length)) 00292 pattern = '<%sd'%length 00293 buff.write(val1.position.tostring()) 00294 length = len(val1.velocity) 00295 buff.write(_struct_I.pack(length)) 00296 pattern = '<%sd'%length 00297 buff.write(val1.velocity.tostring()) 00298 length = len(val1.effort) 00299 buff.write(_struct_I.pack(length)) 00300 pattern = '<%sd'%length 00301 buff.write(val1.effort.tostring()) 00302 except struct.error as se: self._check_types(se) 00303 except TypeError as te: self._check_types(te) 00304 00305 def deserialize_numpy(self, str, numpy): 00306 """ 00307 unpack serialized message in str into this message instance using numpy for array types 00308 @param str: byte array of serialized message 00309 @type str: str 00310 @param numpy: numpy python module 00311 @type numpy: module 00312 """ 00313 try: 00314 if self.header is None: 00315 self.header = std_msgs.msg._Header.Header() 00316 end = 0 00317 _x = self 00318 start = end 00319 end += 12 00320 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00321 start = end 00322 end += 4 00323 (length,) = _struct_I.unpack(str[start:end]) 00324 start = end 00325 end += length 00326 self.header.frame_id = str[start:end] 00327 start = end 00328 end += 4 00329 (length,) = _struct_I.unpack(str[start:end]) 00330 self.object_points = [] 00331 for i in range(0, length): 00332 val1 = geometry_msgs.msg.Point32() 00333 _x = val1 00334 start = end 00335 end += 12 00336 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00337 self.object_points.append(val1) 00338 start = end 00339 end += 4 00340 (length,) = _struct_I.unpack(str[start:end]) 00341 self.joint_points = [] 00342 for i in range(0, length): 00343 val1 = sensor_msgs.msg.JointState() 00344 _v7 = val1.header 00345 start = end 00346 end += 4 00347 (_v7.seq,) = _struct_I.unpack(str[start:end]) 00348 _v8 = _v7.stamp 00349 _x = _v8 00350 start = end 00351 end += 8 00352 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00353 start = end 00354 end += 4 00355 (length,) = _struct_I.unpack(str[start:end]) 00356 start = end 00357 end += length 00358 _v7.frame_id = str[start:end] 00359 start = end 00360 end += 4 00361 (length,) = _struct_I.unpack(str[start:end]) 00362 val1.name = [] 00363 for i in range(0, length): 00364 start = end 00365 end += 4 00366 (length,) = _struct_I.unpack(str[start:end]) 00367 start = end 00368 end += length 00369 val2 = str[start:end] 00370 val1.name.append(val2) 00371 start = end 00372 end += 4 00373 (length,) = _struct_I.unpack(str[start:end]) 00374 pattern = '<%sd'%length 00375 start = end 00376 end += struct.calcsize(pattern) 00377 val1.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00378 start = end 00379 end += 4 00380 (length,) = _struct_I.unpack(str[start:end]) 00381 pattern = '<%sd'%length 00382 start = end 00383 end += struct.calcsize(pattern) 00384 val1.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 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 val1.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00392 self.joint_points.append(val1) 00393 return self 00394 except struct.error as e: 00395 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00396 00397 _struct_I = roslib.message.struct_I 00398 _struct_3I = struct.Struct("<3I") 00399 _struct_3f = struct.Struct("<3f") 00400 _struct_2I = struct.Struct("<2I")