_JointMovementAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from katana_msgs/JointMovementAction.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 sensor_msgs.msg
00008 import std_msgs.msg
00009 import genpy
00010 import actionlib_msgs.msg
00011 import katana_msgs.msg
00012 
00013 class JointMovementAction(genpy.Message):
00014   _md5sum = "729d616fa544da9079d58e0ecde6ca21"
00015   _type = "katana_msgs/JointMovementAction"
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 JointMovementActionGoal action_goal
00020 JointMovementActionResult action_result
00021 JointMovementActionFeedback action_feedback
00022 
00023 ================================================================================
00024 MSG: katana_msgs/JointMovementActionGoal
00025 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00026 
00027 Header header
00028 actionlib_msgs/GoalID goal_id
00029 JointMovementGoal 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: katana_msgs/JointMovementGoal
00064 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00065 #goal definition
00066 sensor_msgs/JointState jointGoal
00067 
00068 ================================================================================
00069 MSG: sensor_msgs/JointState
00070 # This is a message that holds data to describe the state of a set of torque controlled joints. 
00071 #
00072 # The state of each joint (revolute or prismatic) is defined by:
00073 #  * the position of the joint (rad or m),
00074 #  * the velocity of the joint (rad/s or m/s) and 
00075 #  * the effort that is applied in the joint (Nm or N).
00076 #
00077 # Each joint is uniquely identified by its name
00078 # The header specifies the time at which the joint states were recorded. All the joint states
00079 # in one message have to be recorded at the same time.
00080 #
00081 # This message consists of a multiple arrays, one for each part of the joint state. 
00082 # The goal is to make each of the fields optional. When e.g. your joints have no
00083 # effort associated with them, you can leave the effort array empty. 
00084 #
00085 # All arrays in this message should have the same size, or be empty.
00086 # This is the only way to uniquely associate the joint name with the correct
00087 # states.
00088 
00089 
00090 Header header
00091 
00092 string[] name
00093 float64[] position
00094 float64[] velocity
00095 float64[] effort
00096 
00097 ================================================================================
00098 MSG: katana_msgs/JointMovementActionResult
00099 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00100 
00101 Header header
00102 actionlib_msgs/GoalStatus status
00103 JointMovementResult result
00104 
00105 ================================================================================
00106 MSG: actionlib_msgs/GoalStatus
00107 GoalID goal_id
00108 uint8 status
00109 uint8 PENDING         = 0   # The goal has yet to be processed by the action server
00110 uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
00111 uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
00112                             #   and has since completed its execution (Terminal State)
00113 uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
00114 uint8 ABORTED         = 4   # The goal was aborted during execution by the action server due
00115                             #    to some failure (Terminal State)
00116 uint8 REJECTED        = 5   # The goal was rejected by the action server without being processed,
00117                             #    because the goal was unattainable or invalid (Terminal State)
00118 uint8 PREEMPTING      = 6   # The goal received a cancel request after it started executing
00119                             #    and has not yet completed execution
00120 uint8 RECALLING       = 7   # The goal received a cancel request before it started executing,
00121                             #    but the action server has not yet confirmed that the goal is canceled
00122 uint8 RECALLED        = 8   # The goal received a cancel request before it started executing
00123                             #    and was successfully cancelled (Terminal State)
00124 uint8 LOST            = 9   # An action client can determine that a goal is LOST. This should not be
00125                             #    sent over the wire by an action server
00126 
00127 #Allow for the user to associate a string with GoalStatus for debugging
00128 string text
00129 
00130 
00131 ================================================================================
00132 MSG: katana_msgs/JointMovementResult
00133 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00134 
00135 ================================================================================
00136 MSG: katana_msgs/JointMovementActionFeedback
00137 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00138 
00139 Header header
00140 actionlib_msgs/GoalStatus status
00141 JointMovementFeedback feedback
00142 
00143 ================================================================================
00144 MSG: katana_msgs/JointMovementFeedback
00145 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00146 
00147 
00148 """
00149   __slots__ = ['action_goal','action_result','action_feedback']
00150   _slot_types = ['katana_msgs/JointMovementActionGoal','katana_msgs/JointMovementActionResult','katana_msgs/JointMovementActionFeedback']
00151 
00152   def __init__(self, *args, **kwds):
00153     """
00154     Constructor. Any message fields that are implicitly/explicitly
00155     set to None will be assigned a default value. The recommend
00156     use is keyword arguments as this is more robust to future message
00157     changes.  You cannot mix in-order arguments and keyword arguments.
00158 
00159     The available fields are:
00160        action_goal,action_result,action_feedback
00161 
00162     :param args: complete set of field values, in .msg order
00163     :param kwds: use keyword arguments corresponding to message field names
00164     to set specific fields.
00165     """
00166     if args or kwds:
00167       super(JointMovementAction, self).__init__(*args, **kwds)
00168       #message fields cannot be None, assign default values for those that are
00169       if self.action_goal is None:
00170         self.action_goal = katana_msgs.msg.JointMovementActionGoal()
00171       if self.action_result is None:
00172         self.action_result = katana_msgs.msg.JointMovementActionResult()
00173       if self.action_feedback is None:
00174         self.action_feedback = katana_msgs.msg.JointMovementActionFeedback()
00175     else:
00176       self.action_goal = katana_msgs.msg.JointMovementActionGoal()
00177       self.action_result = katana_msgs.msg.JointMovementActionResult()
00178       self.action_feedback = katana_msgs.msg.JointMovementActionFeedback()
00179 
00180   def _get_types(self):
00181     """
00182     internal API method
00183     """
00184     return self._slot_types
00185 
00186   def serialize(self, buff):
00187     """
00188     serialize message into buffer
00189     :param buff: buffer, ``StringIO``
00190     """
00191     try:
00192       _x = self
00193       buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00194       _x = self.action_goal.header.frame_id
00195       length = len(_x)
00196       if python3 or type(_x) == unicode:
00197         _x = _x.encode('utf-8')
00198         length = len(_x)
00199       buff.write(struct.pack('<I%ss'%length, length, _x))
00200       _x = self
00201       buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00202       _x = self.action_goal.goal_id.id
00203       length = len(_x)
00204       if python3 or type(_x) == unicode:
00205         _x = _x.encode('utf-8')
00206         length = len(_x)
00207       buff.write(struct.pack('<I%ss'%length, length, _x))
00208       _x = self
00209       buff.write(_struct_3I.pack(_x.action_goal.goal.jointGoal.header.seq, _x.action_goal.goal.jointGoal.header.stamp.secs, _x.action_goal.goal.jointGoal.header.stamp.nsecs))
00210       _x = self.action_goal.goal.jointGoal.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       length = len(self.action_goal.goal.jointGoal.name)
00217       buff.write(_struct_I.pack(length))
00218       for val1 in self.action_goal.goal.jointGoal.name:
00219         length = len(val1)
00220         if python3 or type(val1) == unicode:
00221           val1 = val1.encode('utf-8')
00222           length = len(val1)
00223         buff.write(struct.pack('<I%ss'%length, length, val1))
00224       length = len(self.action_goal.goal.jointGoal.position)
00225       buff.write(_struct_I.pack(length))
00226       pattern = '<%sd'%length
00227       buff.write(struct.pack(pattern, *self.action_goal.goal.jointGoal.position))
00228       length = len(self.action_goal.goal.jointGoal.velocity)
00229       buff.write(_struct_I.pack(length))
00230       pattern = '<%sd'%length
00231       buff.write(struct.pack(pattern, *self.action_goal.goal.jointGoal.velocity))
00232       length = len(self.action_goal.goal.jointGoal.effort)
00233       buff.write(_struct_I.pack(length))
00234       pattern = '<%sd'%length
00235       buff.write(struct.pack(pattern, *self.action_goal.goal.jointGoal.effort))
00236       _x = self
00237       buff.write(_struct_3I.pack(_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00238       _x = self.action_result.header.frame_id
00239       length = len(_x)
00240       if python3 or type(_x) == unicode:
00241         _x = _x.encode('utf-8')
00242         length = len(_x)
00243       buff.write(struct.pack('<I%ss'%length, length, _x))
00244       _x = self
00245       buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00246       _x = self.action_result.status.goal_id.id
00247       length = len(_x)
00248       if python3 or type(_x) == unicode:
00249         _x = _x.encode('utf-8')
00250         length = len(_x)
00251       buff.write(struct.pack('<I%ss'%length, length, _x))
00252       buff.write(_struct_B.pack(self.action_result.status.status))
00253       _x = self.action_result.status.text
00254       length = len(_x)
00255       if python3 or type(_x) == unicode:
00256         _x = _x.encode('utf-8')
00257         length = len(_x)
00258       buff.write(struct.pack('<I%ss'%length, length, _x))
00259       _x = self
00260       buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00261       _x = self.action_feedback.header.frame_id
00262       length = len(_x)
00263       if python3 or type(_x) == unicode:
00264         _x = _x.encode('utf-8')
00265         length = len(_x)
00266       buff.write(struct.pack('<I%ss'%length, length, _x))
00267       _x = self
00268       buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00269       _x = self.action_feedback.status.goal_id.id
00270       length = len(_x)
00271       if python3 or type(_x) == unicode:
00272         _x = _x.encode('utf-8')
00273         length = len(_x)
00274       buff.write(struct.pack('<I%ss'%length, length, _x))
00275       buff.write(_struct_B.pack(self.action_feedback.status.status))
00276       _x = self.action_feedback.status.text
00277       length = len(_x)
00278       if python3 or type(_x) == unicode:
00279         _x = _x.encode('utf-8')
00280         length = len(_x)
00281       buff.write(struct.pack('<I%ss'%length, length, _x))
00282     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00283     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00284 
00285   def deserialize(self, str):
00286     """
00287     unpack serialized message in str into this message instance
00288     :param str: byte array of serialized message, ``str``
00289     """
00290     try:
00291       if self.action_goal is None:
00292         self.action_goal = katana_msgs.msg.JointMovementActionGoal()
00293       if self.action_result is None:
00294         self.action_result = katana_msgs.msg.JointMovementActionResult()
00295       if self.action_feedback is None:
00296         self.action_feedback = katana_msgs.msg.JointMovementActionFeedback()
00297       end = 0
00298       _x = self
00299       start = end
00300       end += 12
00301       (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.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.header.frame_id = str[start:end].decode('utf-8')
00309       else:
00310         self.action_goal.header.frame_id = str[start:end]
00311       _x = self
00312       start = end
00313       end += 8
00314       (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.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_id.id = str[start:end].decode('utf-8')
00322       else:
00323         self.action_goal.goal_id.id = str[start:end]
00324       _x = self
00325       start = end
00326       end += 12
00327       (_x.action_goal.goal.jointGoal.header.seq, _x.action_goal.goal.jointGoal.header.stamp.secs, _x.action_goal.goal.jointGoal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00328       start = end
00329       end += 4
00330       (length,) = _struct_I.unpack(str[start:end])
00331       start = end
00332       end += length
00333       if python3:
00334         self.action_goal.goal.jointGoal.header.frame_id = str[start:end].decode('utf-8')
00335       else:
00336         self.action_goal.goal.jointGoal.header.frame_id = str[start:end]
00337       start = end
00338       end += 4
00339       (length,) = _struct_I.unpack(str[start:end])
00340       self.action_goal.goal.jointGoal.name = []
00341       for i in range(0, length):
00342         start = end
00343         end += 4
00344         (length,) = _struct_I.unpack(str[start:end])
00345         start = end
00346         end += length
00347         if python3:
00348           val1 = str[start:end].decode('utf-8')
00349         else:
00350           val1 = str[start:end]
00351         self.action_goal.goal.jointGoal.name.append(val1)
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       self.action_goal.goal.jointGoal.position = 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       self.action_goal.goal.jointGoal.velocity = struct.unpack(pattern, str[start:end])
00366       start = end
00367       end += 4
00368       (length,) = _struct_I.unpack(str[start:end])
00369       pattern = '<%sd'%length
00370       start = end
00371       end += struct.calcsize(pattern)
00372       self.action_goal.goal.jointGoal.effort = struct.unpack(pattern, str[start:end])
00373       _x = self
00374       start = end
00375       end += 12
00376       (_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00377       start = end
00378       end += 4
00379       (length,) = _struct_I.unpack(str[start:end])
00380       start = end
00381       end += length
00382       if python3:
00383         self.action_result.header.frame_id = str[start:end].decode('utf-8')
00384       else:
00385         self.action_result.header.frame_id = str[start:end]
00386       _x = self
00387       start = end
00388       end += 8
00389       (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00390       start = end
00391       end += 4
00392       (length,) = _struct_I.unpack(str[start:end])
00393       start = end
00394       end += length
00395       if python3:
00396         self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00397       else:
00398         self.action_result.status.goal_id.id = str[start:end]
00399       start = end
00400       end += 1
00401       (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00402       start = end
00403       end += 4
00404       (length,) = _struct_I.unpack(str[start:end])
00405       start = end
00406       end += length
00407       if python3:
00408         self.action_result.status.text = str[start:end].decode('utf-8')
00409       else:
00410         self.action_result.status.text = str[start:end]
00411       _x = self
00412       start = end
00413       end += 12
00414       (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00415       start = end
00416       end += 4
00417       (length,) = _struct_I.unpack(str[start:end])
00418       start = end
00419       end += length
00420       if python3:
00421         self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00422       else:
00423         self.action_feedback.header.frame_id = str[start:end]
00424       _x = self
00425       start = end
00426       end += 8
00427       (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00428       start = end
00429       end += 4
00430       (length,) = _struct_I.unpack(str[start:end])
00431       start = end
00432       end += length
00433       if python3:
00434         self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00435       else:
00436         self.action_feedback.status.goal_id.id = str[start:end]
00437       start = end
00438       end += 1
00439       (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00440       start = end
00441       end += 4
00442       (length,) = _struct_I.unpack(str[start:end])
00443       start = end
00444       end += length
00445       if python3:
00446         self.action_feedback.status.text = str[start:end].decode('utf-8')
00447       else:
00448         self.action_feedback.status.text = str[start:end]
00449       return self
00450     except struct.error as e:
00451       raise genpy.DeserializationError(e) #most likely buffer underfill
00452 
00453 
00454   def serialize_numpy(self, buff, numpy):
00455     """
00456     serialize message with numpy array types into buffer
00457     :param buff: buffer, ``StringIO``
00458     :param numpy: numpy python module
00459     """
00460     try:
00461       _x = self
00462       buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00463       _x = self.action_goal.header.frame_id
00464       length = len(_x)
00465       if python3 or type(_x) == unicode:
00466         _x = _x.encode('utf-8')
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       if python3 or type(_x) == unicode:
00474         _x = _x.encode('utf-8')
00475         length = len(_x)
00476       buff.write(struct.pack('<I%ss'%length, length, _x))
00477       _x = self
00478       buff.write(_struct_3I.pack(_x.action_goal.goal.jointGoal.header.seq, _x.action_goal.goal.jointGoal.header.stamp.secs, _x.action_goal.goal.jointGoal.header.stamp.nsecs))
00479       _x = self.action_goal.goal.jointGoal.header.frame_id
00480       length = len(_x)
00481       if python3 or type(_x) == unicode:
00482         _x = _x.encode('utf-8')
00483         length = len(_x)
00484       buff.write(struct.pack('<I%ss'%length, length, _x))
00485       length = len(self.action_goal.goal.jointGoal.name)
00486       buff.write(_struct_I.pack(length))
00487       for val1 in self.action_goal.goal.jointGoal.name:
00488         length = len(val1)
00489         if python3 or type(val1) == unicode:
00490           val1 = val1.encode('utf-8')
00491           length = len(val1)
00492         buff.write(struct.pack('<I%ss'%length, length, val1))
00493       length = len(self.action_goal.goal.jointGoal.position)
00494       buff.write(_struct_I.pack(length))
00495       pattern = '<%sd'%length
00496       buff.write(self.action_goal.goal.jointGoal.position.tostring())
00497       length = len(self.action_goal.goal.jointGoal.velocity)
00498       buff.write(_struct_I.pack(length))
00499       pattern = '<%sd'%length
00500       buff.write(self.action_goal.goal.jointGoal.velocity.tostring())
00501       length = len(self.action_goal.goal.jointGoal.effort)
00502       buff.write(_struct_I.pack(length))
00503       pattern = '<%sd'%length
00504       buff.write(self.action_goal.goal.jointGoal.effort.tostring())
00505       _x = self
00506       buff.write(_struct_3I.pack(_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00507       _x = self.action_result.header.frame_id
00508       length = len(_x)
00509       if python3 or type(_x) == unicode:
00510         _x = _x.encode('utf-8')
00511         length = len(_x)
00512       buff.write(struct.pack('<I%ss'%length, length, _x))
00513       _x = self
00514       buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00515       _x = self.action_result.status.goal_id.id
00516       length = len(_x)
00517       if python3 or type(_x) == unicode:
00518         _x = _x.encode('utf-8')
00519         length = len(_x)
00520       buff.write(struct.pack('<I%ss'%length, length, _x))
00521       buff.write(_struct_B.pack(self.action_result.status.status))
00522       _x = self.action_result.status.text
00523       length = len(_x)
00524       if python3 or type(_x) == unicode:
00525         _x = _x.encode('utf-8')
00526         length = len(_x)
00527       buff.write(struct.pack('<I%ss'%length, length, _x))
00528       _x = self
00529       buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00530       _x = self.action_feedback.header.frame_id
00531       length = len(_x)
00532       if python3 or type(_x) == unicode:
00533         _x = _x.encode('utf-8')
00534         length = len(_x)
00535       buff.write(struct.pack('<I%ss'%length, length, _x))
00536       _x = self
00537       buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00538       _x = self.action_feedback.status.goal_id.id
00539       length = len(_x)
00540       if python3 or type(_x) == unicode:
00541         _x = _x.encode('utf-8')
00542         length = len(_x)
00543       buff.write(struct.pack('<I%ss'%length, length, _x))
00544       buff.write(_struct_B.pack(self.action_feedback.status.status))
00545       _x = self.action_feedback.status.text
00546       length = len(_x)
00547       if python3 or type(_x) == unicode:
00548         _x = _x.encode('utf-8')
00549         length = len(_x)
00550       buff.write(struct.pack('<I%ss'%length, length, _x))
00551     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00552     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00553 
00554   def deserialize_numpy(self, str, numpy):
00555     """
00556     unpack serialized message in str into this message instance using numpy for array types
00557     :param str: byte array of serialized message, ``str``
00558     :param numpy: numpy python module
00559     """
00560     try:
00561       if self.action_goal is None:
00562         self.action_goal = katana_msgs.msg.JointMovementActionGoal()
00563       if self.action_result is None:
00564         self.action_result = katana_msgs.msg.JointMovementActionResult()
00565       if self.action_feedback is None:
00566         self.action_feedback = katana_msgs.msg.JointMovementActionFeedback()
00567       end = 0
00568       _x = self
00569       start = end
00570       end += 12
00571       (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00572       start = end
00573       end += 4
00574       (length,) = _struct_I.unpack(str[start:end])
00575       start = end
00576       end += length
00577       if python3:
00578         self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00579       else:
00580         self.action_goal.header.frame_id = str[start:end]
00581       _x = self
00582       start = end
00583       end += 8
00584       (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00585       start = end
00586       end += 4
00587       (length,) = _struct_I.unpack(str[start:end])
00588       start = end
00589       end += length
00590       if python3:
00591         self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00592       else:
00593         self.action_goal.goal_id.id = str[start:end]
00594       _x = self
00595       start = end
00596       end += 12
00597       (_x.action_goal.goal.jointGoal.header.seq, _x.action_goal.goal.jointGoal.header.stamp.secs, _x.action_goal.goal.jointGoal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00598       start = end
00599       end += 4
00600       (length,) = _struct_I.unpack(str[start:end])
00601       start = end
00602       end += length
00603       if python3:
00604         self.action_goal.goal.jointGoal.header.frame_id = str[start:end].decode('utf-8')
00605       else:
00606         self.action_goal.goal.jointGoal.header.frame_id = str[start:end]
00607       start = end
00608       end += 4
00609       (length,) = _struct_I.unpack(str[start:end])
00610       self.action_goal.goal.jointGoal.name = []
00611       for i in range(0, length):
00612         start = end
00613         end += 4
00614         (length,) = _struct_I.unpack(str[start:end])
00615         start = end
00616         end += length
00617         if python3:
00618           val1 = str[start:end].decode('utf-8')
00619         else:
00620           val1 = str[start:end]
00621         self.action_goal.goal.jointGoal.name.append(val1)
00622       start = end
00623       end += 4
00624       (length,) = _struct_I.unpack(str[start:end])
00625       pattern = '<%sd'%length
00626       start = end
00627       end += struct.calcsize(pattern)
00628       self.action_goal.goal.jointGoal.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00629       start = end
00630       end += 4
00631       (length,) = _struct_I.unpack(str[start:end])
00632       pattern = '<%sd'%length
00633       start = end
00634       end += struct.calcsize(pattern)
00635       self.action_goal.goal.jointGoal.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00636       start = end
00637       end += 4
00638       (length,) = _struct_I.unpack(str[start:end])
00639       pattern = '<%sd'%length
00640       start = end
00641       end += struct.calcsize(pattern)
00642       self.action_goal.goal.jointGoal.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00643       _x = self
00644       start = end
00645       end += 12
00646       (_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00647       start = end
00648       end += 4
00649       (length,) = _struct_I.unpack(str[start:end])
00650       start = end
00651       end += length
00652       if python3:
00653         self.action_result.header.frame_id = str[start:end].decode('utf-8')
00654       else:
00655         self.action_result.header.frame_id = str[start:end]
00656       _x = self
00657       start = end
00658       end += 8
00659       (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00660       start = end
00661       end += 4
00662       (length,) = _struct_I.unpack(str[start:end])
00663       start = end
00664       end += length
00665       if python3:
00666         self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00667       else:
00668         self.action_result.status.goal_id.id = str[start:end]
00669       start = end
00670       end += 1
00671       (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00672       start = end
00673       end += 4
00674       (length,) = _struct_I.unpack(str[start:end])
00675       start = end
00676       end += length
00677       if python3:
00678         self.action_result.status.text = str[start:end].decode('utf-8')
00679       else:
00680         self.action_result.status.text = str[start:end]
00681       _x = self
00682       start = end
00683       end += 12
00684       (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00685       start = end
00686       end += 4
00687       (length,) = _struct_I.unpack(str[start:end])
00688       start = end
00689       end += length
00690       if python3:
00691         self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00692       else:
00693         self.action_feedback.header.frame_id = str[start:end]
00694       _x = self
00695       start = end
00696       end += 8
00697       (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00698       start = end
00699       end += 4
00700       (length,) = _struct_I.unpack(str[start:end])
00701       start = end
00702       end += length
00703       if python3:
00704         self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00705       else:
00706         self.action_feedback.status.goal_id.id = str[start:end]
00707       start = end
00708       end += 1
00709       (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00710       start = end
00711       end += 4
00712       (length,) = _struct_I.unpack(str[start:end])
00713       start = end
00714       end += length
00715       if python3:
00716         self.action_feedback.status.text = str[start:end].decode('utf-8')
00717       else:
00718         self.action_feedback.status.text = str[start:end]
00719       return self
00720     except struct.error as e:
00721       raise genpy.DeserializationError(e) #most likely buffer underfill
00722 
00723 _struct_I = genpy.struct_I
00724 _struct_3I = struct.Struct("<3I")
00725 _struct_B = struct.Struct("<B")
00726 _struct_2I = struct.Struct("<2I")


katana_msgs
Author(s): Martin Günther
autogenerated on Mon Oct 6 2014 10:45:00