00001 """autogenerated by genmsg_py from PR2GripperEventDetectorActionResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006 import actionlib_msgs.msg
00007 import pr2_gripper_sensor_msgs.msg
00008 import std_msgs.msg
00009
00010 class PR2GripperEventDetectorActionResult(roslib.message.Message):
00011 _md5sum = "a8c6f42e274ecd861ad072720ef9894b"
00012 _type = "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionResult"
00013 _has_header = True
00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015
00016 Header header
00017 actionlib_msgs/GoalStatus status
00018 PR2GripperEventDetectorResult result
00019
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data
00024 # in a particular coordinate frame.
00025 #
00026 # sequence ID: consecutively increasing ID
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037
00038 ================================================================================
00039 MSG: actionlib_msgs/GoalStatus
00040 GoalID goal_id
00041 uint8 status
00042 uint8 PENDING = 0 # The goal has yet to be processed by the action server
00043 uint8 ACTIVE = 1 # The goal is currently being processed by the action server
00044 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing
00045 # and has since completed its execution (Terminal State)
00046 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)
00047 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due
00048 # to some failure (Terminal State)
00049 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,
00050 # because the goal was unattainable or invalid (Terminal State)
00051 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing
00052 # and has not yet completed execution
00053 uint8 RECALLING = 7 # The goal received a cancel request before it started executing,
00054 # but the action server has not yet confirmed that the goal is canceled
00055 uint8 RECALLED = 8 # The goal received a cancel request before it started executing
00056 # and was successfully cancelled (Terminal State)
00057 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be
00058 # sent over the wire by an action server
00059
00060 #Allow for the user to associate a string with GoalStatus for debugging
00061 string text
00062
00063
00064 ================================================================================
00065 MSG: actionlib_msgs/GoalID
00066 # The stamp should store the time at which this goal was requested.
00067 # It is used by an action server when it tries to preempt all
00068 # goals that were requested before a certain time
00069 time stamp
00070
00071 # The id provides a way to associate feedback and
00072 # result message with specific goal requests. The id
00073 # specified must be unique.
00074 string id
00075
00076
00077 ================================================================================
00078 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult
00079 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00080 #results
00081 PR2GripperEventDetectorData data
00082
00083 ================================================================================
00084 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorData
00085 # Time the data was recorded at
00086 time stamp
00087
00088 # true if the trigger conditions have been met
00089 # (see PR2GripperEventDetectorCommand)
00090 bool trigger_conditions_met
00091
00092 # true if the pressure sensors detected a slip event
00093 # slip events occur when the finger pressure sensors
00094 # high-freq. content exceeds the slip_trigger_magnitude variable
00095 # (see PR2GripperEventDetectorCommand)
00096 bool slip_event
00097
00098 # true if the hand-mounted accelerometer detected a contact acceleration
00099 # acceleration events occur when the palm accelerometer
00100 # high-freq. content exceeds the acc_trigger_magnitude variable
00101 # (see PR2GripperEventDetectorCommand)
00102 bool acceleration_event
00103
00104 # the high-freq acceleration vector that was last seen (x,y,z)
00105 float64[3] acceleration_vector
00106 """
00107 __slots__ = ['header','status','result']
00108 _slot_types = ['Header','actionlib_msgs/GoalStatus','pr2_gripper_sensor_msgs/PR2GripperEventDetectorResult']
00109
00110 def __init__(self, *args, **kwds):
00111 """
00112 Constructor. Any message fields that are implicitly/explicitly
00113 set to None will be assigned a default value. The recommend
00114 use is keyword arguments as this is more robust to future message
00115 changes. You cannot mix in-order arguments and keyword arguments.
00116
00117 The available fields are:
00118 header,status,result
00119
00120 @param args: complete set of field values, in .msg order
00121 @param kwds: use keyword arguments corresponding to message field names
00122 to set specific fields.
00123 """
00124 if args or kwds:
00125 super(PR2GripperEventDetectorActionResult, self).__init__(*args, **kwds)
00126
00127 if self.header is None:
00128 self.header = std_msgs.msg._Header.Header()
00129 if self.status is None:
00130 self.status = actionlib_msgs.msg.GoalStatus()
00131 if self.result is None:
00132 self.result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorResult()
00133 else:
00134 self.header = std_msgs.msg._Header.Header()
00135 self.status = actionlib_msgs.msg.GoalStatus()
00136 self.result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorResult()
00137
00138 def _get_types(self):
00139 """
00140 internal API method
00141 """
00142 return self._slot_types
00143
00144 def serialize(self, buff):
00145 """
00146 serialize message into buffer
00147 @param buff: buffer
00148 @type buff: StringIO
00149 """
00150 try:
00151 _x = self
00152 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00153 _x = self.header.frame_id
00154 length = len(_x)
00155 buff.write(struct.pack('<I%ss'%length, length, _x))
00156 _x = self
00157 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00158 _x = self.status.goal_id.id
00159 length = len(_x)
00160 buff.write(struct.pack('<I%ss'%length, length, _x))
00161 buff.write(_struct_B.pack(self.status.status))
00162 _x = self.status.text
00163 length = len(_x)
00164 buff.write(struct.pack('<I%ss'%length, length, _x))
00165 _x = self
00166 buff.write(_struct_2I3B.pack(_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.trigger_conditions_met, _x.result.data.slip_event, _x.result.data.acceleration_event))
00167 buff.write(_struct_3d.pack(*self.result.data.acceleration_vector))
00168 except struct.error, se: self._check_types(se)
00169 except TypeError, te: self._check_types(te)
00170
00171 def deserialize(self, str):
00172 """
00173 unpack serialized message in str into this message instance
00174 @param str: byte array of serialized message
00175 @type str: str
00176 """
00177 try:
00178 if self.header is None:
00179 self.header = std_msgs.msg._Header.Header()
00180 if self.status is None:
00181 self.status = actionlib_msgs.msg.GoalStatus()
00182 if self.result is None:
00183 self.result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorResult()
00184 end = 0
00185 _x = self
00186 start = end
00187 end += 12
00188 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 self.header.frame_id = str[start:end]
00195 _x = self
00196 start = end
00197 end += 8
00198 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 start = end
00203 end += length
00204 self.status.goal_id.id = str[start:end]
00205 start = end
00206 end += 1
00207 (self.status.status,) = _struct_B.unpack(str[start:end])
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 start = end
00212 end += length
00213 self.status.text = str[start:end]
00214 _x = self
00215 start = end
00216 end += 11
00217 (_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.trigger_conditions_met, _x.result.data.slip_event, _x.result.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end])
00218 self.result.data.trigger_conditions_met = bool(self.result.data.trigger_conditions_met)
00219 self.result.data.slip_event = bool(self.result.data.slip_event)
00220 self.result.data.acceleration_event = bool(self.result.data.acceleration_event)
00221 start = end
00222 end += 24
00223 self.result.data.acceleration_vector = _struct_3d.unpack(str[start:end])
00224 return self
00225 except struct.error, e:
00226 raise roslib.message.DeserializationError(e)
00227
00228
00229 def serialize_numpy(self, buff, numpy):
00230 """
00231 serialize message with numpy array types into buffer
00232 @param buff: buffer
00233 @type buff: StringIO
00234 @param numpy: numpy python module
00235 @type numpy module
00236 """
00237 try:
00238 _x = self
00239 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00240 _x = self.header.frame_id
00241 length = len(_x)
00242 buff.write(struct.pack('<I%ss'%length, length, _x))
00243 _x = self
00244 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00245 _x = self.status.goal_id.id
00246 length = len(_x)
00247 buff.write(struct.pack('<I%ss'%length, length, _x))
00248 buff.write(_struct_B.pack(self.status.status))
00249 _x = self.status.text
00250 length = len(_x)
00251 buff.write(struct.pack('<I%ss'%length, length, _x))
00252 _x = self
00253 buff.write(_struct_2I3B.pack(_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.trigger_conditions_met, _x.result.data.slip_event, _x.result.data.acceleration_event))
00254 buff.write(self.result.data.acceleration_vector.tostring())
00255 except struct.error, se: self._check_types(se)
00256 except TypeError, te: self._check_types(te)
00257
00258 def deserialize_numpy(self, str, numpy):
00259 """
00260 unpack serialized message in str into this message instance using numpy for array types
00261 @param str: byte array of serialized message
00262 @type str: str
00263 @param numpy: numpy python module
00264 @type numpy: module
00265 """
00266 try:
00267 if self.header is None:
00268 self.header = std_msgs.msg._Header.Header()
00269 if self.status is None:
00270 self.status = actionlib_msgs.msg.GoalStatus()
00271 if self.result is None:
00272 self.result = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorResult()
00273 end = 0
00274 _x = self
00275 start = end
00276 end += 12
00277 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00278 start = end
00279 end += 4
00280 (length,) = _struct_I.unpack(str[start:end])
00281 start = end
00282 end += length
00283 self.header.frame_id = str[start:end]
00284 _x = self
00285 start = end
00286 end += 8
00287 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00288 start = end
00289 end += 4
00290 (length,) = _struct_I.unpack(str[start:end])
00291 start = end
00292 end += length
00293 self.status.goal_id.id = str[start:end]
00294 start = end
00295 end += 1
00296 (self.status.status,) = _struct_B.unpack(str[start:end])
00297 start = end
00298 end += 4
00299 (length,) = _struct_I.unpack(str[start:end])
00300 start = end
00301 end += length
00302 self.status.text = str[start:end]
00303 _x = self
00304 start = end
00305 end += 11
00306 (_x.result.data.stamp.secs, _x.result.data.stamp.nsecs, _x.result.data.trigger_conditions_met, _x.result.data.slip_event, _x.result.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end])
00307 self.result.data.trigger_conditions_met = bool(self.result.data.trigger_conditions_met)
00308 self.result.data.slip_event = bool(self.result.data.slip_event)
00309 self.result.data.acceleration_event = bool(self.result.data.acceleration_event)
00310 start = end
00311 end += 24
00312 self.result.data.acceleration_vector = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
00313 return self
00314 except struct.error, e:
00315 raise roslib.message.DeserializationError(e)
00316
00317 _struct_I = roslib.message.struct_I
00318 _struct_3I = struct.Struct("<3I")
00319 _struct_B = struct.Struct("<B")
00320 _struct_2I3B = struct.Struct("<2I3B")
00321 _struct_2I = struct.Struct("<2I")
00322 _struct_3d = struct.Struct("<3d")