00001 """autogenerated by genmsg_py from Pr2GripperCommandActionFeedback.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import pr2_controllers_msgs.msg
00006 import roslib.rostime
00007 import actionlib_msgs.msg
00008 import std_msgs.msg
00009
00010 class Pr2GripperCommandActionFeedback(roslib.message.Message):
00011 _md5sum = "653dff30c045f5e6ff3feb3409f4558d"
00012 _type = "pr2_controllers_msgs/Pr2GripperCommandActionFeedback"
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 Pr2GripperCommandFeedback 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_controllers_msgs/Pr2GripperCommandFeedback
00079 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00080 float64 position # The current gripper gap size (in meters)
00081 float64 effort # The current effort exerted (in Newtons)
00082 bool stalled # True iff the gripper is exerting max effort and not moving
00083 bool reached_goal # True iff the gripper position has reached the commanded setpoint
00084
00085
00086 """
00087 __slots__ = ['header','status','feedback']
00088 _slot_types = ['Header','actionlib_msgs/GoalStatus','pr2_controllers_msgs/Pr2GripperCommandFeedback']
00089
00090 def __init__(self, *args, **kwds):
00091 """
00092 Constructor. Any message fields that are implicitly/explicitly
00093 set to None will be assigned a default value. The recommend
00094 use is keyword arguments as this is more robust to future message
00095 changes. You cannot mix in-order arguments and keyword arguments.
00096
00097 The available fields are:
00098 header,status,feedback
00099
00100 @param args: complete set of field values, in .msg order
00101 @param kwds: use keyword arguments corresponding to message field names
00102 to set specific fields.
00103 """
00104 if args or kwds:
00105 super(Pr2GripperCommandActionFeedback, self).__init__(*args, **kwds)
00106
00107 if self.header is None:
00108 self.header = std_msgs.msg._Header.Header()
00109 if self.status is None:
00110 self.status = actionlib_msgs.msg.GoalStatus()
00111 if self.feedback is None:
00112 self.feedback = pr2_controllers_msgs.msg.Pr2GripperCommandFeedback()
00113 else:
00114 self.header = std_msgs.msg._Header.Header()
00115 self.status = actionlib_msgs.msg.GoalStatus()
00116 self.feedback = pr2_controllers_msgs.msg.Pr2GripperCommandFeedback()
00117
00118 def _get_types(self):
00119 """
00120 internal API method
00121 """
00122 return self._slot_types
00123
00124 def serialize(self, buff):
00125 """
00126 serialize message into buffer
00127 @param buff: buffer
00128 @type buff: StringIO
00129 """
00130 try:
00131 _x = self
00132 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00133 _x = self.header.frame_id
00134 length = len(_x)
00135 buff.write(struct.pack('<I%ss'%length, length, _x))
00136 _x = self
00137 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00138 _x = self.status.goal_id.id
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 buff.write(_struct_B.pack(self.status.status))
00142 _x = self.status.text
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = self
00146 buff.write(_struct_2d2B.pack(_x.feedback.position, _x.feedback.effort, _x.feedback.stalled, _x.feedback.reached_goal))
00147 except struct.error, se: self._check_types(se)
00148 except TypeError, te: self._check_types(te)
00149
00150 def deserialize(self, str):
00151 """
00152 unpack serialized message in str into this message instance
00153 @param str: byte array of serialized message
00154 @type str: str
00155 """
00156 try:
00157 if self.header is None:
00158 self.header = std_msgs.msg._Header.Header()
00159 if self.status is None:
00160 self.status = actionlib_msgs.msg.GoalStatus()
00161 if self.feedback is None:
00162 self.feedback = pr2_controllers_msgs.msg.Pr2GripperCommandFeedback()
00163 end = 0
00164 _x = self
00165 start = end
00166 end += 12
00167 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00168 start = end
00169 end += 4
00170 (length,) = _struct_I.unpack(str[start:end])
00171 start = end
00172 end += length
00173 self.header.frame_id = str[start:end]
00174 _x = self
00175 start = end
00176 end += 8
00177 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 start = end
00182 end += length
00183 self.status.goal_id.id = str[start:end]
00184 start = end
00185 end += 1
00186 (self.status.status,) = _struct_B.unpack(str[start:end])
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 start = end
00191 end += length
00192 self.status.text = str[start:end]
00193 _x = self
00194 start = end
00195 end += 18
00196 (_x.feedback.position, _x.feedback.effort, _x.feedback.stalled, _x.feedback.reached_goal,) = _struct_2d2B.unpack(str[start:end])
00197 self.feedback.stalled = bool(self.feedback.stalled)
00198 self.feedback.reached_goal = bool(self.feedback.reached_goal)
00199 return self
00200 except struct.error, e:
00201 raise roslib.message.DeserializationError(e)
00202
00203
00204 def serialize_numpy(self, buff, numpy):
00205 """
00206 serialize message with numpy array types into buffer
00207 @param buff: buffer
00208 @type buff: StringIO
00209 @param numpy: numpy python module
00210 @type numpy module
00211 """
00212 try:
00213 _x = self
00214 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00215 _x = self.header.frame_id
00216 length = len(_x)
00217 buff.write(struct.pack('<I%ss'%length, length, _x))
00218 _x = self
00219 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00220 _x = self.status.goal_id.id
00221 length = len(_x)
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 buff.write(_struct_B.pack(self.status.status))
00224 _x = self.status.text
00225 length = len(_x)
00226 buff.write(struct.pack('<I%ss'%length, length, _x))
00227 _x = self
00228 buff.write(_struct_2d2B.pack(_x.feedback.position, _x.feedback.effort, _x.feedback.stalled, _x.feedback.reached_goal))
00229 except struct.error, se: self._check_types(se)
00230 except TypeError, te: self._check_types(te)
00231
00232 def deserialize_numpy(self, str, numpy):
00233 """
00234 unpack serialized message in str into this message instance using numpy for array types
00235 @param str: byte array of serialized message
00236 @type str: str
00237 @param numpy: numpy python module
00238 @type numpy: module
00239 """
00240 try:
00241 if self.header is None:
00242 self.header = std_msgs.msg._Header.Header()
00243 if self.status is None:
00244 self.status = actionlib_msgs.msg.GoalStatus()
00245 if self.feedback is None:
00246 self.feedback = pr2_controllers_msgs.msg.Pr2GripperCommandFeedback()
00247 end = 0
00248 _x = self
00249 start = end
00250 end += 12
00251 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 start = end
00256 end += length
00257 self.header.frame_id = str[start:end]
00258 _x = self
00259 start = end
00260 end += 8
00261 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00262 start = end
00263 end += 4
00264 (length,) = _struct_I.unpack(str[start:end])
00265 start = end
00266 end += length
00267 self.status.goal_id.id = str[start:end]
00268 start = end
00269 end += 1
00270 (self.status.status,) = _struct_B.unpack(str[start:end])
00271 start = end
00272 end += 4
00273 (length,) = _struct_I.unpack(str[start:end])
00274 start = end
00275 end += length
00276 self.status.text = str[start:end]
00277 _x = self
00278 start = end
00279 end += 18
00280 (_x.feedback.position, _x.feedback.effort, _x.feedback.stalled, _x.feedback.reached_goal,) = _struct_2d2B.unpack(str[start:end])
00281 self.feedback.stalled = bool(self.feedback.stalled)
00282 self.feedback.reached_goal = bool(self.feedback.reached_goal)
00283 return self
00284 except struct.error, e:
00285 raise roslib.message.DeserializationError(e)
00286
00287 _struct_I = roslib.message.struct_I
00288 _struct_2d2B = struct.Struct("<2d2B")
00289 _struct_3I = struct.Struct("<3I")
00290 _struct_B = struct.Struct("<B")
00291 _struct_2I = struct.Struct("<2I")