_MoveArmGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from simple_arm_server/MoveArmGoal.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 geometry_msgs.msg
00008 import simple_arm_server.msg
00009 import genpy
00010 import std_msgs.msg
00011 
00012 class MoveArmGoal(genpy.Message):
00013   _md5sum = "ac68653317d50968c1043cdf98e3aea9"
00014   _type = "simple_arm_server/MoveArmGoal"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017 std_msgs/Header header
00018 ArmAction[] motions
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: simple_arm_server/ArmAction
00040 #
00041 # Move arm or adjust gripper
00042 #
00043 
00044 byte MOVE_ARM=0
00045 byte MOVE_GRIPPER=1
00046 
00047 byte type                   # move the arm or the gripper?
00048 
00049 geometry_msgs/Pose goal     # goal for arm
00050 float64 command    # width to open gripper
00051 
00052 duration move_time
00053 
00054 ================================================================================
00055 MSG: geometry_msgs/Pose
00056 # A representation of pose in free space, composed of postion and orientation. 
00057 Point position
00058 Quaternion orientation
00059 
00060 ================================================================================
00061 MSG: geometry_msgs/Point
00062 # This contains the position of a point in free space
00063 float64 x
00064 float64 y
00065 float64 z
00066 
00067 ================================================================================
00068 MSG: geometry_msgs/Quaternion
00069 # This represents an orientation in free space in quaternion form.
00070 
00071 float64 x
00072 float64 y
00073 float64 z
00074 float64 w
00075 
00076 """
00077   __slots__ = ['header','motions']
00078   _slot_types = ['std_msgs/Header','simple_arm_server/ArmAction[]']
00079 
00080   def __init__(self, *args, **kwds):
00081     """
00082     Constructor. Any message fields that are implicitly/explicitly
00083     set to None will be assigned a default value. The recommend
00084     use is keyword arguments as this is more robust to future message
00085     changes.  You cannot mix in-order arguments and keyword arguments.
00086 
00087     The available fields are:
00088        header,motions
00089 
00090     :param args: complete set of field values, in .msg order
00091     :param kwds: use keyword arguments corresponding to message field names
00092     to set specific fields.
00093     """
00094     if args or kwds:
00095       super(MoveArmGoal, self).__init__(*args, **kwds)
00096       #message fields cannot be None, assign default values for those that are
00097       if self.header is None:
00098         self.header = std_msgs.msg.Header()
00099       if self.motions is None:
00100         self.motions = []
00101     else:
00102       self.header = std_msgs.msg.Header()
00103       self.motions = []
00104 
00105   def _get_types(self):
00106     """
00107     internal API method
00108     """
00109     return self._slot_types
00110 
00111   def serialize(self, buff):
00112     """
00113     serialize message into buffer
00114     :param buff: buffer, ``StringIO``
00115     """
00116     try:
00117       _x = self
00118       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00119       _x = self.header.frame_id
00120       length = len(_x)
00121       if python3 or type(_x) == unicode:
00122         _x = _x.encode('utf-8')
00123         length = len(_x)
00124       buff.write(struct.pack('<I%ss'%length, length, _x))
00125       length = len(self.motions)
00126       buff.write(_struct_I.pack(length))
00127       for val1 in self.motions:
00128         buff.write(_struct_b.pack(val1.type))
00129         _v1 = val1.goal
00130         _v2 = _v1.position
00131         _x = _v2
00132         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00133         _v3 = _v1.orientation
00134         _x = _v3
00135         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00136         buff.write(_struct_d.pack(val1.command))
00137         _v4 = val1.move_time
00138         _x = _v4
00139         buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00140     except struct.error as se: self._check_types(se)
00141     except TypeError as 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, ``str``
00147     """
00148     try:
00149       if self.header is None:
00150         self.header = std_msgs.msg.Header()
00151       if self.motions is None:
00152         self.motions = None
00153       end = 0
00154       _x = self
00155       start = end
00156       end += 12
00157       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00158       start = end
00159       end += 4
00160       (length,) = _struct_I.unpack(str[start:end])
00161       start = end
00162       end += length
00163       if python3:
00164         self.header.frame_id = str[start:end].decode('utf-8')
00165       else:
00166         self.header.frame_id = str[start:end]
00167       start = end
00168       end += 4
00169       (length,) = _struct_I.unpack(str[start:end])
00170       self.motions = []
00171       for i in range(0, length):
00172         val1 = simple_arm_server.msg.ArmAction()
00173         start = end
00174         end += 1
00175         (val1.type,) = _struct_b.unpack(str[start:end])
00176         _v5 = val1.goal
00177         _v6 = _v5.position
00178         _x = _v6
00179         start = end
00180         end += 24
00181         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00182         _v7 = _v5.orientation
00183         _x = _v7
00184         start = end
00185         end += 32
00186         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00187         start = end
00188         end += 8
00189         (val1.command,) = _struct_d.unpack(str[start:end])
00190         _v8 = val1.move_time
00191         _x = _v8
00192         start = end
00193         end += 8
00194         (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00195         self.motions.append(val1)
00196       return self
00197     except struct.error as e:
00198       raise genpy.DeserializationError(e) #most likely buffer underfill
00199 
00200 
00201   def serialize_numpy(self, buff, numpy):
00202     """
00203     serialize message with numpy array types into buffer
00204     :param buff: buffer, ``StringIO``
00205     :param numpy: numpy python module
00206     """
00207     try:
00208       _x = self
00209       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00210       _x = self.header.frame_id
00211       length = len(_x)
00212       if python3 or type(_x) == unicode:
00213         _x = _x.encode('utf-8')
00214         length = len(_x)
00215       buff.write(struct.pack('<I%ss'%length, length, _x))
00216       length = len(self.motions)
00217       buff.write(_struct_I.pack(length))
00218       for val1 in self.motions:
00219         buff.write(_struct_b.pack(val1.type))
00220         _v9 = val1.goal
00221         _v10 = _v9.position
00222         _x = _v10
00223         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00224         _v11 = _v9.orientation
00225         _x = _v11
00226         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00227         buff.write(_struct_d.pack(val1.command))
00228         _v12 = val1.move_time
00229         _x = _v12
00230         buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00231     except struct.error as se: self._check_types(se)
00232     except TypeError as te: self._check_types(te)
00233 
00234   def deserialize_numpy(self, str, numpy):
00235     """
00236     unpack serialized message in str into this message instance using numpy for array types
00237     :param str: byte array of serialized message, ``str``
00238     :param numpy: numpy python module
00239     """
00240     try:
00241       if self.header is None:
00242         self.header = std_msgs.msg.Header()
00243       if self.motions is None:
00244         self.motions = None
00245       end = 0
00246       _x = self
00247       start = end
00248       end += 12
00249       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00250       start = end
00251       end += 4
00252       (length,) = _struct_I.unpack(str[start:end])
00253       start = end
00254       end += length
00255       if python3:
00256         self.header.frame_id = str[start:end].decode('utf-8')
00257       else:
00258         self.header.frame_id = str[start:end]
00259       start = end
00260       end += 4
00261       (length,) = _struct_I.unpack(str[start:end])
00262       self.motions = []
00263       for i in range(0, length):
00264         val1 = simple_arm_server.msg.ArmAction()
00265         start = end
00266         end += 1
00267         (val1.type,) = _struct_b.unpack(str[start:end])
00268         _v13 = val1.goal
00269         _v14 = _v13.position
00270         _x = _v14
00271         start = end
00272         end += 24
00273         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00274         _v15 = _v13.orientation
00275         _x = _v15
00276         start = end
00277         end += 32
00278         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00279         start = end
00280         end += 8
00281         (val1.command,) = _struct_d.unpack(str[start:end])
00282         _v16 = val1.move_time
00283         _x = _v16
00284         start = end
00285         end += 8
00286         (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00287         self.motions.append(val1)
00288       return self
00289     except struct.error as e:
00290       raise genpy.DeserializationError(e) #most likely buffer underfill
00291 
00292 _struct_I = genpy.struct_I
00293 _struct_b = struct.Struct("<b")
00294 _struct_d = struct.Struct("<d")
00295 _struct_3I = struct.Struct("<3I")
00296 _struct_4d = struct.Struct("<4d")
00297 _struct_2i = struct.Struct("<2i")
00298 _struct_3d = struct.Struct("<3d")


simple_arm_server
Author(s): Michael Ferguson
autogenerated on Fri Jan 3 2014 11:58:43