00001 """autogenerated by genpy from nao_msgs/JointTrajectoryAction.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import trajectory_msgs.msg
00008 import nao_msgs.msg
00009 import actionlib_msgs.msg
00010 import sensor_msgs.msg
00011 import genpy
00012 import std_msgs.msg
00013
00014 class JointTrajectoryAction(genpy.Message):
00015 _md5sum = "47b9ba22fa50be8763fd3e5c3b06e11f"
00016 _type = "nao_msgs/JointTrajectoryAction"
00017 _has_header = False
00018 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00019
00020 JointTrajectoryActionGoal action_goal
00021 JointTrajectoryActionResult action_result
00022 JointTrajectoryActionFeedback action_feedback
00023
00024 ================================================================================
00025 MSG: nao_msgs/JointTrajectoryActionGoal
00026 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00027
00028 Header header
00029 actionlib_msgs/GoalID goal_id
00030 JointTrajectoryGoal goal
00031
00032 ================================================================================
00033 MSG: std_msgs/Header
00034 # Standard metadata for higher-level stamped data types.
00035 # This is generally used to communicate timestamped data
00036 # in a particular coordinate frame.
00037 #
00038 # sequence ID: consecutively increasing ID
00039 uint32 seq
00040 #Two-integer timestamp that is expressed as:
00041 # * stamp.secs: seconds (stamp_secs) since epoch
00042 # * stamp.nsecs: nanoseconds since stamp_secs
00043 # time-handling sugar is provided by the client library
00044 time stamp
00045 #Frame this data is associated with
00046 # 0: no frame
00047 # 1: global frame
00048 string frame_id
00049
00050 ================================================================================
00051 MSG: actionlib_msgs/GoalID
00052 # The stamp should store the time at which this goal was requested.
00053 # It is used by an action server when it tries to preempt all
00054 # goals that were requested before a certain time
00055 time stamp
00056
00057 # The id provides a way to associate feedback and
00058 # result message with specific goal requests. The id
00059 # specified must be unique.
00060 string id
00061
00062
00063 ================================================================================
00064 MSG: nao_msgs/JointTrajectoryGoal
00065 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00066 # goal: a joint angle trajectory
00067 trajectory_msgs/JointTrajectory trajectory
00068 # flag whether motion is absolute (=0, default) or relative (=1)
00069 uint8 relative
00070
00071 ================================================================================
00072 MSG: trajectory_msgs/JointTrajectory
00073 Header header
00074 string[] joint_names
00075 JointTrajectoryPoint[] points
00076 ================================================================================
00077 MSG: trajectory_msgs/JointTrajectoryPoint
00078 float64[] positions
00079 float64[] velocities
00080 float64[] accelerations
00081 duration time_from_start
00082 ================================================================================
00083 MSG: nao_msgs/JointTrajectoryActionResult
00084 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00085
00086 Header header
00087 actionlib_msgs/GoalStatus status
00088 JointTrajectoryResult 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/JointTrajectoryResult
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/JointTrajectoryActionFeedback
00153 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00154
00155 Header header
00156 actionlib_msgs/GoalStatus status
00157 JointTrajectoryFeedback feedback
00158
00159 ================================================================================
00160 MSG: nao_msgs/JointTrajectoryFeedback
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/JointTrajectoryActionGoal','nao_msgs/JointTrajectoryActionResult','nao_msgs/JointTrajectoryActionFeedback']
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(JointTrajectoryAction, self).__init__(*args, **kwds)
00184
00185 if self.action_goal is None:
00186 self.action_goal = nao_msgs.msg.JointTrajectoryActionGoal()
00187 if self.action_result is None:
00188 self.action_result = nao_msgs.msg.JointTrajectoryActionResult()
00189 if self.action_feedback is None:
00190 self.action_feedback = nao_msgs.msg.JointTrajectoryActionFeedback()
00191 else:
00192 self.action_goal = nao_msgs.msg.JointTrajectoryActionGoal()
00193 self.action_result = nao_msgs.msg.JointTrajectoryActionResult()
00194 self.action_feedback = nao_msgs.msg.JointTrajectoryActionFeedback()
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, ``StringIO``
00206 """
00207 try:
00208 _x = self
00209 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00210 _x = self.action_goal.header.frame_id
00211 length = len(_x)
00212 if python3 or type(_x) == unicode:
00213 _x = _x.encode('utf-8')
00214 length = len(_x)
00215 buff.write(struct.pack('<I%ss'%length, length, _x))
00216 _x = self
00217 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00218 _x = self.action_goal.goal_id.id
00219 length = len(_x)
00220 if python3 or type(_x) == unicode:
00221 _x = _x.encode('utf-8')
00222 length = len(_x)
00223 buff.write(struct.pack('<I%ss'%length, length, _x))
00224 _x = self
00225 buff.write(_struct_3I.pack(_x.action_goal.goal.trajectory.header.seq, _x.action_goal.goal.trajectory.header.stamp.secs, _x.action_goal.goal.trajectory.header.stamp.nsecs))
00226 _x = self.action_goal.goal.trajectory.header.frame_id
00227 length = len(_x)
00228 if python3 or type(_x) == unicode:
00229 _x = _x.encode('utf-8')
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 length = len(self.action_goal.goal.trajectory.joint_names)
00233 buff.write(_struct_I.pack(length))
00234 for val1 in self.action_goal.goal.trajectory.joint_names:
00235 length = len(val1)
00236 if python3 or type(val1) == unicode:
00237 val1 = val1.encode('utf-8')
00238 length = len(val1)
00239 buff.write(struct.pack('<I%ss'%length, length, val1))
00240 length = len(self.action_goal.goal.trajectory.points)
00241 buff.write(_struct_I.pack(length))
00242 for val1 in self.action_goal.goal.trajectory.points:
00243 length = len(val1.positions)
00244 buff.write(_struct_I.pack(length))
00245 pattern = '<%sd'%length
00246 buff.write(struct.pack(pattern, *val1.positions))
00247 length = len(val1.velocities)
00248 buff.write(_struct_I.pack(length))
00249 pattern = '<%sd'%length
00250 buff.write(struct.pack(pattern, *val1.velocities))
00251 length = len(val1.accelerations)
00252 buff.write(_struct_I.pack(length))
00253 pattern = '<%sd'%length
00254 buff.write(struct.pack(pattern, *val1.accelerations))
00255 _v1 = val1.time_from_start
00256 _x = _v1
00257 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00258 _x = self
00259 buff.write(_struct_B3I.pack(_x.action_goal.goal.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00260 _x = self.action_result.header.frame_id
00261 length = len(_x)
00262 if python3 or type(_x) == unicode:
00263 _x = _x.encode('utf-8')
00264 length = len(_x)
00265 buff.write(struct.pack('<I%ss'%length, length, _x))
00266 _x = self
00267 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00268 _x = self.action_result.status.goal_id.id
00269 length = len(_x)
00270 if python3 or type(_x) == unicode:
00271 _x = _x.encode('utf-8')
00272 length = len(_x)
00273 buff.write(struct.pack('<I%ss'%length, length, _x))
00274 buff.write(_struct_B.pack(self.action_result.status.status))
00275 _x = self.action_result.status.text
00276 length = len(_x)
00277 if python3 or type(_x) == unicode:
00278 _x = _x.encode('utf-8')
00279 length = len(_x)
00280 buff.write(struct.pack('<I%ss'%length, length, _x))
00281 _x = self
00282 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))
00283 _x = self.action_result.result.goal_position.header.frame_id
00284 length = len(_x)
00285 if python3 or type(_x) == unicode:
00286 _x = _x.encode('utf-8')
00287 length = len(_x)
00288 buff.write(struct.pack('<I%ss'%length, length, _x))
00289 length = len(self.action_result.result.goal_position.name)
00290 buff.write(_struct_I.pack(length))
00291 for val1 in self.action_result.result.goal_position.name:
00292 length = len(val1)
00293 if python3 or type(val1) == unicode:
00294 val1 = val1.encode('utf-8')
00295 length = len(val1)
00296 buff.write(struct.pack('<I%ss'%length, length, val1))
00297 length = len(self.action_result.result.goal_position.position)
00298 buff.write(_struct_I.pack(length))
00299 pattern = '<%sd'%length
00300 buff.write(struct.pack(pattern, *self.action_result.result.goal_position.position))
00301 length = len(self.action_result.result.goal_position.velocity)
00302 buff.write(_struct_I.pack(length))
00303 pattern = '<%sd'%length
00304 buff.write(struct.pack(pattern, *self.action_result.result.goal_position.velocity))
00305 length = len(self.action_result.result.goal_position.effort)
00306 buff.write(_struct_I.pack(length))
00307 pattern = '<%sd'%length
00308 buff.write(struct.pack(pattern, *self.action_result.result.goal_position.effort))
00309 _x = self
00310 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00311 _x = self.action_feedback.header.frame_id
00312 length = len(_x)
00313 if python3 or type(_x) == unicode:
00314 _x = _x.encode('utf-8')
00315 length = len(_x)
00316 buff.write(struct.pack('<I%ss'%length, length, _x))
00317 _x = self
00318 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00319 _x = self.action_feedback.status.goal_id.id
00320 length = len(_x)
00321 if python3 or type(_x) == unicode:
00322 _x = _x.encode('utf-8')
00323 length = len(_x)
00324 buff.write(struct.pack('<I%ss'%length, length, _x))
00325 buff.write(_struct_B.pack(self.action_feedback.status.status))
00326 _x = self.action_feedback.status.text
00327 length = len(_x)
00328 if python3 or type(_x) == unicode:
00329 _x = _x.encode('utf-8')
00330 length = len(_x)
00331 buff.write(struct.pack('<I%ss'%length, length, _x))
00332 except struct.error as se: self._check_types(se)
00333 except TypeError as te: self._check_types(te)
00334
00335 def deserialize(self, str):
00336 """
00337 unpack serialized message in str into this message instance
00338 :param str: byte array of serialized message, ``str``
00339 """
00340 try:
00341 if self.action_goal is None:
00342 self.action_goal = nao_msgs.msg.JointTrajectoryActionGoal()
00343 if self.action_result is None:
00344 self.action_result = nao_msgs.msg.JointTrajectoryActionResult()
00345 if self.action_feedback is None:
00346 self.action_feedback = nao_msgs.msg.JointTrajectoryActionFeedback()
00347 end = 0
00348 _x = self
00349 start = end
00350 end += 12
00351 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00352 start = end
00353 end += 4
00354 (length,) = _struct_I.unpack(str[start:end])
00355 start = end
00356 end += length
00357 if python3:
00358 self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00359 else:
00360 self.action_goal.header.frame_id = str[start:end]
00361 _x = self
00362 start = end
00363 end += 8
00364 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00365 start = end
00366 end += 4
00367 (length,) = _struct_I.unpack(str[start:end])
00368 start = end
00369 end += length
00370 if python3:
00371 self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00372 else:
00373 self.action_goal.goal_id.id = str[start:end]
00374 _x = self
00375 start = end
00376 end += 12
00377 (_x.action_goal.goal.trajectory.header.seq, _x.action_goal.goal.trajectory.header.stamp.secs, _x.action_goal.goal.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00378 start = end
00379 end += 4
00380 (length,) = _struct_I.unpack(str[start:end])
00381 start = end
00382 end += length
00383 if python3:
00384 self.action_goal.goal.trajectory.header.frame_id = str[start:end].decode('utf-8')
00385 else:
00386 self.action_goal.goal.trajectory.header.frame_id = str[start:end]
00387 start = end
00388 end += 4
00389 (length,) = _struct_I.unpack(str[start:end])
00390 self.action_goal.goal.trajectory.joint_names = []
00391 for i in range(0, length):
00392 start = end
00393 end += 4
00394 (length,) = _struct_I.unpack(str[start:end])
00395 start = end
00396 end += length
00397 if python3:
00398 val1 = str[start:end].decode('utf-8')
00399 else:
00400 val1 = str[start:end]
00401 self.action_goal.goal.trajectory.joint_names.append(val1)
00402 start = end
00403 end += 4
00404 (length,) = _struct_I.unpack(str[start:end])
00405 self.action_goal.goal.trajectory.points = []
00406 for i in range(0, length):
00407 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00408 start = end
00409 end += 4
00410 (length,) = _struct_I.unpack(str[start:end])
00411 pattern = '<%sd'%length
00412 start = end
00413 end += struct.calcsize(pattern)
00414 val1.positions = struct.unpack(pattern, str[start:end])
00415 start = end
00416 end += 4
00417 (length,) = _struct_I.unpack(str[start:end])
00418 pattern = '<%sd'%length
00419 start = end
00420 end += struct.calcsize(pattern)
00421 val1.velocities = struct.unpack(pattern, str[start:end])
00422 start = end
00423 end += 4
00424 (length,) = _struct_I.unpack(str[start:end])
00425 pattern = '<%sd'%length
00426 start = end
00427 end += struct.calcsize(pattern)
00428 val1.accelerations = struct.unpack(pattern, str[start:end])
00429 _v2 = val1.time_from_start
00430 _x = _v2
00431 start = end
00432 end += 8
00433 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00434 self.action_goal.goal.trajectory.points.append(val1)
00435 _x = self
00436 start = end
00437 end += 13
00438 (_x.action_goal.goal.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00439 start = end
00440 end += 4
00441 (length,) = _struct_I.unpack(str[start:end])
00442 start = end
00443 end += length
00444 if python3:
00445 self.action_result.header.frame_id = str[start:end].decode('utf-8')
00446 else:
00447 self.action_result.header.frame_id = str[start:end]
00448 _x = self
00449 start = end
00450 end += 8
00451 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00452 start = end
00453 end += 4
00454 (length,) = _struct_I.unpack(str[start:end])
00455 start = end
00456 end += length
00457 if python3:
00458 self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00459 else:
00460 self.action_result.status.goal_id.id = str[start:end]
00461 start = end
00462 end += 1
00463 (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00464 start = end
00465 end += 4
00466 (length,) = _struct_I.unpack(str[start:end])
00467 start = end
00468 end += length
00469 if python3:
00470 self.action_result.status.text = str[start:end].decode('utf-8')
00471 else:
00472 self.action_result.status.text = str[start:end]
00473 _x = self
00474 start = end
00475 end += 12
00476 (_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])
00477 start = end
00478 end += 4
00479 (length,) = _struct_I.unpack(str[start:end])
00480 start = end
00481 end += length
00482 if python3:
00483 self.action_result.result.goal_position.header.frame_id = str[start:end].decode('utf-8')
00484 else:
00485 self.action_result.result.goal_position.header.frame_id = str[start:end]
00486 start = end
00487 end += 4
00488 (length,) = _struct_I.unpack(str[start:end])
00489 self.action_result.result.goal_position.name = []
00490 for i in range(0, length):
00491 start = end
00492 end += 4
00493 (length,) = _struct_I.unpack(str[start:end])
00494 start = end
00495 end += length
00496 if python3:
00497 val1 = str[start:end].decode('utf-8')
00498 else:
00499 val1 = str[start:end]
00500 self.action_result.result.goal_position.name.append(val1)
00501 start = end
00502 end += 4
00503 (length,) = _struct_I.unpack(str[start:end])
00504 pattern = '<%sd'%length
00505 start = end
00506 end += struct.calcsize(pattern)
00507 self.action_result.result.goal_position.position = struct.unpack(pattern, str[start:end])
00508 start = end
00509 end += 4
00510 (length,) = _struct_I.unpack(str[start:end])
00511 pattern = '<%sd'%length
00512 start = end
00513 end += struct.calcsize(pattern)
00514 self.action_result.result.goal_position.velocity = struct.unpack(pattern, str[start:end])
00515 start = end
00516 end += 4
00517 (length,) = _struct_I.unpack(str[start:end])
00518 pattern = '<%sd'%length
00519 start = end
00520 end += struct.calcsize(pattern)
00521 self.action_result.result.goal_position.effort = struct.unpack(pattern, str[start:end])
00522 _x = self
00523 start = end
00524 end += 12
00525 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00526 start = end
00527 end += 4
00528 (length,) = _struct_I.unpack(str[start:end])
00529 start = end
00530 end += length
00531 if python3:
00532 self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00533 else:
00534 self.action_feedback.header.frame_id = str[start:end]
00535 _x = self
00536 start = end
00537 end += 8
00538 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00539 start = end
00540 end += 4
00541 (length,) = _struct_I.unpack(str[start:end])
00542 start = end
00543 end += length
00544 if python3:
00545 self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00546 else:
00547 self.action_feedback.status.goal_id.id = str[start:end]
00548 start = end
00549 end += 1
00550 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00551 start = end
00552 end += 4
00553 (length,) = _struct_I.unpack(str[start:end])
00554 start = end
00555 end += length
00556 if python3:
00557 self.action_feedback.status.text = str[start:end].decode('utf-8')
00558 else:
00559 self.action_feedback.status.text = str[start:end]
00560 return self
00561 except struct.error as e:
00562 raise genpy.DeserializationError(e)
00563
00564
00565 def serialize_numpy(self, buff, numpy):
00566 """
00567 serialize message with numpy array types into buffer
00568 :param buff: buffer, ``StringIO``
00569 :param numpy: numpy python module
00570 """
00571 try:
00572 _x = self
00573 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00574 _x = self.action_goal.header.frame_id
00575 length = len(_x)
00576 if python3 or type(_x) == unicode:
00577 _x = _x.encode('utf-8')
00578 length = len(_x)
00579 buff.write(struct.pack('<I%ss'%length, length, _x))
00580 _x = self
00581 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00582 _x = self.action_goal.goal_id.id
00583 length = len(_x)
00584 if python3 or type(_x) == unicode:
00585 _x = _x.encode('utf-8')
00586 length = len(_x)
00587 buff.write(struct.pack('<I%ss'%length, length, _x))
00588 _x = self
00589 buff.write(_struct_3I.pack(_x.action_goal.goal.trajectory.header.seq, _x.action_goal.goal.trajectory.header.stamp.secs, _x.action_goal.goal.trajectory.header.stamp.nsecs))
00590 _x = self.action_goal.goal.trajectory.header.frame_id
00591 length = len(_x)
00592 if python3 or type(_x) == unicode:
00593 _x = _x.encode('utf-8')
00594 length = len(_x)
00595 buff.write(struct.pack('<I%ss'%length, length, _x))
00596 length = len(self.action_goal.goal.trajectory.joint_names)
00597 buff.write(_struct_I.pack(length))
00598 for val1 in self.action_goal.goal.trajectory.joint_names:
00599 length = len(val1)
00600 if python3 or type(val1) == unicode:
00601 val1 = val1.encode('utf-8')
00602 length = len(val1)
00603 buff.write(struct.pack('<I%ss'%length, length, val1))
00604 length = len(self.action_goal.goal.trajectory.points)
00605 buff.write(_struct_I.pack(length))
00606 for val1 in self.action_goal.goal.trajectory.points:
00607 length = len(val1.positions)
00608 buff.write(_struct_I.pack(length))
00609 pattern = '<%sd'%length
00610 buff.write(val1.positions.tostring())
00611 length = len(val1.velocities)
00612 buff.write(_struct_I.pack(length))
00613 pattern = '<%sd'%length
00614 buff.write(val1.velocities.tostring())
00615 length = len(val1.accelerations)
00616 buff.write(_struct_I.pack(length))
00617 pattern = '<%sd'%length
00618 buff.write(val1.accelerations.tostring())
00619 _v3 = val1.time_from_start
00620 _x = _v3
00621 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00622 _x = self
00623 buff.write(_struct_B3I.pack(_x.action_goal.goal.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00624 _x = self.action_result.header.frame_id
00625 length = len(_x)
00626 if python3 or type(_x) == unicode:
00627 _x = _x.encode('utf-8')
00628 length = len(_x)
00629 buff.write(struct.pack('<I%ss'%length, length, _x))
00630 _x = self
00631 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00632 _x = self.action_result.status.goal_id.id
00633 length = len(_x)
00634 if python3 or type(_x) == unicode:
00635 _x = _x.encode('utf-8')
00636 length = len(_x)
00637 buff.write(struct.pack('<I%ss'%length, length, _x))
00638 buff.write(_struct_B.pack(self.action_result.status.status))
00639 _x = self.action_result.status.text
00640 length = len(_x)
00641 if python3 or type(_x) == unicode:
00642 _x = _x.encode('utf-8')
00643 length = len(_x)
00644 buff.write(struct.pack('<I%ss'%length, length, _x))
00645 _x = self
00646 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))
00647 _x = self.action_result.result.goal_position.header.frame_id
00648 length = len(_x)
00649 if python3 or type(_x) == unicode:
00650 _x = _x.encode('utf-8')
00651 length = len(_x)
00652 buff.write(struct.pack('<I%ss'%length, length, _x))
00653 length = len(self.action_result.result.goal_position.name)
00654 buff.write(_struct_I.pack(length))
00655 for val1 in self.action_result.result.goal_position.name:
00656 length = len(val1)
00657 if python3 or type(val1) == unicode:
00658 val1 = val1.encode('utf-8')
00659 length = len(val1)
00660 buff.write(struct.pack('<I%ss'%length, length, val1))
00661 length = len(self.action_result.result.goal_position.position)
00662 buff.write(_struct_I.pack(length))
00663 pattern = '<%sd'%length
00664 buff.write(self.action_result.result.goal_position.position.tostring())
00665 length = len(self.action_result.result.goal_position.velocity)
00666 buff.write(_struct_I.pack(length))
00667 pattern = '<%sd'%length
00668 buff.write(self.action_result.result.goal_position.velocity.tostring())
00669 length = len(self.action_result.result.goal_position.effort)
00670 buff.write(_struct_I.pack(length))
00671 pattern = '<%sd'%length
00672 buff.write(self.action_result.result.goal_position.effort.tostring())
00673 _x = self
00674 buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00675 _x = self.action_feedback.header.frame_id
00676 length = len(_x)
00677 if python3 or type(_x) == unicode:
00678 _x = _x.encode('utf-8')
00679 length = len(_x)
00680 buff.write(struct.pack('<I%ss'%length, length, _x))
00681 _x = self
00682 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00683 _x = self.action_feedback.status.goal_id.id
00684 length = len(_x)
00685 if python3 or type(_x) == unicode:
00686 _x = _x.encode('utf-8')
00687 length = len(_x)
00688 buff.write(struct.pack('<I%ss'%length, length, _x))
00689 buff.write(_struct_B.pack(self.action_feedback.status.status))
00690 _x = self.action_feedback.status.text
00691 length = len(_x)
00692 if python3 or type(_x) == unicode:
00693 _x = _x.encode('utf-8')
00694 length = len(_x)
00695 buff.write(struct.pack('<I%ss'%length, length, _x))
00696 except struct.error as se: self._check_types(se)
00697 except TypeError as te: self._check_types(te)
00698
00699 def deserialize_numpy(self, str, numpy):
00700 """
00701 unpack serialized message in str into this message instance using numpy for array types
00702 :param str: byte array of serialized message, ``str``
00703 :param numpy: numpy python module
00704 """
00705 try:
00706 if self.action_goal is None:
00707 self.action_goal = nao_msgs.msg.JointTrajectoryActionGoal()
00708 if self.action_result is None:
00709 self.action_result = nao_msgs.msg.JointTrajectoryActionResult()
00710 if self.action_feedback is None:
00711 self.action_feedback = nao_msgs.msg.JointTrajectoryActionFeedback()
00712 end = 0
00713 _x = self
00714 start = end
00715 end += 12
00716 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00717 start = end
00718 end += 4
00719 (length,) = _struct_I.unpack(str[start:end])
00720 start = end
00721 end += length
00722 if python3:
00723 self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00724 else:
00725 self.action_goal.header.frame_id = str[start:end]
00726 _x = self
00727 start = end
00728 end += 8
00729 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00730 start = end
00731 end += 4
00732 (length,) = _struct_I.unpack(str[start:end])
00733 start = end
00734 end += length
00735 if python3:
00736 self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00737 else:
00738 self.action_goal.goal_id.id = str[start:end]
00739 _x = self
00740 start = end
00741 end += 12
00742 (_x.action_goal.goal.trajectory.header.seq, _x.action_goal.goal.trajectory.header.stamp.secs, _x.action_goal.goal.trajectory.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00743 start = end
00744 end += 4
00745 (length,) = _struct_I.unpack(str[start:end])
00746 start = end
00747 end += length
00748 if python3:
00749 self.action_goal.goal.trajectory.header.frame_id = str[start:end].decode('utf-8')
00750 else:
00751 self.action_goal.goal.trajectory.header.frame_id = str[start:end]
00752 start = end
00753 end += 4
00754 (length,) = _struct_I.unpack(str[start:end])
00755 self.action_goal.goal.trajectory.joint_names = []
00756 for i in range(0, length):
00757 start = end
00758 end += 4
00759 (length,) = _struct_I.unpack(str[start:end])
00760 start = end
00761 end += length
00762 if python3:
00763 val1 = str[start:end].decode('utf-8')
00764 else:
00765 val1 = str[start:end]
00766 self.action_goal.goal.trajectory.joint_names.append(val1)
00767 start = end
00768 end += 4
00769 (length,) = _struct_I.unpack(str[start:end])
00770 self.action_goal.goal.trajectory.points = []
00771 for i in range(0, length):
00772 val1 = trajectory_msgs.msg.JointTrajectoryPoint()
00773 start = end
00774 end += 4
00775 (length,) = _struct_I.unpack(str[start:end])
00776 pattern = '<%sd'%length
00777 start = end
00778 end += struct.calcsize(pattern)
00779 val1.positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00780 start = end
00781 end += 4
00782 (length,) = _struct_I.unpack(str[start:end])
00783 pattern = '<%sd'%length
00784 start = end
00785 end += struct.calcsize(pattern)
00786 val1.velocities = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00787 start = end
00788 end += 4
00789 (length,) = _struct_I.unpack(str[start:end])
00790 pattern = '<%sd'%length
00791 start = end
00792 end += struct.calcsize(pattern)
00793 val1.accelerations = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00794 _v4 = val1.time_from_start
00795 _x = _v4
00796 start = end
00797 end += 8
00798 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00799 self.action_goal.goal.trajectory.points.append(val1)
00800 _x = self
00801 start = end
00802 end += 13
00803 (_x.action_goal.goal.relative, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00804 start = end
00805 end += 4
00806 (length,) = _struct_I.unpack(str[start:end])
00807 start = end
00808 end += length
00809 if python3:
00810 self.action_result.header.frame_id = str[start:end].decode('utf-8')
00811 else:
00812 self.action_result.header.frame_id = str[start:end]
00813 _x = self
00814 start = end
00815 end += 8
00816 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00817 start = end
00818 end += 4
00819 (length,) = _struct_I.unpack(str[start:end])
00820 start = end
00821 end += length
00822 if python3:
00823 self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00824 else:
00825 self.action_result.status.goal_id.id = str[start:end]
00826 start = end
00827 end += 1
00828 (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00829 start = end
00830 end += 4
00831 (length,) = _struct_I.unpack(str[start:end])
00832 start = end
00833 end += length
00834 if python3:
00835 self.action_result.status.text = str[start:end].decode('utf-8')
00836 else:
00837 self.action_result.status.text = str[start:end]
00838 _x = self
00839 start = end
00840 end += 12
00841 (_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])
00842 start = end
00843 end += 4
00844 (length,) = _struct_I.unpack(str[start:end])
00845 start = end
00846 end += length
00847 if python3:
00848 self.action_result.result.goal_position.header.frame_id = str[start:end].decode('utf-8')
00849 else:
00850 self.action_result.result.goal_position.header.frame_id = str[start:end]
00851 start = end
00852 end += 4
00853 (length,) = _struct_I.unpack(str[start:end])
00854 self.action_result.result.goal_position.name = []
00855 for i in range(0, length):
00856 start = end
00857 end += 4
00858 (length,) = _struct_I.unpack(str[start:end])
00859 start = end
00860 end += length
00861 if python3:
00862 val1 = str[start:end].decode('utf-8')
00863 else:
00864 val1 = str[start:end]
00865 self.action_result.result.goal_position.name.append(val1)
00866 start = end
00867 end += 4
00868 (length,) = _struct_I.unpack(str[start:end])
00869 pattern = '<%sd'%length
00870 start = end
00871 end += struct.calcsize(pattern)
00872 self.action_result.result.goal_position.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00873 start = end
00874 end += 4
00875 (length,) = _struct_I.unpack(str[start:end])
00876 pattern = '<%sd'%length
00877 start = end
00878 end += struct.calcsize(pattern)
00879 self.action_result.result.goal_position.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00880 start = end
00881 end += 4
00882 (length,) = _struct_I.unpack(str[start:end])
00883 pattern = '<%sd'%length
00884 start = end
00885 end += struct.calcsize(pattern)
00886 self.action_result.result.goal_position.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00887 _x = self
00888 start = end
00889 end += 12
00890 (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00891 start = end
00892 end += 4
00893 (length,) = _struct_I.unpack(str[start:end])
00894 start = end
00895 end += length
00896 if python3:
00897 self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00898 else:
00899 self.action_feedback.header.frame_id = str[start:end]
00900 _x = self
00901 start = end
00902 end += 8
00903 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00904 start = end
00905 end += 4
00906 (length,) = _struct_I.unpack(str[start:end])
00907 start = end
00908 end += length
00909 if python3:
00910 self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00911 else:
00912 self.action_feedback.status.goal_id.id = str[start:end]
00913 start = end
00914 end += 1
00915 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00916 start = end
00917 end += 4
00918 (length,) = _struct_I.unpack(str[start:end])
00919 start = end
00920 end += length
00921 if python3:
00922 self.action_feedback.status.text = str[start:end].decode('utf-8')
00923 else:
00924 self.action_feedback.status.text = str[start:end]
00925 return self
00926 except struct.error as e:
00927 raise genpy.DeserializationError(e)
00928
00929 _struct_I = genpy.struct_I
00930 _struct_3I = struct.Struct("<3I")
00931 _struct_B3I = struct.Struct("<B3I")
00932 _struct_2I = struct.Struct("<2I")
00933 _struct_B = struct.Struct("<B")
00934 _struct_2i = struct.Struct("<2i")