$search
00001 """autogenerated by genmsg_py from JointAnglesWithSpeedAction.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import sensor_msgs.msg 00007 import nao_msgs.msg 00008 import actionlib_msgs.msg 00009 import std_msgs.msg 00010 00011 class JointAnglesWithSpeedAction(roslib.message.Message): 00012 _md5sum = "efd2f7ac88847414fd26aacf32f993a5" 00013 _type = "nao_msgs/JointAnglesWithSpeedAction" 00014 _has_header = False #flag to mark the presence of a Header object 00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00016 00017 JointAnglesWithSpeedActionGoal action_goal 00018 JointAnglesWithSpeedActionResult action_result 00019 JointAnglesWithSpeedActionFeedback action_feedback 00020 00021 ================================================================================ 00022 MSG: nao_msgs/JointAnglesWithSpeedActionGoal 00023 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00024 00025 Header header 00026 actionlib_msgs/GoalID goal_id 00027 JointAnglesWithSpeedGoal goal 00028 00029 ================================================================================ 00030 MSG: std_msgs/Header 00031 # Standard metadata for higher-level stamped data types. 00032 # This is generally used to communicate timestamped data 00033 # in a particular coordinate frame. 00034 # 00035 # sequence ID: consecutively increasing ID 00036 uint32 seq 00037 #Two-integer timestamp that is expressed as: 00038 # * stamp.secs: seconds (stamp_secs) since epoch 00039 # * stamp.nsecs: nanoseconds since stamp_secs 00040 # time-handling sugar is provided by the client library 00041 time stamp 00042 #Frame this data is associated with 00043 # 0: no frame 00044 # 1: global frame 00045 string frame_id 00046 00047 ================================================================================ 00048 MSG: actionlib_msgs/GoalID 00049 # The stamp should store the time at which this goal was requested. 00050 # It is used by an action server when it tries to preempt all 00051 # goals that were requested before a certain time 00052 time stamp 00053 00054 # The id provides a way to associate feedback and 00055 # result message with specific goal requests. The id 00056 # specified must be unique. 00057 string id 00058 00059 00060 ================================================================================ 00061 MSG: nao_msgs/JointAnglesWithSpeedGoal 00062 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00063 # goal: a registered body pose name 00064 nao_msgs/JointAnglesWithSpeed joint_angles 00065 00066 ================================================================================ 00067 MSG: nao_msgs/JointAnglesWithSpeed 00068 Header header 00069 00070 # A list of joint names, corresponding to their names in the Nao docs. 00071 # This must be either the same lenght of joint_angles or 1 if it's a 00072 # keyword such as 'Body' (for all angles) 00073 string[] joint_names 00074 float32[] joint_angles 00075 00076 #fraction of max joint velocity [0:1] 00077 float32 speed 00078 00079 # Absolute angle(=0, default) or relative change 00080 uint8 relative 00081 00082 ================================================================================ 00083 MSG: nao_msgs/JointAnglesWithSpeedActionResult 00084 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00085 00086 Header header 00087 actionlib_msgs/GoalStatus status 00088 JointAnglesWithSpeedResult result 00089 00090 ================================================================================ 00091 MSG: actionlib_msgs/GoalStatus 00092 GoalID goal_id 00093 uint8 status 00094 uint8 PENDING = 0 # The goal has yet to be processed by the action server 00095 uint8 ACTIVE = 1 # The goal is currently being processed by the action server 00096 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing 00097 # and has since completed its execution (Terminal State) 00098 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) 00099 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due 00100 # to some failure (Terminal State) 00101 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, 00102 # because the goal was unattainable or invalid (Terminal State) 00103 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing 00104 # and has not yet completed execution 00105 uint8 RECALLING = 7 # The goal received a cancel request before it started executing, 00106 # but the action server has not yet confirmed that the goal is canceled 00107 uint8 RECALLED = 8 # The goal received a cancel request before it started executing 00108 # and was successfully cancelled (Terminal State) 00109 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be 00110 # sent over the wire by an action server 00111 00112 #Allow for the user to associate a string with GoalStatus for debugging 00113 string text 00114 00115 00116 ================================================================================ 00117 MSG: nao_msgs/JointAnglesWithSpeedResult 00118 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00119 # result is the actually reached position 00120 sensor_msgs/JointState goal_position 00121 00122 ================================================================================ 00123 MSG: sensor_msgs/JointState 00124 # This is a message that holds data to describe the state of a set of torque controlled joints. 00125 # 00126 # The state of each joint (revolute or prismatic) is defined by: 00127 # * the position of the joint (rad or m), 00128 # * the velocity of the joint (rad/s or m/s) and 00129 # * the effort that is applied in the joint (Nm or N). 00130 # 00131 # Each joint is uniquely identified by its name 00132 # The header specifies the time at which the joint states were recorded. All the joint states 00133 # in one message have to be recorded at the same time. 00134 # 00135 # This message consists of a multiple arrays, one for each part of the joint state. 00136 # The goal is to make each of the fields optional. When e.g. your joints have no 00137 # effort associated with them, you can leave the effort array empty. 00138 # 00139 # All arrays in this message should have the same size, or be empty. 00140 # This is the only way to uniquely associate the joint name with the correct 00141 # states. 00142 00143 00144 Header header 00145 00146 string[] name 00147 float64[] position 00148 float64[] velocity 00149 float64[] effort 00150 00151 ================================================================================ 00152 MSG: nao_msgs/JointAnglesWithSpeedActionFeedback 00153 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00154 00155 Header header 00156 actionlib_msgs/GoalStatus status 00157 JointAnglesWithSpeedFeedback feedback 00158 00159 ================================================================================ 00160 MSG: nao_msgs/JointAnglesWithSpeedFeedback 00161 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00162 # no feedback currently 00163 00164 """ 00165 __slots__ = ['action_goal','action_result','action_feedback'] 00166 _slot_types = ['nao_msgs/JointAnglesWithSpeedActionGoal','nao_msgs/JointAnglesWithSpeedActionResult','nao_msgs/JointAnglesWithSpeedActionFeedback'] 00167 00168 def __init__(self, *args, **kwds): 00169 """ 00170 Constructor. Any message fields that are implicitly/explicitly 00171 set to None will be assigned a default value. The recommend 00172 use is keyword arguments as this is more robust to future message 00173 changes. You cannot mix in-order arguments and keyword arguments. 00174 00175 The available fields are: 00176 action_goal,action_result,action_feedback 00177 00178 @param args: complete set of field values, in .msg order 00179 @param kwds: use keyword arguments corresponding to message field names 00180 to set specific fields. 00181 """ 00182 if args or kwds: 00183 super(JointAnglesWithSpeedAction, self).__init__(*args, **kwds) 00184 #message fields cannot be None, assign default values for those that are 00185 if self.action_goal is None: 00186 self.action_goal = nao_msgs.msg.JointAnglesWithSpeedActionGoal() 00187 if self.action_result is None: 00188 self.action_result = nao_msgs.msg.JointAnglesWithSpeedActionResult() 00189 if self.action_feedback is None: 00190 self.action_feedback = nao_msgs.msg.JointAnglesWithSpeedActionFeedback() 00191 else: 00192 self.action_goal = nao_msgs.msg.JointAnglesWithSpeedActionGoal() 00193 self.action_result = nao_msgs.msg.JointAnglesWithSpeedActionResult() 00194 self.action_feedback = nao_msgs.msg.JointAnglesWithSpeedActionFeedback() 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.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00211 _x = self.action_goal.header.frame_id 00212 length = len(_x) 00213 buff.write(struct.pack('<I%ss'%length, length, _x)) 00214 _x = self 00215 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00216 _x = self.action_goal.goal_id.id 00217 length = len(_x) 00218 buff.write(struct.pack('<I%ss'%length, length, _x)) 00219 _x = self 00220 buff.write(_struct_3I.pack(_x.action_goal.goal.joint_angles.header.seq, _x.action_goal.goal.joint_angles.header.stamp.secs, _x.action_goal.goal.joint_angles.header.stamp.nsecs)) 00221 _x = self.action_goal.goal.joint_angles.header.frame_id 00222 length = len(_x) 00223 buff.write(struct.pack('<I%ss'%length, length, _x)) 00224 length = len(self.action_goal.goal.joint_angles.joint_names) 00225 buff.write(_struct_I.pack(length)) 00226 for val1 in self.action_goal.goal.joint_angles.joint_names: 00227 length = len(val1) 00228 buff.write(struct.pack('<I%ss'%length, length, val1)) 00229 length = len(self.action_goal.goal.joint_angles.joint_angles) 00230 buff.write(_struct_I.pack(length)) 00231 pattern = '<%sf'%length 00232 buff.write(struct.pack(pattern, *self.action_goal.goal.joint_angles.joint_angles)) 00233 _x = self 00234 buff.write(_struct_fB3I.pack(_x.action_goal.goal.joint_angles.speed, _x.action_goal.goal.joint_angles.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00235 _x = self.action_result.header.frame_id 00236 length = len(_x) 00237 buff.write(struct.pack('<I%ss'%length, length, _x)) 00238 _x = self 00239 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00240 _x = self.action_result.status.goal_id.id 00241 length = len(_x) 00242 buff.write(struct.pack('<I%ss'%length, length, _x)) 00243 buff.write(_struct_B.pack(self.action_result.status.status)) 00244 _x = self.action_result.status.text 00245 length = len(_x) 00246 buff.write(struct.pack('<I%ss'%length, length, _x)) 00247 _x = self 00248 buff.write(_struct_3I.pack(_x.action_result.result.goal_position.header.seq, _x.action_result.result.goal_position.header.stamp.secs, _x.action_result.result.goal_position.header.stamp.nsecs)) 00249 _x = self.action_result.result.goal_position.header.frame_id 00250 length = len(_x) 00251 buff.write(struct.pack('<I%ss'%length, length, _x)) 00252 length = len(self.action_result.result.goal_position.name) 00253 buff.write(_struct_I.pack(length)) 00254 for val1 in self.action_result.result.goal_position.name: 00255 length = len(val1) 00256 buff.write(struct.pack('<I%ss'%length, length, val1)) 00257 length = len(self.action_result.result.goal_position.position) 00258 buff.write(_struct_I.pack(length)) 00259 pattern = '<%sd'%length 00260 buff.write(struct.pack(pattern, *self.action_result.result.goal_position.position)) 00261 length = len(self.action_result.result.goal_position.velocity) 00262 buff.write(_struct_I.pack(length)) 00263 pattern = '<%sd'%length 00264 buff.write(struct.pack(pattern, *self.action_result.result.goal_position.velocity)) 00265 length = len(self.action_result.result.goal_position.effort) 00266 buff.write(_struct_I.pack(length)) 00267 pattern = '<%sd'%length 00268 buff.write(struct.pack(pattern, *self.action_result.result.goal_position.effort)) 00269 _x = self 00270 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00271 _x = self.action_feedback.header.frame_id 00272 length = len(_x) 00273 buff.write(struct.pack('<I%ss'%length, length, _x)) 00274 _x = self 00275 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00276 _x = self.action_feedback.status.goal_id.id 00277 length = len(_x) 00278 buff.write(struct.pack('<I%ss'%length, length, _x)) 00279 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00280 _x = self.action_feedback.status.text 00281 length = len(_x) 00282 buff.write(struct.pack('<I%ss'%length, length, _x)) 00283 except struct.error as se: self._check_types(se) 00284 except TypeError as te: self._check_types(te) 00285 00286 def deserialize(self, str): 00287 """ 00288 unpack serialized message in str into this message instance 00289 @param str: byte array of serialized message 00290 @type str: str 00291 """ 00292 try: 00293 if self.action_goal is None: 00294 self.action_goal = nao_msgs.msg.JointAnglesWithSpeedActionGoal() 00295 if self.action_result is None: 00296 self.action_result = nao_msgs.msg.JointAnglesWithSpeedActionResult() 00297 if self.action_feedback is None: 00298 self.action_feedback = nao_msgs.msg.JointAnglesWithSpeedActionFeedback() 00299 end = 0 00300 _x = self 00301 start = end 00302 end += 12 00303 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.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.action_goal.header.frame_id = str[start:end] 00310 _x = self 00311 start = end 00312 end += 8 00313 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.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.action_goal.goal_id.id = str[start:end] 00320 _x = self 00321 start = end 00322 end += 12 00323 (_x.action_goal.goal.joint_angles.header.seq, _x.action_goal.goal.joint_angles.header.stamp.secs, _x.action_goal.goal.joint_angles.header.stamp.nsecs,) = _struct_3I.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.action_goal.goal.joint_angles.header.frame_id = str[start:end] 00330 start = end 00331 end += 4 00332 (length,) = _struct_I.unpack(str[start:end]) 00333 self.action_goal.goal.joint_angles.joint_names = [] 00334 for i in range(0, length): 00335 start = end 00336 end += 4 00337 (length,) = _struct_I.unpack(str[start:end]) 00338 start = end 00339 end += length 00340 val1 = str[start:end] 00341 self.action_goal.goal.joint_angles.joint_names.append(val1) 00342 start = end 00343 end += 4 00344 (length,) = _struct_I.unpack(str[start:end]) 00345 pattern = '<%sf'%length 00346 start = end 00347 end += struct.calcsize(pattern) 00348 self.action_goal.goal.joint_angles.joint_angles = struct.unpack(pattern, str[start:end]) 00349 _x = self 00350 start = end 00351 end += 17 00352 (_x.action_goal.goal.joint_angles.speed, _x.action_goal.goal.joint_angles.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_fB3I.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 self.action_result.header.frame_id = str[start:end] 00359 _x = self 00360 start = end 00361 end += 8 00362 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00363 start = end 00364 end += 4 00365 (length,) = _struct_I.unpack(str[start:end]) 00366 start = end 00367 end += length 00368 self.action_result.status.goal_id.id = str[start:end] 00369 start = end 00370 end += 1 00371 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00372 start = end 00373 end += 4 00374 (length,) = _struct_I.unpack(str[start:end]) 00375 start = end 00376 end += length 00377 self.action_result.status.text = str[start:end] 00378 _x = self 00379 start = end 00380 end += 12 00381 (_x.action_result.result.goal_position.header.seq, _x.action_result.result.goal_position.header.stamp.secs, _x.action_result.result.goal_position.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00382 start = end 00383 end += 4 00384 (length,) = _struct_I.unpack(str[start:end]) 00385 start = end 00386 end += length 00387 self.action_result.result.goal_position.header.frame_id = str[start:end] 00388 start = end 00389 end += 4 00390 (length,) = _struct_I.unpack(str[start:end]) 00391 self.action_result.result.goal_position.name = [] 00392 for i in range(0, length): 00393 start = end 00394 end += 4 00395 (length,) = _struct_I.unpack(str[start:end]) 00396 start = end 00397 end += length 00398 val1 = str[start:end] 00399 self.action_result.result.goal_position.name.append(val1) 00400 start = end 00401 end += 4 00402 (length,) = _struct_I.unpack(str[start:end]) 00403 pattern = '<%sd'%length 00404 start = end 00405 end += struct.calcsize(pattern) 00406 self.action_result.result.goal_position.position = struct.unpack(pattern, str[start:end]) 00407 start = end 00408 end += 4 00409 (length,) = _struct_I.unpack(str[start:end]) 00410 pattern = '<%sd'%length 00411 start = end 00412 end += struct.calcsize(pattern) 00413 self.action_result.result.goal_position.velocity = struct.unpack(pattern, str[start:end]) 00414 start = end 00415 end += 4 00416 (length,) = _struct_I.unpack(str[start:end]) 00417 pattern = '<%sd'%length 00418 start = end 00419 end += struct.calcsize(pattern) 00420 self.action_result.result.goal_position.effort = struct.unpack(pattern, str[start:end]) 00421 _x = self 00422 start = end 00423 end += 12 00424 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00425 start = end 00426 end += 4 00427 (length,) = _struct_I.unpack(str[start:end]) 00428 start = end 00429 end += length 00430 self.action_feedback.header.frame_id = str[start:end] 00431 _x = self 00432 start = end 00433 end += 8 00434 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00435 start = end 00436 end += 4 00437 (length,) = _struct_I.unpack(str[start:end]) 00438 start = end 00439 end += length 00440 self.action_feedback.status.goal_id.id = str[start:end] 00441 start = end 00442 end += 1 00443 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00444 start = end 00445 end += 4 00446 (length,) = _struct_I.unpack(str[start:end]) 00447 start = end 00448 end += length 00449 self.action_feedback.status.text = str[start:end] 00450 return self 00451 except struct.error as e: 00452 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00453 00454 00455 def serialize_numpy(self, buff, numpy): 00456 """ 00457 serialize message with numpy array types into buffer 00458 @param buff: buffer 00459 @type buff: StringIO 00460 @param numpy: numpy python module 00461 @type numpy module 00462 """ 00463 try: 00464 _x = self 00465 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00466 _x = self.action_goal.header.frame_id 00467 length = len(_x) 00468 buff.write(struct.pack('<I%ss'%length, length, _x)) 00469 _x = self 00470 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00471 _x = self.action_goal.goal_id.id 00472 length = len(_x) 00473 buff.write(struct.pack('<I%ss'%length, length, _x)) 00474 _x = self 00475 buff.write(_struct_3I.pack(_x.action_goal.goal.joint_angles.header.seq, _x.action_goal.goal.joint_angles.header.stamp.secs, _x.action_goal.goal.joint_angles.header.stamp.nsecs)) 00476 _x = self.action_goal.goal.joint_angles.header.frame_id 00477 length = len(_x) 00478 buff.write(struct.pack('<I%ss'%length, length, _x)) 00479 length = len(self.action_goal.goal.joint_angles.joint_names) 00480 buff.write(_struct_I.pack(length)) 00481 for val1 in self.action_goal.goal.joint_angles.joint_names: 00482 length = len(val1) 00483 buff.write(struct.pack('<I%ss'%length, length, val1)) 00484 length = len(self.action_goal.goal.joint_angles.joint_angles) 00485 buff.write(_struct_I.pack(length)) 00486 pattern = '<%sf'%length 00487 buff.write(self.action_goal.goal.joint_angles.joint_angles.tostring()) 00488 _x = self 00489 buff.write(_struct_fB3I.pack(_x.action_goal.goal.joint_angles.speed, _x.action_goal.goal.joint_angles.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00490 _x = self.action_result.header.frame_id 00491 length = len(_x) 00492 buff.write(struct.pack('<I%ss'%length, length, _x)) 00493 _x = self 00494 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00495 _x = self.action_result.status.goal_id.id 00496 length = len(_x) 00497 buff.write(struct.pack('<I%ss'%length, length, _x)) 00498 buff.write(_struct_B.pack(self.action_result.status.status)) 00499 _x = self.action_result.status.text 00500 length = len(_x) 00501 buff.write(struct.pack('<I%ss'%length, length, _x)) 00502 _x = self 00503 buff.write(_struct_3I.pack(_x.action_result.result.goal_position.header.seq, _x.action_result.result.goal_position.header.stamp.secs, _x.action_result.result.goal_position.header.stamp.nsecs)) 00504 _x = self.action_result.result.goal_position.header.frame_id 00505 length = len(_x) 00506 buff.write(struct.pack('<I%ss'%length, length, _x)) 00507 length = len(self.action_result.result.goal_position.name) 00508 buff.write(_struct_I.pack(length)) 00509 for val1 in self.action_result.result.goal_position.name: 00510 length = len(val1) 00511 buff.write(struct.pack('<I%ss'%length, length, val1)) 00512 length = len(self.action_result.result.goal_position.position) 00513 buff.write(_struct_I.pack(length)) 00514 pattern = '<%sd'%length 00515 buff.write(self.action_result.result.goal_position.position.tostring()) 00516 length = len(self.action_result.result.goal_position.velocity) 00517 buff.write(_struct_I.pack(length)) 00518 pattern = '<%sd'%length 00519 buff.write(self.action_result.result.goal_position.velocity.tostring()) 00520 length = len(self.action_result.result.goal_position.effort) 00521 buff.write(_struct_I.pack(length)) 00522 pattern = '<%sd'%length 00523 buff.write(self.action_result.result.goal_position.effort.tostring()) 00524 _x = self 00525 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00526 _x = self.action_feedback.header.frame_id 00527 length = len(_x) 00528 buff.write(struct.pack('<I%ss'%length, length, _x)) 00529 _x = self 00530 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00531 _x = self.action_feedback.status.goal_id.id 00532 length = len(_x) 00533 buff.write(struct.pack('<I%ss'%length, length, _x)) 00534 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00535 _x = self.action_feedback.status.text 00536 length = len(_x) 00537 buff.write(struct.pack('<I%ss'%length, length, _x)) 00538 except struct.error as se: self._check_types(se) 00539 except TypeError as te: self._check_types(te) 00540 00541 def deserialize_numpy(self, str, numpy): 00542 """ 00543 unpack serialized message in str into this message instance using numpy for array types 00544 @param str: byte array of serialized message 00545 @type str: str 00546 @param numpy: numpy python module 00547 @type numpy: module 00548 """ 00549 try: 00550 if self.action_goal is None: 00551 self.action_goal = nao_msgs.msg.JointAnglesWithSpeedActionGoal() 00552 if self.action_result is None: 00553 self.action_result = nao_msgs.msg.JointAnglesWithSpeedActionResult() 00554 if self.action_feedback is None: 00555 self.action_feedback = nao_msgs.msg.JointAnglesWithSpeedActionFeedback() 00556 end = 0 00557 _x = self 00558 start = end 00559 end += 12 00560 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00561 start = end 00562 end += 4 00563 (length,) = _struct_I.unpack(str[start:end]) 00564 start = end 00565 end += length 00566 self.action_goal.header.frame_id = str[start:end] 00567 _x = self 00568 start = end 00569 end += 8 00570 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00571 start = end 00572 end += 4 00573 (length,) = _struct_I.unpack(str[start:end]) 00574 start = end 00575 end += length 00576 self.action_goal.goal_id.id = str[start:end] 00577 _x = self 00578 start = end 00579 end += 12 00580 (_x.action_goal.goal.joint_angles.header.seq, _x.action_goal.goal.joint_angles.header.stamp.secs, _x.action_goal.goal.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00581 start = end 00582 end += 4 00583 (length,) = _struct_I.unpack(str[start:end]) 00584 start = end 00585 end += length 00586 self.action_goal.goal.joint_angles.header.frame_id = str[start:end] 00587 start = end 00588 end += 4 00589 (length,) = _struct_I.unpack(str[start:end]) 00590 self.action_goal.goal.joint_angles.joint_names = [] 00591 for i in range(0, length): 00592 start = end 00593 end += 4 00594 (length,) = _struct_I.unpack(str[start:end]) 00595 start = end 00596 end += length 00597 val1 = str[start:end] 00598 self.action_goal.goal.joint_angles.joint_names.append(val1) 00599 start = end 00600 end += 4 00601 (length,) = _struct_I.unpack(str[start:end]) 00602 pattern = '<%sf'%length 00603 start = end 00604 end += struct.calcsize(pattern) 00605 self.action_goal.goal.joint_angles.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00606 _x = self 00607 start = end 00608 end += 17 00609 (_x.action_goal.goal.joint_angles.speed, _x.action_goal.goal.joint_angles.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_fB3I.unpack(str[start:end]) 00610 start = end 00611 end += 4 00612 (length,) = _struct_I.unpack(str[start:end]) 00613 start = end 00614 end += length 00615 self.action_result.header.frame_id = str[start:end] 00616 _x = self 00617 start = end 00618 end += 8 00619 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00620 start = end 00621 end += 4 00622 (length,) = _struct_I.unpack(str[start:end]) 00623 start = end 00624 end += length 00625 self.action_result.status.goal_id.id = str[start:end] 00626 start = end 00627 end += 1 00628 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00629 start = end 00630 end += 4 00631 (length,) = _struct_I.unpack(str[start:end]) 00632 start = end 00633 end += length 00634 self.action_result.status.text = str[start:end] 00635 _x = self 00636 start = end 00637 end += 12 00638 (_x.action_result.result.goal_position.header.seq, _x.action_result.result.goal_position.header.stamp.secs, _x.action_result.result.goal_position.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00639 start = end 00640 end += 4 00641 (length,) = _struct_I.unpack(str[start:end]) 00642 start = end 00643 end += length 00644 self.action_result.result.goal_position.header.frame_id = str[start:end] 00645 start = end 00646 end += 4 00647 (length,) = _struct_I.unpack(str[start:end]) 00648 self.action_result.result.goal_position.name = [] 00649 for i in range(0, length): 00650 start = end 00651 end += 4 00652 (length,) = _struct_I.unpack(str[start:end]) 00653 start = end 00654 end += length 00655 val1 = str[start:end] 00656 self.action_result.result.goal_position.name.append(val1) 00657 start = end 00658 end += 4 00659 (length,) = _struct_I.unpack(str[start:end]) 00660 pattern = '<%sd'%length 00661 start = end 00662 end += struct.calcsize(pattern) 00663 self.action_result.result.goal_position.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00664 start = end 00665 end += 4 00666 (length,) = _struct_I.unpack(str[start:end]) 00667 pattern = '<%sd'%length 00668 start = end 00669 end += struct.calcsize(pattern) 00670 self.action_result.result.goal_position.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00671 start = end 00672 end += 4 00673 (length,) = _struct_I.unpack(str[start:end]) 00674 pattern = '<%sd'%length 00675 start = end 00676 end += struct.calcsize(pattern) 00677 self.action_result.result.goal_position.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00678 _x = self 00679 start = end 00680 end += 12 00681 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00682 start = end 00683 end += 4 00684 (length,) = _struct_I.unpack(str[start:end]) 00685 start = end 00686 end += length 00687 self.action_feedback.header.frame_id = str[start:end] 00688 _x = self 00689 start = end 00690 end += 8 00691 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00692 start = end 00693 end += 4 00694 (length,) = _struct_I.unpack(str[start:end]) 00695 start = end 00696 end += length 00697 self.action_feedback.status.goal_id.id = str[start:end] 00698 start = end 00699 end += 1 00700 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00701 start = end 00702 end += 4 00703 (length,) = _struct_I.unpack(str[start:end]) 00704 start = end 00705 end += length 00706 self.action_feedback.status.text = str[start:end] 00707 return self 00708 except struct.error as e: 00709 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00710 00711 _struct_I = roslib.message.struct_I 00712 _struct_3I = struct.Struct("<3I") 00713 _struct_B = struct.Struct("<B") 00714 _struct_fB3I = struct.Struct("<fB3I") 00715 _struct_2I = struct.Struct("<2I")