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


pr2_controllers_msgs
Author(s): Stuart Glaser
autogenerated on Fri Jan 3 2014 11:41:02