$search
00001 """autogenerated by genmsg_py from PR2GripperEventDetectorActionFeedback.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 PR2GripperEventDetectorActionFeedback(roslib.message.Message): 00011 _md5sum = "b7cae5a018676f4d59b2f204229012d4" 00012 _type = "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionFeedback" 00013 _has_header = True #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 00016 Header header 00017 actionlib_msgs/GoalStatus status 00018 PR2GripperEventDetectorFeedback feedback 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/PR2GripperEventDetectorFeedback 00079 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00080 # feedback 00081 PR2GripperEventDetectorData data 00082 00083 00084 00085 ================================================================================ 00086 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorData 00087 # Time the data was recorded at 00088 time stamp 00089 00090 # true if the trigger conditions have been met 00091 # (see PR2GripperEventDetectorCommand) 00092 bool trigger_conditions_met 00093 00094 # true if the pressure sensors detected a slip event 00095 # slip events occur when the finger pressure sensors 00096 # high-freq. content exceeds the slip_trigger_magnitude variable 00097 # (see PR2GripperEventDetectorCommand) 00098 bool slip_event 00099 00100 # true if the hand-mounted accelerometer detected a contact acceleration 00101 # acceleration events occur when the palm accelerometer 00102 # high-freq. content exceeds the acc_trigger_magnitude variable 00103 # (see PR2GripperEventDetectorCommand) 00104 bool acceleration_event 00105 00106 # the high-freq acceleration vector that was last seen (x,y,z) 00107 float64[3] acceleration_vector 00108 """ 00109 __slots__ = ['header','status','feedback'] 00110 _slot_types = ['Header','actionlib_msgs/GoalStatus','pr2_gripper_sensor_msgs/PR2GripperEventDetectorFeedback'] 00111 00112 def __init__(self, *args, **kwds): 00113 """ 00114 Constructor. Any message fields that are implicitly/explicitly 00115 set to None will be assigned a default value. The recommend 00116 use is keyword arguments as this is more robust to future message 00117 changes. You cannot mix in-order arguments and keyword arguments. 00118 00119 The available fields are: 00120 header,status,feedback 00121 00122 @param args: complete set of field values, in .msg order 00123 @param kwds: use keyword arguments corresponding to message field names 00124 to set specific fields. 00125 """ 00126 if args or kwds: 00127 super(PR2GripperEventDetectorActionFeedback, self).__init__(*args, **kwds) 00128 #message fields cannot be None, assign default values for those that are 00129 if self.header is None: 00130 self.header = std_msgs.msg._Header.Header() 00131 if self.status is None: 00132 self.status = actionlib_msgs.msg.GoalStatus() 00133 if self.feedback is None: 00134 self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorFeedback() 00135 else: 00136 self.header = std_msgs.msg._Header.Header() 00137 self.status = actionlib_msgs.msg.GoalStatus() 00138 self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorFeedback() 00139 00140 def _get_types(self): 00141 """ 00142 internal API method 00143 """ 00144 return self._slot_types 00145 00146 def serialize(self, buff): 00147 """ 00148 serialize message into buffer 00149 @param buff: buffer 00150 @type buff: StringIO 00151 """ 00152 try: 00153 _x = self 00154 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00155 _x = self.header.frame_id 00156 length = len(_x) 00157 buff.write(struct.pack('<I%ss'%length, length, _x)) 00158 _x = self 00159 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 00160 _x = self.status.goal_id.id 00161 length = len(_x) 00162 buff.write(struct.pack('<I%ss'%length, length, _x)) 00163 buff.write(_struct_B.pack(self.status.status)) 00164 _x = self.status.text 00165 length = len(_x) 00166 buff.write(struct.pack('<I%ss'%length, length, _x)) 00167 _x = self 00168 buff.write(_struct_2I3B.pack(_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.trigger_conditions_met, _x.feedback.data.slip_event, _x.feedback.data.acceleration_event)) 00169 buff.write(_struct_3d.pack(*self.feedback.data.acceleration_vector)) 00170 except struct.error as se: self._check_types(se) 00171 except TypeError as te: self._check_types(te) 00172 00173 def deserialize(self, str): 00174 """ 00175 unpack serialized message in str into this message instance 00176 @param str: byte array of serialized message 00177 @type str: str 00178 """ 00179 try: 00180 if self.header is None: 00181 self.header = std_msgs.msg._Header.Header() 00182 if self.status is None: 00183 self.status = actionlib_msgs.msg.GoalStatus() 00184 if self.feedback is None: 00185 self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorFeedback() 00186 end = 0 00187 _x = self 00188 start = end 00189 end += 12 00190 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00191 start = end 00192 end += 4 00193 (length,) = _struct_I.unpack(str[start:end]) 00194 start = end 00195 end += length 00196 self.header.frame_id = str[start:end] 00197 _x = self 00198 start = end 00199 end += 8 00200 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 start = end 00205 end += length 00206 self.status.goal_id.id = str[start:end] 00207 start = end 00208 end += 1 00209 (self.status.status,) = _struct_B.unpack(str[start:end]) 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 start = end 00214 end += length 00215 self.status.text = str[start:end] 00216 _x = self 00217 start = end 00218 end += 11 00219 (_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.trigger_conditions_met, _x.feedback.data.slip_event, _x.feedback.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end]) 00220 self.feedback.data.trigger_conditions_met = bool(self.feedback.data.trigger_conditions_met) 00221 self.feedback.data.slip_event = bool(self.feedback.data.slip_event) 00222 self.feedback.data.acceleration_event = bool(self.feedback.data.acceleration_event) 00223 start = end 00224 end += 24 00225 self.feedback.data.acceleration_vector = _struct_3d.unpack(str[start:end]) 00226 return self 00227 except struct.error as e: 00228 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00229 00230 00231 def serialize_numpy(self, buff, numpy): 00232 """ 00233 serialize message with numpy array types into buffer 00234 @param buff: buffer 00235 @type buff: StringIO 00236 @param numpy: numpy python module 00237 @type numpy module 00238 """ 00239 try: 00240 _x = self 00241 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00242 _x = self.header.frame_id 00243 length = len(_x) 00244 buff.write(struct.pack('<I%ss'%length, length, _x)) 00245 _x = self 00246 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 00247 _x = self.status.goal_id.id 00248 length = len(_x) 00249 buff.write(struct.pack('<I%ss'%length, length, _x)) 00250 buff.write(_struct_B.pack(self.status.status)) 00251 _x = self.status.text 00252 length = len(_x) 00253 buff.write(struct.pack('<I%ss'%length, length, _x)) 00254 _x = self 00255 buff.write(_struct_2I3B.pack(_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.trigger_conditions_met, _x.feedback.data.slip_event, _x.feedback.data.acceleration_event)) 00256 buff.write(self.feedback.data.acceleration_vector.tostring()) 00257 except struct.error as se: self._check_types(se) 00258 except TypeError as te: self._check_types(te) 00259 00260 def deserialize_numpy(self, str, numpy): 00261 """ 00262 unpack serialized message in str into this message instance using numpy for array types 00263 @param str: byte array of serialized message 00264 @type str: str 00265 @param numpy: numpy python module 00266 @type numpy: module 00267 """ 00268 try: 00269 if self.header is None: 00270 self.header = std_msgs.msg._Header.Header() 00271 if self.status is None: 00272 self.status = actionlib_msgs.msg.GoalStatus() 00273 if self.feedback is None: 00274 self.feedback = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorFeedback() 00275 end = 0 00276 _x = self 00277 start = end 00278 end += 12 00279 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00280 start = end 00281 end += 4 00282 (length,) = _struct_I.unpack(str[start:end]) 00283 start = end 00284 end += length 00285 self.header.frame_id = str[start:end] 00286 _x = self 00287 start = end 00288 end += 8 00289 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00290 start = end 00291 end += 4 00292 (length,) = _struct_I.unpack(str[start:end]) 00293 start = end 00294 end += length 00295 self.status.goal_id.id = str[start:end] 00296 start = end 00297 end += 1 00298 (self.status.status,) = _struct_B.unpack(str[start:end]) 00299 start = end 00300 end += 4 00301 (length,) = _struct_I.unpack(str[start:end]) 00302 start = end 00303 end += length 00304 self.status.text = str[start:end] 00305 _x = self 00306 start = end 00307 end += 11 00308 (_x.feedback.data.stamp.secs, _x.feedback.data.stamp.nsecs, _x.feedback.data.trigger_conditions_met, _x.feedback.data.slip_event, _x.feedback.data.acceleration_event,) = _struct_2I3B.unpack(str[start:end]) 00309 self.feedback.data.trigger_conditions_met = bool(self.feedback.data.trigger_conditions_met) 00310 self.feedback.data.slip_event = bool(self.feedback.data.slip_event) 00311 self.feedback.data.acceleration_event = bool(self.feedback.data.acceleration_event) 00312 start = end 00313 end += 24 00314 self.feedback.data.acceleration_vector = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3) 00315 return self 00316 except struct.error as e: 00317 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00318 00319 _struct_I = roslib.message.struct_I 00320 _struct_3I = struct.Struct("<3I") 00321 _struct_B = struct.Struct("<B") 00322 _struct_2I3B = struct.Struct("<2I3B") 00323 _struct_2I = struct.Struct("<2I") 00324 _struct_3d = struct.Struct("<3d")