00001 """autogenerated by genmsg_py from PR2GripperEventDetectorActionGoal.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 PR2GripperEventDetectorActionGoal(roslib.message.Message):
00011 _md5sum = "b1b345667b018e9030cc7b6aad5c1455"
00012 _type = "pr2_gripper_sensor_msgs/PR2GripperEventDetectorActionGoal"
00013 _has_header = True
00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015
00016 Header header
00017 actionlib_msgs/GoalID goal_id
00018 PR2GripperEventDetectorGoal goal
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/GoalID
00040 # The stamp should store the time at which this goal was requested.
00041 # It is used by an action server when it tries to preempt all
00042 # goals that were requested before a certain time
00043 time stamp
00044
00045 # The id provides a way to associate feedback and
00046 # result message with specific goal requests. The id
00047 # specified must be unique.
00048 string id
00049
00050
00051 ================================================================================
00052 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal
00053 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00054 # Event Detector action used to tell detect events happening on the
00055 # palm mounted accelerometer and finger pressure sensors
00056
00057 #goal
00058 PR2GripperEventDetectorCommand command
00059
00060 ================================================================================
00061 MSG: pr2_gripper_sensor_msgs/PR2GripperEventDetectorCommand
00062 # state variable that defines what events we would like to trigger on
00063 # Leaving this field blank will result in the robot triggering when
00064 # anything touches the sides of the finger or an impact is detected
00065 # with the hand/arm.
00066 int8 trigger_conditions
00067 # definitions for our various trigger_conditions values
00068 # trigger on either acceleration contact or finger sensor side impact
00069 int8 FINGER_SIDE_IMPACT_OR_ACC = 0
00070 # tigger once both slip and acceleration signals occur
00071 int8 SLIP_AND_ACC = 1
00072 # trigger on either slip, acceleration, or finger sensor side impact
00073 int8 FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC = 2
00074 # trigger only on slip information
00075 int8 SLIP = 3
00076 # trigger only on acceleration contact information
00077 int8 ACC = 4
00078
00079
00080 # the amount of acceleration to trigger on (acceleration vector magnitude)
00081 # Units = m/s^2
00082 # The user needs to be concerned here about not setting the trigger too
00083 # low so that is set off by the robot's own motions.
00084 #
00085 # For large rapid motions, say by a motion planner, 5 m/s^2 is a good level
00086 # For small delicate controlled motions this can be set MUCH lower (try 2.0)
00087 #
00088 # NOTE: When moving the gripper joint (opening/closing the grippr)
00089 # the high gearing of the PR2 gripper causes large acceleration vibrations
00090 # which will cause triggering to occur. This is a known drawback of the PR2.
00091 #
00092 # NOTE: Leaving this value blank will result in a 0 m/s^2 trigger. If you
00093 # are using a trigger_conditions value that returns on acceleration contact
00094 # events then it will immediately exceed your trigger and return
00095 float64 acceleration_trigger_magnitude
00096
00097
00098 # the slip detector gain to trigger on (either finger) : try 0.01
00099 # higher values decrease slip sensitivty (to a point)
00100 # lower values increase sensitivity (to a point)
00101 #
00102 # NOTE: Leaving this value blank will result in the most sensitive slip level.
00103 float64 slip_trigger_magnitude
00104 """
00105 __slots__ = ['header','goal_id','goal']
00106 _slot_types = ['Header','actionlib_msgs/GoalID','pr2_gripper_sensor_msgs/PR2GripperEventDetectorGoal']
00107
00108 def __init__(self, *args, **kwds):
00109 """
00110 Constructor. Any message fields that are implicitly/explicitly
00111 set to None will be assigned a default value. The recommend
00112 use is keyword arguments as this is more robust to future message
00113 changes. You cannot mix in-order arguments and keyword arguments.
00114
00115 The available fields are:
00116 header,goal_id,goal
00117
00118 @param args: complete set of field values, in .msg order
00119 @param kwds: use keyword arguments corresponding to message field names
00120 to set specific fields.
00121 """
00122 if args or kwds:
00123 super(PR2GripperEventDetectorActionGoal, self).__init__(*args, **kwds)
00124
00125 if self.header is None:
00126 self.header = std_msgs.msg._Header.Header()
00127 if self.goal_id is None:
00128 self.goal_id = actionlib_msgs.msg.GoalID()
00129 if self.goal is None:
00130 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorGoal()
00131 else:
00132 self.header = std_msgs.msg._Header.Header()
00133 self.goal_id = actionlib_msgs.msg.GoalID()
00134 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorGoal()
00135
00136 def _get_types(self):
00137 """
00138 internal API method
00139 """
00140 return self._slot_types
00141
00142 def serialize(self, buff):
00143 """
00144 serialize message into buffer
00145 @param buff: buffer
00146 @type buff: StringIO
00147 """
00148 try:
00149 _x = self
00150 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00151 _x = self.header.frame_id
00152 length = len(_x)
00153 buff.write(struct.pack('<I%ss'%length, length, _x))
00154 _x = self
00155 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00156 _x = self.goal_id.id
00157 length = len(_x)
00158 buff.write(struct.pack('<I%ss'%length, length, _x))
00159 _x = self
00160 buff.write(_struct_b2d.pack(_x.goal.command.trigger_conditions, _x.goal.command.acceleration_trigger_magnitude, _x.goal.command.slip_trigger_magnitude))
00161 except struct.error, se: self._check_types(se)
00162 except TypeError, te: self._check_types(te)
00163
00164 def deserialize(self, str):
00165 """
00166 unpack serialized message in str into this message instance
00167 @param str: byte array of serialized message
00168 @type str: str
00169 """
00170 try:
00171 if self.header is None:
00172 self.header = std_msgs.msg._Header.Header()
00173 if self.goal_id is None:
00174 self.goal_id = actionlib_msgs.msg.GoalID()
00175 if self.goal is None:
00176 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorGoal()
00177 end = 0
00178 _x = self
00179 start = end
00180 end += 12
00181 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00182 start = end
00183 end += 4
00184 (length,) = _struct_I.unpack(str[start:end])
00185 start = end
00186 end += length
00187 self.header.frame_id = str[start:end]
00188 _x = self
00189 start = end
00190 end += 8
00191 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 start = end
00196 end += length
00197 self.goal_id.id = str[start:end]
00198 _x = self
00199 start = end
00200 end += 17
00201 (_x.goal.command.trigger_conditions, _x.goal.command.acceleration_trigger_magnitude, _x.goal.command.slip_trigger_magnitude,) = _struct_b2d.unpack(str[start:end])
00202 return self
00203 except struct.error, e:
00204 raise roslib.message.DeserializationError(e)
00205
00206
00207 def serialize_numpy(self, buff, numpy):
00208 """
00209 serialize message with numpy array types into buffer
00210 @param buff: buffer
00211 @type buff: StringIO
00212 @param numpy: numpy python module
00213 @type numpy module
00214 """
00215 try:
00216 _x = self
00217 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00218 _x = self.header.frame_id
00219 length = len(_x)
00220 buff.write(struct.pack('<I%ss'%length, length, _x))
00221 _x = self
00222 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00223 _x = self.goal_id.id
00224 length = len(_x)
00225 buff.write(struct.pack('<I%ss'%length, length, _x))
00226 _x = self
00227 buff.write(_struct_b2d.pack(_x.goal.command.trigger_conditions, _x.goal.command.acceleration_trigger_magnitude, _x.goal.command.slip_trigger_magnitude))
00228 except struct.error, se: self._check_types(se)
00229 except TypeError, te: self._check_types(te)
00230
00231 def deserialize_numpy(self, str, numpy):
00232 """
00233 unpack serialized message in str into this message instance using numpy for array types
00234 @param str: byte array of serialized message
00235 @type str: str
00236 @param numpy: numpy python module
00237 @type numpy: module
00238 """
00239 try:
00240 if self.header is None:
00241 self.header = std_msgs.msg._Header.Header()
00242 if self.goal_id is None:
00243 self.goal_id = actionlib_msgs.msg.GoalID()
00244 if self.goal is None:
00245 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperEventDetectorGoal()
00246 end = 0
00247 _x = self
00248 start = end
00249 end += 12
00250 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 start = end
00255 end += length
00256 self.header.frame_id = str[start:end]
00257 _x = self
00258 start = end
00259 end += 8
00260 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00261 start = end
00262 end += 4
00263 (length,) = _struct_I.unpack(str[start:end])
00264 start = end
00265 end += length
00266 self.goal_id.id = str[start:end]
00267 _x = self
00268 start = end
00269 end += 17
00270 (_x.goal.command.trigger_conditions, _x.goal.command.acceleration_trigger_magnitude, _x.goal.command.slip_trigger_magnitude,) = _struct_b2d.unpack(str[start:end])
00271 return self
00272 except struct.error, e:
00273 raise roslib.message.DeserializationError(e)
00274
00275 _struct_I = roslib.message.struct_I
00276 _struct_3I = struct.Struct("<3I")
00277 _struct_b2d = struct.Struct("<b2d")
00278 _struct_2I = struct.Struct("<2I")