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