_ArmHandActionGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cogman_msgs/ArmHandActionGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import cogman_msgs.msg
00008 import geometry_msgs.msg
00009 import genpy
00010 import actionlib_msgs.msg
00011 import std_msgs.msg
00012 
00013 class ArmHandActionGoal(genpy.Message):
00014   _md5sum = "67892e60a5b18d39d45d5d9aff6688ae"
00015   _type = "cogman_msgs/ArmHandActionGoal"
00016   _has_header = True #flag to mark the presence of a Header object
00017   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00018 
00019 Header header
00020 actionlib_msgs/GoalID goal_id
00021 ArmHandGoal goal
00022 
00023 ================================================================================
00024 MSG: std_msgs/Header
00025 # Standard metadata for higher-level stamped data types.
00026 # This is generally used to communicate timestamped data 
00027 # in a particular coordinate frame.
00028 # 
00029 # sequence ID: consecutively increasing ID 
00030 uint32 seq
00031 #Two-integer timestamp that is expressed as:
00032 # * stamp.secs: seconds (stamp_secs) since epoch
00033 # * stamp.nsecs: nanoseconds since stamp_secs
00034 # time-handling sugar is provided by the client library
00035 time stamp
00036 #Frame this data is associated with
00037 # 0: no frame
00038 # 1: global frame
00039 string frame_id
00040 
00041 ================================================================================
00042 MSG: actionlib_msgs/GoalID
00043 # The stamp should store the time at which this goal was requested.
00044 # It is used by an action server when it tries to preempt all
00045 # goals that were requested before a certain time
00046 time stamp
00047 
00048 # The id provides a way to associate feedback and
00049 # result message with specific goal requests. The id
00050 # specified must be unique.
00051 string id
00052 
00053 
00054 ================================================================================
00055 MSG: cogman_msgs/ArmHandGoal
00056 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00057 string command              # 'arm_cart_loid', 'arm_cart_pose', 'arm_cart_name', 'arm_joints', 'arm_joint_name', 'reach_primitive', 'hand_primitive', 'lift', 'put_down'
00058 string pose_name            # When moving to pre-defined poses, cointains the name
00059 float32[] joint_angles      # If command is 'arm_joints', the joint angles
00060 geometry_msgs/Pose end_effector_pose  # command=arm_cart_pose: where the arm should go
00061 uint64 end_effector_loid    # one lo_id where the arm should go
00062 string hand_primitive       # Allowed strings: open open_thumb90 3pinch 2pinch cup_top peace handshake noop. Used when command is 'finger_primitive'
00063 string object_type          # If command is 'reach_primitive', it will define how to grasp (orientation ...)
00064 uint64[] obstacle_ids       # List of lo_id's corresponding to obstacles
00065 float32 distance            # For reach_primitive: distance from grasp point to approach point (m). For 'lift', distance to lift up (m)
00066 float32 supporting_plane    # Height of the table (m)
00067 
00068 ================================================================================
00069 MSG: geometry_msgs/Pose
00070 # A representation of pose in free space, composed of postion and orientation. 
00071 Point position
00072 Quaternion orientation
00073 
00074 ================================================================================
00075 MSG: geometry_msgs/Point
00076 # This contains the position of a point in free space
00077 float64 x
00078 float64 y
00079 float64 z
00080 
00081 ================================================================================
00082 MSG: geometry_msgs/Quaternion
00083 # This represents an orientation in free space in quaternion form.
00084 
00085 float64 x
00086 float64 y
00087 float64 z
00088 float64 w
00089 
00090 """
00091   __slots__ = ['header','goal_id','goal']
00092   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','cogman_msgs/ArmHandGoal']
00093 
00094   def __init__(self, *args, **kwds):
00095     """
00096     Constructor. Any message fields that are implicitly/explicitly
00097     set to None will be assigned a default value. The recommend
00098     use is keyword arguments as this is more robust to future message
00099     changes.  You cannot mix in-order arguments and keyword arguments.
00100 
00101     The available fields are:
00102        header,goal_id,goal
00103 
00104     :param args: complete set of field values, in .msg order
00105     :param kwds: use keyword arguments corresponding to message field names
00106     to set specific fields.
00107     """
00108     if args or kwds:
00109       super(ArmHandActionGoal, self).__init__(*args, **kwds)
00110       #message fields cannot be None, assign default values for those that are
00111       if self.header is None:
00112         self.header = std_msgs.msg.Header()
00113       if self.goal_id is None:
00114         self.goal_id = actionlib_msgs.msg.GoalID()
00115       if self.goal is None:
00116         self.goal = cogman_msgs.msg.ArmHandGoal()
00117     else:
00118       self.header = std_msgs.msg.Header()
00119       self.goal_id = actionlib_msgs.msg.GoalID()
00120       self.goal = cogman_msgs.msg.ArmHandGoal()
00121 
00122   def _get_types(self):
00123     """
00124     internal API method
00125     """
00126     return self._slot_types
00127 
00128   def serialize(self, buff):
00129     """
00130     serialize message into buffer
00131     :param buff: buffer, ``StringIO``
00132     """
00133     try:
00134       _x = self
00135       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00136       _x = self.header.frame_id
00137       length = len(_x)
00138       if python3 or type(_x) == unicode:
00139         _x = _x.encode('utf-8')
00140         length = len(_x)
00141       buff.write(struct.pack('<I%ss'%length, length, _x))
00142       _x = self
00143       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00144       _x = self.goal_id.id
00145       length = len(_x)
00146       if python3 or type(_x) == unicode:
00147         _x = _x.encode('utf-8')
00148         length = len(_x)
00149       buff.write(struct.pack('<I%ss'%length, length, _x))
00150       _x = self.goal.command
00151       length = len(_x)
00152       if python3 or type(_x) == unicode:
00153         _x = _x.encode('utf-8')
00154         length = len(_x)
00155       buff.write(struct.pack('<I%ss'%length, length, _x))
00156       _x = self.goal.pose_name
00157       length = len(_x)
00158       if python3 or type(_x) == unicode:
00159         _x = _x.encode('utf-8')
00160         length = len(_x)
00161       buff.write(struct.pack('<I%ss'%length, length, _x))
00162       length = len(self.goal.joint_angles)
00163       buff.write(_struct_I.pack(length))
00164       pattern = '<%sf'%length
00165       buff.write(struct.pack(pattern, *self.goal.joint_angles))
00166       _x = self
00167       buff.write(_struct_7dQ.pack(_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid))
00168       _x = self.goal.hand_primitive
00169       length = len(_x)
00170       if python3 or type(_x) == unicode:
00171         _x = _x.encode('utf-8')
00172         length = len(_x)
00173       buff.write(struct.pack('<I%ss'%length, length, _x))
00174       _x = self.goal.object_type
00175       length = len(_x)
00176       if python3 or type(_x) == unicode:
00177         _x = _x.encode('utf-8')
00178         length = len(_x)
00179       buff.write(struct.pack('<I%ss'%length, length, _x))
00180       length = len(self.goal.obstacle_ids)
00181       buff.write(_struct_I.pack(length))
00182       pattern = '<%sQ'%length
00183       buff.write(struct.pack(pattern, *self.goal.obstacle_ids))
00184       _x = self
00185       buff.write(_struct_2f.pack(_x.goal.distance, _x.goal.supporting_plane))
00186     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00187     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00188 
00189   def deserialize(self, str):
00190     """
00191     unpack serialized message in str into this message instance
00192     :param str: byte array of serialized message, ``str``
00193     """
00194     try:
00195       if self.header is None:
00196         self.header = std_msgs.msg.Header()
00197       if self.goal_id is None:
00198         self.goal_id = actionlib_msgs.msg.GoalID()
00199       if self.goal is None:
00200         self.goal = cogman_msgs.msg.ArmHandGoal()
00201       end = 0
00202       _x = self
00203       start = end
00204       end += 12
00205       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       start = end
00210       end += length
00211       if python3:
00212         self.header.frame_id = str[start:end].decode('utf-8')
00213       else:
00214         self.header.frame_id = str[start:end]
00215       _x = self
00216       start = end
00217       end += 8
00218       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00219       start = end
00220       end += 4
00221       (length,) = _struct_I.unpack(str[start:end])
00222       start = end
00223       end += length
00224       if python3:
00225         self.goal_id.id = str[start:end].decode('utf-8')
00226       else:
00227         self.goal_id.id = str[start:end]
00228       start = end
00229       end += 4
00230       (length,) = _struct_I.unpack(str[start:end])
00231       start = end
00232       end += length
00233       if python3:
00234         self.goal.command = str[start:end].decode('utf-8')
00235       else:
00236         self.goal.command = str[start:end]
00237       start = end
00238       end += 4
00239       (length,) = _struct_I.unpack(str[start:end])
00240       start = end
00241       end += length
00242       if python3:
00243         self.goal.pose_name = str[start:end].decode('utf-8')
00244       else:
00245         self.goal.pose_name = str[start:end]
00246       start = end
00247       end += 4
00248       (length,) = _struct_I.unpack(str[start:end])
00249       pattern = '<%sf'%length
00250       start = end
00251       end += struct.calcsize(pattern)
00252       self.goal.joint_angles = struct.unpack(pattern, str[start:end])
00253       _x = self
00254       start = end
00255       end += 64
00256       (_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid,) = _struct_7dQ.unpack(str[start:end])
00257       start = end
00258       end += 4
00259       (length,) = _struct_I.unpack(str[start:end])
00260       start = end
00261       end += length
00262       if python3:
00263         self.goal.hand_primitive = str[start:end].decode('utf-8')
00264       else:
00265         self.goal.hand_primitive = str[start:end]
00266       start = end
00267       end += 4
00268       (length,) = _struct_I.unpack(str[start:end])
00269       start = end
00270       end += length
00271       if python3:
00272         self.goal.object_type = str[start:end].decode('utf-8')
00273       else:
00274         self.goal.object_type = str[start:end]
00275       start = end
00276       end += 4
00277       (length,) = _struct_I.unpack(str[start:end])
00278       pattern = '<%sQ'%length
00279       start = end
00280       end += struct.calcsize(pattern)
00281       self.goal.obstacle_ids = struct.unpack(pattern, str[start:end])
00282       _x = self
00283       start = end
00284       end += 8
00285       (_x.goal.distance, _x.goal.supporting_plane,) = _struct_2f.unpack(str[start:end])
00286       return self
00287     except struct.error as e:
00288       raise genpy.DeserializationError(e) #most likely buffer underfill
00289 
00290 
00291   def serialize_numpy(self, buff, numpy):
00292     """
00293     serialize message with numpy array types into buffer
00294     :param buff: buffer, ``StringIO``
00295     :param numpy: numpy python module
00296     """
00297     try:
00298       _x = self
00299       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00300       _x = self.header.frame_id
00301       length = len(_x)
00302       if python3 or type(_x) == unicode:
00303         _x = _x.encode('utf-8')
00304         length = len(_x)
00305       buff.write(struct.pack('<I%ss'%length, length, _x))
00306       _x = self
00307       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00308       _x = self.goal_id.id
00309       length = len(_x)
00310       if python3 or type(_x) == unicode:
00311         _x = _x.encode('utf-8')
00312         length = len(_x)
00313       buff.write(struct.pack('<I%ss'%length, length, _x))
00314       _x = self.goal.command
00315       length = len(_x)
00316       if python3 or type(_x) == unicode:
00317         _x = _x.encode('utf-8')
00318         length = len(_x)
00319       buff.write(struct.pack('<I%ss'%length, length, _x))
00320       _x = self.goal.pose_name
00321       length = len(_x)
00322       if python3 or type(_x) == unicode:
00323         _x = _x.encode('utf-8')
00324         length = len(_x)
00325       buff.write(struct.pack('<I%ss'%length, length, _x))
00326       length = len(self.goal.joint_angles)
00327       buff.write(_struct_I.pack(length))
00328       pattern = '<%sf'%length
00329       buff.write(self.goal.joint_angles.tostring())
00330       _x = self
00331       buff.write(_struct_7dQ.pack(_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid))
00332       _x = self.goal.hand_primitive
00333       length = len(_x)
00334       if python3 or type(_x) == unicode:
00335         _x = _x.encode('utf-8')
00336         length = len(_x)
00337       buff.write(struct.pack('<I%ss'%length, length, _x))
00338       _x = self.goal.object_type
00339       length = len(_x)
00340       if python3 or type(_x) == unicode:
00341         _x = _x.encode('utf-8')
00342         length = len(_x)
00343       buff.write(struct.pack('<I%ss'%length, length, _x))
00344       length = len(self.goal.obstacle_ids)
00345       buff.write(_struct_I.pack(length))
00346       pattern = '<%sQ'%length
00347       buff.write(self.goal.obstacle_ids.tostring())
00348       _x = self
00349       buff.write(_struct_2f.pack(_x.goal.distance, _x.goal.supporting_plane))
00350     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00351     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00352 
00353   def deserialize_numpy(self, str, numpy):
00354     """
00355     unpack serialized message in str into this message instance using numpy for array types
00356     :param str: byte array of serialized message, ``str``
00357     :param numpy: numpy python module
00358     """
00359     try:
00360       if self.header is None:
00361         self.header = std_msgs.msg.Header()
00362       if self.goal_id is None:
00363         self.goal_id = actionlib_msgs.msg.GoalID()
00364       if self.goal is None:
00365         self.goal = cogman_msgs.msg.ArmHandGoal()
00366       end = 0
00367       _x = self
00368       start = end
00369       end += 12
00370       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00371       start = end
00372       end += 4
00373       (length,) = _struct_I.unpack(str[start:end])
00374       start = end
00375       end += length
00376       if python3:
00377         self.header.frame_id = str[start:end].decode('utf-8')
00378       else:
00379         self.header.frame_id = str[start:end]
00380       _x = self
00381       start = end
00382       end += 8
00383       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00384       start = end
00385       end += 4
00386       (length,) = _struct_I.unpack(str[start:end])
00387       start = end
00388       end += length
00389       if python3:
00390         self.goal_id.id = str[start:end].decode('utf-8')
00391       else:
00392         self.goal_id.id = str[start:end]
00393       start = end
00394       end += 4
00395       (length,) = _struct_I.unpack(str[start:end])
00396       start = end
00397       end += length
00398       if python3:
00399         self.goal.command = str[start:end].decode('utf-8')
00400       else:
00401         self.goal.command = str[start:end]
00402       start = end
00403       end += 4
00404       (length,) = _struct_I.unpack(str[start:end])
00405       start = end
00406       end += length
00407       if python3:
00408         self.goal.pose_name = str[start:end].decode('utf-8')
00409       else:
00410         self.goal.pose_name = str[start:end]
00411       start = end
00412       end += 4
00413       (length,) = _struct_I.unpack(str[start:end])
00414       pattern = '<%sf'%length
00415       start = end
00416       end += struct.calcsize(pattern)
00417       self.goal.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00418       _x = self
00419       start = end
00420       end += 64
00421       (_x.goal.end_effector_pose.position.x, _x.goal.end_effector_pose.position.y, _x.goal.end_effector_pose.position.z, _x.goal.end_effector_pose.orientation.x, _x.goal.end_effector_pose.orientation.y, _x.goal.end_effector_pose.orientation.z, _x.goal.end_effector_pose.orientation.w, _x.goal.end_effector_loid,) = _struct_7dQ.unpack(str[start:end])
00422       start = end
00423       end += 4
00424       (length,) = _struct_I.unpack(str[start:end])
00425       start = end
00426       end += length
00427       if python3:
00428         self.goal.hand_primitive = str[start:end].decode('utf-8')
00429       else:
00430         self.goal.hand_primitive = str[start:end]
00431       start = end
00432       end += 4
00433       (length,) = _struct_I.unpack(str[start:end])
00434       start = end
00435       end += length
00436       if python3:
00437         self.goal.object_type = str[start:end].decode('utf-8')
00438       else:
00439         self.goal.object_type = str[start:end]
00440       start = end
00441       end += 4
00442       (length,) = _struct_I.unpack(str[start:end])
00443       pattern = '<%sQ'%length
00444       start = end
00445       end += struct.calcsize(pattern)
00446       self.goal.obstacle_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length)
00447       _x = self
00448       start = end
00449       end += 8
00450       (_x.goal.distance, _x.goal.supporting_plane,) = _struct_2f.unpack(str[start:end])
00451       return self
00452     except struct.error as e:
00453       raise genpy.DeserializationError(e) #most likely buffer underfill
00454 
00455 _struct_I = genpy.struct_I
00456 _struct_7dQ = struct.Struct("<7dQ")
00457 _struct_3I = struct.Struct("<3I")
00458 _struct_2I = struct.Struct("<2I")
00459 _struct_2f = struct.Struct("<2f")


cogman_msgs
Author(s): Alexis Maldonado
autogenerated on Mon Oct 6 2014 00:48:49