_PR2GripperEventDetectorAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction.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 genpy
00008 import actionlib_msgs.msg
00009 import pr2_gripper_sensor_msgs.msg
00010 import std_msgs.msg
00011 
00012 class PR2GripperEventDetectorAction(genpy.Message):
00013   _md5sum = "d4e2ee2d04e941280f34bdb366daa9a4"
00014   _type = "pr2_gripper_sensor_msgs/PR2GripperEventDetectorAction"
00015   _has_header = False #flag to mark the presence of a Header object
00016   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017 
00018 PR2GripperEventDetectorActionGoal action_goal
00019 PR2GripperEventDetectorActionResult action_result
00020 PR2GripperEventDetectorActionFeedback action_feedback
00021 
00022 ================================================================================
00023 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal
00024 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00025 
00026 Header header
00027 actionlib_msgs/GoalID goal_id
00028 PR2GripperEventDetectorGoal goal
00029 
00030 ================================================================================
00031 MSG: std_msgs/Header
00032 # Standard metadata for higher-level stamped data types.
00033 # This is generally used to communicate timestamped data 
00034 # in a particular coordinate frame.
00035 # 
00036 # sequence ID: consecutively increasing ID 
00037 uint32 seq
00038 #Two-integer timestamp that is expressed as:
00039 # * stamp.secs: seconds (stamp_secs) since epoch
00040 # * stamp.nsecs: nanoseconds since stamp_secs
00041 # time-handling sugar is provided by the client library
00042 time stamp
00043 #Frame this data is associated with
00044 # 0: no frame
00045 # 1: global frame
00046 string frame_id
00047 
00048 ================================================================================
00049 MSG: actionlib_msgs/GoalID
00050 # The stamp should store the time at which this goal was requested.
00051 # It is used by an action server when it tries to preempt all
00052 # goals that were requested before a certain time
00053 time stamp
00054 
00055 # The id provides a way to associate feedback and
00056 # result message with specific goal requests. The id
00057 # specified must be unique.
00058 string id
00059 
00060 
00061 ================================================================================
00062 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal
00063 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00064 # Event Detector action used to tell detect events happening on the 
00065 # palm mounted accelerometer and finger pressure sensors
00066 
00067 #goal
00068 PR2GripperEventDetectorCommand command
00069 
00070 ================================================================================
00071 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand
00072 # state variable that defines what events we would like to trigger on
00073 # Leaving this field blank will result in the robot triggering when 
00074 # anything touches the sides of the finger or an impact is detected
00075 # with the hand/arm.
00076 int8 trigger_conditions
00077 # definitions for our various trigger_conditions values
00078 # trigger on either acceleration contact or finger sensor side impact
00079 int8 FINGER_SIDE_IMPACT_OR_ACC = 0
00080 # tigger once  both slip and acceleration signals occur
00081 int8 SLIP_AND_ACC = 1 
00082 #  trigger on either slip, acceleration, or finger sensor side impact
00083 int8 FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC = 2
00084 # trigger only on slip information
00085 int8 SLIP = 3
00086 # trigger only on acceleration contact information
00087 int8 ACC = 4 
00088 
00089 
00090 # the amount of acceleration to trigger on (acceleration vector magnitude)
00091 # Units = m/s^2
00092 # The user needs to be concerned here about not setting the trigger too
00093 # low so that is set off by the robot's own motions.
00094 #
00095 # For large rapid motions, say by a motion planner, 5 m/s^2 is a good level
00096 # For small delicate controlled motions this can be set MUCH lower (try 2.0)
00097 #
00098 # NOTE: When moving the gripper joint (opening/closing the grippr)
00099 # the high gearing of the PR2 gripper causes large acceleration vibrations
00100 # which will cause triggering to occur. This is a known drawback of the PR2.
00101 #
00102 # NOTE: Leaving this value blank will result in a 0 m/s^2 trigger. If you
00103 # are using a trigger_conditions value that returns on acceleration contact
00104 # events then it will immediately exceed your trigger and return
00105 float64 acceleration_trigger_magnitude
00106 
00107 
00108 # the slip detector gain to trigger on (either finger) : try 0.01
00109 # higher values decrease slip sensitivty (to a point)
00110 # lower values increase sensitivity (to a point)
00111 #
00112 # NOTE: Leaving this value blank will result in the most sensitive slip level.
00113 float64 slip_trigger_magnitude
00114 ================================================================================
00115 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult
00116 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00117 
00118 Header header
00119 actionlib_msgs/GoalStatus status
00120 PR2GripperEventDetectorResult result
00121 
00122 ================================================================================
00123 MSG: actionlib_msgs/GoalStatus
00124 GoalID goal_id
00125 uint8 status
00126 uint8 PENDING         = 0   # The goal has yet to be processed by the action server
00127 uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
00128 uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
00129                             #   and has since completed its execution (Terminal State)
00130 uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
00131 uint8 ABORTED         = 4   # The goal was aborted during execution by the action server due
00132                             #    to some failure (Terminal State)
00133 uint8 REJECTED        = 5   # The goal was rejected by the action server without being processed,
00134                             #    because the goal was unattainable or invalid (Terminal State)
00135 uint8 PREEMPTING      = 6   # The goal received a cancel request after it started executing
00136                             #    and has not yet completed execution
00137 uint8 RECALLING       = 7   # The goal received a cancel request before it started executing,
00138                             #    but the action server has not yet confirmed that the goal is canceled
00139 uint8 RECALLED        = 8   # The goal received a cancel request before it started executing
00140                             #    and was successfully cancelled (Terminal State)
00141 uint8 LOST            = 9   # An action client can determine that a goal is LOST. This should not be
00142                             #    sent over the wire by an action server
00143 
00144 #Allow for the user to associate a string with GoalStatus for debugging
00145 string text
00146 
00147 
00148 ================================================================================
00149 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult
00150 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00151 #results
00152 PR2GripperEventDetectorData data
00153 
00154 ================================================================================
00155 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorData
00156 # Time the data was recorded at
00157 time stamp
00158 
00159 # true if the trigger conditions have been met 
00160 # (see PR2GripperEventDetectorCommand)
00161 bool trigger_conditions_met
00162 
00163 # true if the pressure sensors detected a slip event
00164 # slip events occur when the finger pressure sensors
00165 # high-freq. content exceeds the slip_trigger_magnitude variable
00166 # (see PR2GripperEventDetectorCommand)
00167 bool slip_event
00168 
00169 # true if the hand-mounted accelerometer detected a contact acceleration
00170 # acceleration events occur when the palm accelerometer
00171 # high-freq. content exceeds the acc_trigger_magnitude variable
00172 # (see PR2GripperEventDetectorCommand)
00173 bool acceleration_event
00174 
00175 # the high-freq acceleration vector that was last seen (x,y,z)
00176 float64[3] acceleration_vector
00177 ================================================================================
00178 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback
00179 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00180 
00181 Header header
00182 actionlib_msgs/GoalStatus status
00183 PR2GripperEventDetectorFeedback feedback
00184 
00185 ================================================================================
00186 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback
00187 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00188 # feedback
00189 PR2GripperEventDetectorData data
00190 
00191 
00192 
00193 """
00194   __slots__ = ['action_goal','action_result','action_feedback']
00195   _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal','pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult','pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback']
00196 
00197   def __init__(self, *args, **kwds):
00198     """
00199     Constructor. Any message fields that are implicitly/explicitly
00200     set to None will be assigned a default value. The recommend
00201     use is keyword arguments as this is more robust to future message
00202     changes.  You cannot mix in-order arguments and keyword arguments.
00203 
00204     The available fields are:
00205        action_goal,action_result,action_feedback
00206 
00207     :param args: complete set of field values, in .msg order
00208     :param kwds: use keyword arguments corresponding to message field names
00209     to set specific fields.
00210     """
00211     if args or kwds:
00212       super(PR2GripperEventDetectorAction, self).__init__(*args, **kwds)
00213       #message fields cannot be None, assign default values for those that are
00214       if self.action_goal is None:
00215         self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionGoal()
00216       if self.action_result is None:
00217         self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionResult()
00218       if self.action_feedback is None:
00219         self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionFeedback()
00220     else:
00221       self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionGoal()
00222       self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionResult()
00223       self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionFeedback()
00224 
00225   def _get_types(self):
00226     """
00227     internal API method
00228     """
00229     return self._slot_types
00230 
00231   def serialize(self, buff):
00232     """
00233     serialize message into buffer
00234     :param buff: buffer, ``StringIO``
00235     """
00236     try:
00237       _x = self
00238       buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00239       _x = self.action_goal.header.frame_id
00240       length = len(_x)
00241       if python3 or type(_x) == unicode:
00242         _x = _x.encode('utf-8')
00243         length = len(_x)
00244       buff.write(struct.pack('<I%ss'%length, length, _x))
00245       _x = self
00246       buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00247       _x = self.action_goal.goal_id.id
00248       length = len(_x)
00249       if python3 or type(_x) == unicode:
00250         _x = _x.encode('utf-8')
00251         length = len(_x)
00252       buff.write(struct.pack('<I%ss'%length, length, _x))
00253       _x = self
00254       buff.write(_struct_b2d3I.pack(_x.action_goal.goal.command.trigger_conditions, _x.action_goal.goal.command.acceleration_trigger_magnitude, _x.action_goal.goal.command.slip_trigger_magnitude, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00255       _x = self.action_result.header.frame_id
00256       length = len(_x)
00257       if python3 or type(_x) == unicode:
00258         _x = _x.encode('utf-8')
00259         length = len(_x)
00260       buff.write(struct.pack('<I%ss'%length, length, _x))
00261       _x = self
00262       buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00263       _x = self.action_result.status.goal_id.id
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       buff.write(_struct_B.pack(self.action_result.status.status))
00270       _x = self.action_result.status.text
00271       length = len(_x)
00272       if python3 or type(_x) == unicode:
00273         _x = _x.encode('utf-8')
00274         length = len(_x)
00275       buff.write(struct.pack('<I%ss'%length, length, _x))
00276       _x = self
00277       buff.write(_struct_2I3B.pack(_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.trigger_conditions_met, _x.action_result.result.data.slip_event, _x.action_result.result.data.acceleration_event))
00278       buff.write(_struct_3d.pack(*self.action_result.result.data.acceleration_vector))
00279       _x = self
00280       buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00281       _x = self.action_feedback.header.frame_id
00282       length = len(_x)
00283       if python3 or type(_x) == unicode:
00284         _x = _x.encode('utf-8')
00285         length = len(_x)
00286       buff.write(struct.pack('<I%ss'%length, length, _x))
00287       _x = self
00288       buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00289       _x = self.action_feedback.status.goal_id.id
00290       length = len(_x)
00291       if python3 or type(_x) == unicode:
00292         _x = _x.encode('utf-8')
00293         length = len(_x)
00294       buff.write(struct.pack('<I%ss'%length, length, _x))
00295       buff.write(_struct_B.pack(self.action_feedback.status.status))
00296       _x = self.action_feedback.status.text
00297       length = len(_x)
00298       if python3 or type(_x) == unicode:
00299         _x = _x.encode('utf-8')
00300         length = len(_x)
00301       buff.write(struct.pack('<I%ss'%length, length, _x))
00302       _x = self
00303       buff.write(_struct_2I3B.pack(_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.trigger_conditions_met, _x.action_feedback.feedback.data.slip_event, _x.action_feedback.feedback.data.acceleration_event))
00304       buff.write(_struct_3d.pack(*self.action_feedback.feedback.data.acceleration_vector))
00305     except struct.error as se: self._check_types(se)
00306     except TypeError as te: self._check_types(te)
00307 
00308   def deserialize(self, str):
00309     """
00310     unpack serialized message in str into this message instance
00311     :param str: byte array of serialized message, ``str``
00312     """
00313     try:
00314       if self.action_goal is None:
00315         self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionGoal()
00316       if self.action_result is None:
00317         self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionResult()
00318       if self.action_feedback is None:
00319         self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionFeedback()
00320       end = 0
00321       _x = self
00322       start = end
00323       end += 12
00324       (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00325       start = end
00326       end += 4
00327       (length,) = _struct_I.unpack(str[start:end])
00328       start = end
00329       end += length
00330       if python3:
00331         self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00332       else:
00333         self.action_goal.header.frame_id = str[start:end]
00334       _x = self
00335       start = end
00336       end += 8
00337       (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00338       start = end
00339       end += 4
00340       (length,) = _struct_I.unpack(str[start:end])
00341       start = end
00342       end += length
00343       if python3:
00344         self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00345       else:
00346         self.action_goal.goal_id.id = str[start:end]
00347       _x = self
00348       start = end
00349       end += 29
00350       (_x.action_goal.goal.command.trigger_conditions, _x.action_goal.goal.command.acceleration_trigger_magnitude, _x.action_goal.goal.command.slip_trigger_magnitude, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_b2d3I.unpack(str[start:end])
00351       start = end
00352       end += 4
00353       (length,) = _struct_I.unpack(str[start:end])
00354       start = end
00355       end += length
00356       if python3:
00357         self.action_result.header.frame_id = str[start:end].decode('utf-8')
00358       else:
00359         self.action_result.header.frame_id = str[start:end]
00360       _x = self
00361       start = end
00362       end += 8
00363       (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00364       start = end
00365       end += 4
00366       (length,) = _struct_I.unpack(str[start:end])
00367       start = end
00368       end += length
00369       if python3:
00370         self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00371       else:
00372         self.action_result.status.goal_id.id = str[start:end]
00373       start = end
00374       end += 1
00375       (self.action_result.status.status,) = _struct_B.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.status.text = str[start:end].decode('utf-8')
00383       else:
00384         self.action_result.status.text = str[start:end]
00385       _x = self
00386       start = end
00387       end += 11
00388       (_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.trigger_conditions_met, _x.action_result.result.data.slip_event, _x.action_result.result.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end])
00389       self.action_result.result.data.trigger_conditions_met = bool(self.action_result.result.data.trigger_conditions_met)
00390       self.action_result.result.data.slip_event = bool(self.action_result.result.data.slip_event)
00391       self.action_result.result.data.acceleration_event = bool(self.action_result.result.data.acceleration_event)
00392       start = end
00393       end += 24
00394       self.action_result.result.data.acceleration_vector = _struct_3d.unpack(str[start:end])
00395       _x = self
00396       start = end
00397       end += 12
00398       (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00399       start = end
00400       end += 4
00401       (length,) = _struct_I.unpack(str[start:end])
00402       start = end
00403       end += length
00404       if python3:
00405         self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00406       else:
00407         self.action_feedback.header.frame_id = str[start:end]
00408       _x = self
00409       start = end
00410       end += 8
00411       (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00412       start = end
00413       end += 4
00414       (length,) = _struct_I.unpack(str[start:end])
00415       start = end
00416       end += length
00417       if python3:
00418         self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00419       else:
00420         self.action_feedback.status.goal_id.id = str[start:end]
00421       start = end
00422       end += 1
00423       (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00424       start = end
00425       end += 4
00426       (length,) = _struct_I.unpack(str[start:end])
00427       start = end
00428       end += length
00429       if python3:
00430         self.action_feedback.status.text = str[start:end].decode('utf-8')
00431       else:
00432         self.action_feedback.status.text = str[start:end]
00433       _x = self
00434       start = end
00435       end += 11
00436       (_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.trigger_conditions_met, _x.action_feedback.feedback.data.slip_event, _x.action_feedback.feedback.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end])
00437       self.action_feedback.feedback.data.trigger_conditions_met = bool(self.action_feedback.feedback.data.trigger_conditions_met)
00438       self.action_feedback.feedback.data.slip_event = bool(self.action_feedback.feedback.data.slip_event)
00439       self.action_feedback.feedback.data.acceleration_event = bool(self.action_feedback.feedback.data.acceleration_event)
00440       start = end
00441       end += 24
00442       self.action_feedback.feedback.data.acceleration_vector = _struct_3d.unpack(str[start:end])
00443       return self
00444     except struct.error as e:
00445       raise genpy.DeserializationError(e) #most likely buffer underfill
00446 
00447 
00448   def serialize_numpy(self, buff, numpy):
00449     """
00450     serialize message with numpy array types into buffer
00451     :param buff: buffer, ``StringIO``
00452     :param numpy: numpy python module
00453     """
00454     try:
00455       _x = self
00456       buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00457       _x = self.action_goal.header.frame_id
00458       length = len(_x)
00459       if python3 or type(_x) == unicode:
00460         _x = _x.encode('utf-8')
00461         length = len(_x)
00462       buff.write(struct.pack('<I%ss'%length, length, _x))
00463       _x = self
00464       buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00465       _x = self.action_goal.goal_id.id
00466       length = len(_x)
00467       if python3 or type(_x) == unicode:
00468         _x = _x.encode('utf-8')
00469         length = len(_x)
00470       buff.write(struct.pack('<I%ss'%length, length, _x))
00471       _x = self
00472       buff.write(_struct_b2d3I.pack(_x.action_goal.goal.command.trigger_conditions, _x.action_goal.goal.command.acceleration_trigger_magnitude, _x.action_goal.goal.command.slip_trigger_magnitude, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00473       _x = self.action_result.header.frame_id
00474       length = len(_x)
00475       if python3 or type(_x) == unicode:
00476         _x = _x.encode('utf-8')
00477         length = len(_x)
00478       buff.write(struct.pack('<I%ss'%length, length, _x))
00479       _x = self
00480       buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00481       _x = self.action_result.status.goal_id.id
00482       length = len(_x)
00483       if python3 or type(_x) == unicode:
00484         _x = _x.encode('utf-8')
00485         length = len(_x)
00486       buff.write(struct.pack('<I%ss'%length, length, _x))
00487       buff.write(_struct_B.pack(self.action_result.status.status))
00488       _x = self.action_result.status.text
00489       length = len(_x)
00490       if python3 or type(_x) == unicode:
00491         _x = _x.encode('utf-8')
00492         length = len(_x)
00493       buff.write(struct.pack('<I%ss'%length, length, _x))
00494       _x = self
00495       buff.write(_struct_2I3B.pack(_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.trigger_conditions_met, _x.action_result.result.data.slip_event, _x.action_result.result.data.acceleration_event))
00496       buff.write(self.action_result.result.data.acceleration_vector.tostring())
00497       _x = self
00498       buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00499       _x = self.action_feedback.header.frame_id
00500       length = len(_x)
00501       if python3 or type(_x) == unicode:
00502         _x = _x.encode('utf-8')
00503         length = len(_x)
00504       buff.write(struct.pack('<I%ss'%length, length, _x))
00505       _x = self
00506       buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00507       _x = self.action_feedback.status.goal_id.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       buff.write(_struct_B.pack(self.action_feedback.status.status))
00514       _x = self.action_feedback.status.text
00515       length = len(_x)
00516       if python3 or type(_x) == unicode:
00517         _x = _x.encode('utf-8')
00518         length = len(_x)
00519       buff.write(struct.pack('<I%ss'%length, length, _x))
00520       _x = self
00521       buff.write(_struct_2I3B.pack(_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.trigger_conditions_met, _x.action_feedback.feedback.data.slip_event, _x.action_feedback.feedback.data.acceleration_event))
00522       buff.write(self.action_feedback.feedback.data.acceleration_vector.tostring())
00523     except struct.error as se: self._check_types(se)
00524     except TypeError as te: self._check_types(te)
00525 
00526   def deserialize_numpy(self, str, numpy):
00527     """
00528     unpack serialized message in str into this message instance using numpy for array types
00529     :param str: byte array of serialized message, ``str``
00530     :param numpy: numpy python module
00531     """
00532     try:
00533       if self.action_goal is None:
00534         self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionGoal()
00535       if self.action_result is None:
00536         self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionResult()
00537       if self.action_feedback is None:
00538         self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorActionFeedback()
00539       end = 0
00540       _x = self
00541       start = end
00542       end += 12
00543       (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00544       start = end
00545       end += 4
00546       (length,) = _struct_I.unpack(str[start:end])
00547       start = end
00548       end += length
00549       if python3:
00550         self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00551       else:
00552         self.action_goal.header.frame_id = str[start:end]
00553       _x = self
00554       start = end
00555       end += 8
00556       (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00557       start = end
00558       end += 4
00559       (length,) = _struct_I.unpack(str[start:end])
00560       start = end
00561       end += length
00562       if python3:
00563         self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00564       else:
00565         self.action_goal.goal_id.id = str[start:end]
00566       _x = self
00567       start = end
00568       end += 29
00569       (_x.action_goal.goal.command.trigger_conditions, _x.action_goal.goal.command.acceleration_trigger_magnitude, _x.action_goal.goal.command.slip_trigger_magnitude, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_b2d3I.unpack(str[start:end])
00570       start = end
00571       end += 4
00572       (length,) = _struct_I.unpack(str[start:end])
00573       start = end
00574       end += length
00575       if python3:
00576         self.action_result.header.frame_id = str[start:end].decode('utf-8')
00577       else:
00578         self.action_result.header.frame_id = str[start:end]
00579       _x = self
00580       start = end
00581       end += 8
00582       (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00583       start = end
00584       end += 4
00585       (length,) = _struct_I.unpack(str[start:end])
00586       start = end
00587       end += length
00588       if python3:
00589         self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00590       else:
00591         self.action_result.status.goal_id.id = str[start:end]
00592       start = end
00593       end += 1
00594       (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00595       start = end
00596       end += 4
00597       (length,) = _struct_I.unpack(str[start:end])
00598       start = end
00599       end += length
00600       if python3:
00601         self.action_result.status.text = str[start:end].decode('utf-8')
00602       else:
00603         self.action_result.status.text = str[start:end]
00604       _x = self
00605       start = end
00606       end += 11
00607       (_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.trigger_conditions_met, _x.action_result.result.data.slip_event, _x.action_result.result.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end])
00608       self.action_result.result.data.trigger_conditions_met = bool(self.action_result.result.data.trigger_conditions_met)
00609       self.action_result.result.data.slip_event = bool(self.action_result.result.data.slip_event)
00610       self.action_result.result.data.acceleration_event = bool(self.action_result.result.data.acceleration_event)
00611       start = end
00612       end += 24
00613       self.action_result.result.data.acceleration_vector = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
00614       _x = self
00615       start = end
00616       end += 12
00617       (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00618       start = end
00619       end += 4
00620       (length,) = _struct_I.unpack(str[start:end])
00621       start = end
00622       end += length
00623       if python3:
00624         self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00625       else:
00626         self.action_feedback.header.frame_id = str[start:end]
00627       _x = self
00628       start = end
00629       end += 8
00630       (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00631       start = end
00632       end += 4
00633       (length,) = _struct_I.unpack(str[start:end])
00634       start = end
00635       end += length
00636       if python3:
00637         self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00638       else:
00639         self.action_feedback.status.goal_id.id = str[start:end]
00640       start = end
00641       end += 1
00642       (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00643       start = end
00644       end += 4
00645       (length,) = _struct_I.unpack(str[start:end])
00646       start = end
00647       end += length
00648       if python3:
00649         self.action_feedback.status.text = str[start:end].decode('utf-8')
00650       else:
00651         self.action_feedback.status.text = str[start:end]
00652       _x = self
00653       start = end
00654       end += 11
00655       (_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.trigger_conditions_met, _x.action_feedback.feedback.data.slip_event, _x.action_feedback.feedback.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end])
00656       self.action_feedback.feedback.data.trigger_conditions_met = bool(self.action_feedback.feedback.data.trigger_conditions_met)
00657       self.action_feedback.feedback.data.slip_event = bool(self.action_feedback.feedback.data.slip_event)
00658       self.action_feedback.feedback.data.acceleration_event = bool(self.action_feedback.feedback.data.acceleration_event)
00659       start = end
00660       end += 24
00661       self.action_feedback.feedback.data.acceleration_vector = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
00662       return self
00663     except struct.error as e:
00664       raise genpy.DeserializationError(e) #most likely buffer underfill
00665 
00666 _struct_I = genpy.struct_I
00667 _struct_B = struct.Struct("<B")
00668 _struct_2I3B = struct.Struct("<2I3B")
00669 _struct_b2d3I = struct.Struct("<b2d3I")
00670 _struct_3I = struct.Struct("<3I")
00671 _struct_2I = struct.Struct("<2I")
00672 _struct_3d = struct.Struct("<3d")


pr2_gripper_sensor_msgs
Author(s): Joe Romano
autogenerated on Fri Jan 3 2014 11:52:58