00001 """autogenerated by genmsg_py from PR2GripperFindContactActionGoal.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 PR2GripperFindContactActionGoal(roslib.message.Message):
00011 _md5sum = "50fc3f7e604d4e257a2e38e3aa3f204e"
00012 _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal"
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 PR2GripperFindContactGoal 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/PR2GripperFindContactGoal
00053 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00054 # Contact action used to close fingers and find object contacts
00055 # quickly while still stopping fast in real-time to not damage
00056 # objects
00057
00058 #goal
00059 PR2GripperFindContactCommand command
00060
00061 ================================================================================
00062 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactCommand
00063 # set true if you want to calibrate the fingertip sensors on the start
00064 # of the find_contact action. While this is not necessary (and
00065 # the default value will not calibrate the sensors) for best
00066 # performance it is recommended that you set this to true each time
00067 # you are calling find_contact and are confident the fingertips are
00068 # not touching anything
00069 # NOTE: SHOULD ONLY BE TRUE WHEN BOTH FINGERS ARE TOUCHING NOTHING
00070 bool zero_fingertip_sensors
00071
00072 # the finger contact conditions that determine what our goal is
00073 # Leaving this field blank will result in the robot closing until
00074 # contact on BOTH fingers is achieved
00075 int8 contact_conditions
00076
00077 # predefined values for the above contact_conditions variable
00078 int8 BOTH = 0 # both fingers must make contact
00079 int8 LEFT = 1 # just the left finger
00080 int8 RIGHT = 2 # just the right finger
00081 int8 EITHER = 3 # either finger, we don't care which
00082
00083 """
00084 __slots__ = ['header','goal_id','goal']
00085 _slot_types = ['Header','actionlib_msgs/GoalID','pr2_gripper_sensor_msgs/PR2GripperFindContactGoal']
00086
00087 def __init__(self, *args, **kwds):
00088 """
00089 Constructor. Any message fields that are implicitly/explicitly
00090 set to None will be assigned a default value. The recommend
00091 use is keyword arguments as this is more robust to future message
00092 changes. You cannot mix in-order arguments and keyword arguments.
00093
00094 The available fields are:
00095 header,goal_id,goal
00096
00097 @param args: complete set of field values, in .msg order
00098 @param kwds: use keyword arguments corresponding to message field names
00099 to set specific fields.
00100 """
00101 if args or kwds:
00102 super(PR2GripperFindContactActionGoal, self).__init__(*args, **kwds)
00103
00104 if self.header is None:
00105 self.header = std_msgs.msg._Header.Header()
00106 if self.goal_id is None:
00107 self.goal_id = actionlib_msgs.msg.GoalID()
00108 if self.goal is None:
00109 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactGoal()
00110 else:
00111 self.header = std_msgs.msg._Header.Header()
00112 self.goal_id = actionlib_msgs.msg.GoalID()
00113 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactGoal()
00114
00115 def _get_types(self):
00116 """
00117 internal API method
00118 """
00119 return self._slot_types
00120
00121 def serialize(self, buff):
00122 """
00123 serialize message into buffer
00124 @param buff: buffer
00125 @type buff: StringIO
00126 """
00127 try:
00128 _x = self
00129 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00130 _x = self.header.frame_id
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 _x = self
00134 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00135 _x = self.goal_id.id
00136 length = len(_x)
00137 buff.write(struct.pack('<I%ss'%length, length, _x))
00138 _x = self
00139 buff.write(_struct_Bb.pack(_x.goal.command.zero_fingertip_sensors, _x.goal.command.contact_conditions))
00140 except struct.error, se: self._check_types(se)
00141 except TypeError, te: self._check_types(te)
00142
00143 def deserialize(self, str):
00144 """
00145 unpack serialized message in str into this message instance
00146 @param str: byte array of serialized message
00147 @type str: str
00148 """
00149 try:
00150 if self.header is None:
00151 self.header = std_msgs.msg._Header.Header()
00152 if self.goal_id is None:
00153 self.goal_id = actionlib_msgs.msg.GoalID()
00154 if self.goal is None:
00155 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactGoal()
00156 end = 0
00157 _x = self
00158 start = end
00159 end += 12
00160 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 self.header.frame_id = str[start:end]
00167 _x = self
00168 start = end
00169 end += 8
00170 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 start = end
00175 end += length
00176 self.goal_id.id = str[start:end]
00177 _x = self
00178 start = end
00179 end += 2
00180 (_x.goal.command.zero_fingertip_sensors, _x.goal.command.contact_conditions,) = _struct_Bb.unpack(str[start:end])
00181 self.goal.command.zero_fingertip_sensors = bool(self.goal.command.zero_fingertip_sensors)
00182 return self
00183 except struct.error, e:
00184 raise roslib.message.DeserializationError(e)
00185
00186
00187 def serialize_numpy(self, buff, numpy):
00188 """
00189 serialize message with numpy array types into buffer
00190 @param buff: buffer
00191 @type buff: StringIO
00192 @param numpy: numpy python module
00193 @type numpy module
00194 """
00195 try:
00196 _x = self
00197 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00198 _x = self.header.frame_id
00199 length = len(_x)
00200 buff.write(struct.pack('<I%ss'%length, length, _x))
00201 _x = self
00202 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00203 _x = self.goal_id.id
00204 length = len(_x)
00205 buff.write(struct.pack('<I%ss'%length, length, _x))
00206 _x = self
00207 buff.write(_struct_Bb.pack(_x.goal.command.zero_fingertip_sensors, _x.goal.command.contact_conditions))
00208 except struct.error, se: self._check_types(se)
00209 except TypeError, te: self._check_types(te)
00210
00211 def deserialize_numpy(self, str, numpy):
00212 """
00213 unpack serialized message in str into this message instance using numpy for array types
00214 @param str: byte array of serialized message
00215 @type str: str
00216 @param numpy: numpy python module
00217 @type numpy: module
00218 """
00219 try:
00220 if self.header is None:
00221 self.header = std_msgs.msg._Header.Header()
00222 if self.goal_id is None:
00223 self.goal_id = actionlib_msgs.msg.GoalID()
00224 if self.goal is None:
00225 self.goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactGoal()
00226 end = 0
00227 _x = self
00228 start = end
00229 end += 12
00230 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 start = end
00235 end += length
00236 self.header.frame_id = str[start:end]
00237 _x = self
00238 start = end
00239 end += 8
00240 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00241 start = end
00242 end += 4
00243 (length,) = _struct_I.unpack(str[start:end])
00244 start = end
00245 end += length
00246 self.goal_id.id = str[start:end]
00247 _x = self
00248 start = end
00249 end += 2
00250 (_x.goal.command.zero_fingertip_sensors, _x.goal.command.contact_conditions,) = _struct_Bb.unpack(str[start:end])
00251 self.goal.command.zero_fingertip_sensors = bool(self.goal.command.zero_fingertip_sensors)
00252 return self
00253 except struct.error, e:
00254 raise roslib.message.DeserializationError(e)
00255
00256 _struct_I = roslib.message.struct_I
00257 _struct_3I = struct.Struct("<3I")
00258 _struct_2I = struct.Struct("<2I")
00259 _struct_Bb = struct.Struct("<Bb")