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