00001 """autogenerated by genpy from simple_arm_server/MoveArmActionGoal.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 actionlib_msgs.msg
00011 import std_msgs.msg
00012
00013 class MoveArmActionGoal(genpy.Message):
00014 _md5sum = "c804e71aefd750c0aebce182acc02bec"
00015 _type = "simple_arm_server/MoveArmActionGoal"
00016 _has_header = True
00017 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00018
00019 Header header
00020 actionlib_msgs/GoalID goal_id
00021 MoveArmGoal 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: simple_arm_server/MoveArmGoal
00056 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00057 std_msgs/Header header
00058 ArmAction[] motions
00059
00060 ================================================================================
00061 MSG: simple_arm_server/ArmAction
00062 #
00063 # Move arm or adjust gripper
00064 #
00065
00066 byte MOVE_ARM=0
00067 byte MOVE_GRIPPER=1
00068
00069 byte type # move the arm or the gripper?
00070
00071 geometry_msgs/Pose goal # goal for arm
00072 float64 command # width to open gripper
00073
00074 duration move_time
00075
00076 ================================================================================
00077 MSG: geometry_msgs/Pose
00078 # A representation of pose in free space, composed of postion and orientation.
00079 Point position
00080 Quaternion orientation
00081
00082 ================================================================================
00083 MSG: geometry_msgs/Point
00084 # This contains the position of a point in free space
00085 float64 x
00086 float64 y
00087 float64 z
00088
00089 ================================================================================
00090 MSG: geometry_msgs/Quaternion
00091 # This represents an orientation in free space in quaternion form.
00092
00093 float64 x
00094 float64 y
00095 float64 z
00096 float64 w
00097
00098 """
00099 __slots__ = ['header','goal_id','goal']
00100 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','simple_arm_server/MoveArmGoal']
00101
00102 def __init__(self, *args, **kwds):
00103 """
00104 Constructor. Any message fields that are implicitly/explicitly
00105 set to None will be assigned a default value. The recommend
00106 use is keyword arguments as this is more robust to future message
00107 changes. You cannot mix in-order arguments and keyword arguments.
00108
00109 The available fields are:
00110 header,goal_id,goal
00111
00112 :param args: complete set of field values, in .msg order
00113 :param kwds: use keyword arguments corresponding to message field names
00114 to set specific fields.
00115 """
00116 if args or kwds:
00117 super(MoveArmActionGoal, self).__init__(*args, **kwds)
00118
00119 if self.header is None:
00120 self.header = std_msgs.msg.Header()
00121 if self.goal_id is None:
00122 self.goal_id = actionlib_msgs.msg.GoalID()
00123 if self.goal is None:
00124 self.goal = simple_arm_server.msg.MoveArmGoal()
00125 else:
00126 self.header = std_msgs.msg.Header()
00127 self.goal_id = actionlib_msgs.msg.GoalID()
00128 self.goal = simple_arm_server.msg.MoveArmGoal()
00129
00130 def _get_types(self):
00131 """
00132 internal API method
00133 """
00134 return self._slot_types
00135
00136 def serialize(self, buff):
00137 """
00138 serialize message into buffer
00139 :param buff: buffer, ``StringIO``
00140 """
00141 try:
00142 _x = self
00143 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00144 _x = self.header.frame_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
00151 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00152 _x = self.goal_id.id
00153 length = len(_x)
00154 if python3 or type(_x) == unicode:
00155 _x = _x.encode('utf-8')
00156 length = len(_x)
00157 buff.write(struct.pack('<I%ss'%length, length, _x))
00158 _x = self
00159 buff.write(_struct_3I.pack(_x.goal.header.seq, _x.goal.header.stamp.secs, _x.goal.header.stamp.nsecs))
00160 _x = self.goal.header.frame_id
00161 length = len(_x)
00162 if python3 or type(_x) == unicode:
00163 _x = _x.encode('utf-8')
00164 length = len(_x)
00165 buff.write(struct.pack('<I%ss'%length, length, _x))
00166 length = len(self.goal.motions)
00167 buff.write(_struct_I.pack(length))
00168 for val1 in self.goal.motions:
00169 buff.write(_struct_b.pack(val1.type))
00170 _v1 = val1.goal
00171 _v2 = _v1.position
00172 _x = _v2
00173 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00174 _v3 = _v1.orientation
00175 _x = _v3
00176 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00177 buff.write(_struct_d.pack(val1.command))
00178 _v4 = val1.move_time
00179 _x = _v4
00180 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00181 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00182 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00183
00184 def deserialize(self, str):
00185 """
00186 unpack serialized message in str into this message instance
00187 :param str: byte array of serialized message, ``str``
00188 """
00189 try:
00190 if self.header is None:
00191 self.header = std_msgs.msg.Header()
00192 if self.goal_id is None:
00193 self.goal_id = actionlib_msgs.msg.GoalID()
00194 if self.goal is None:
00195 self.goal = simple_arm_server.msg.MoveArmGoal()
00196 end = 0
00197 _x = self
00198 start = end
00199 end += 12
00200 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 if python3:
00207 self.header.frame_id = str[start:end].decode('utf-8')
00208 else:
00209 self.header.frame_id = str[start:end]
00210 _x = self
00211 start = end
00212 end += 8
00213 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00214 start = end
00215 end += 4
00216 (length,) = _struct_I.unpack(str[start:end])
00217 start = end
00218 end += length
00219 if python3:
00220 self.goal_id.id = str[start:end].decode('utf-8')
00221 else:
00222 self.goal_id.id = str[start:end]
00223 _x = self
00224 start = end
00225 end += 12
00226 (_x.goal.header.seq, _x.goal.header.stamp.secs, _x.goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00227 start = end
00228 end += 4
00229 (length,) = _struct_I.unpack(str[start:end])
00230 start = end
00231 end += length
00232 if python3:
00233 self.goal.header.frame_id = str[start:end].decode('utf-8')
00234 else:
00235 self.goal.header.frame_id = str[start:end]
00236 start = end
00237 end += 4
00238 (length,) = _struct_I.unpack(str[start:end])
00239 self.goal.motions = []
00240 for i in range(0, length):
00241 val1 = simple_arm_server.msg.ArmAction()
00242 start = end
00243 end += 1
00244 (val1.type,) = _struct_b.unpack(str[start:end])
00245 _v5 = val1.goal
00246 _v6 = _v5.position
00247 _x = _v6
00248 start = end
00249 end += 24
00250 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00251 _v7 = _v5.orientation
00252 _x = _v7
00253 start = end
00254 end += 32
00255 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00256 start = end
00257 end += 8
00258 (val1.command,) = _struct_d.unpack(str[start:end])
00259 _v8 = val1.move_time
00260 _x = _v8
00261 start = end
00262 end += 8
00263 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00264 self.goal.motions.append(val1)
00265 return self
00266 except struct.error as e:
00267 raise genpy.DeserializationError(e)
00268
00269
00270 def serialize_numpy(self, buff, numpy):
00271 """
00272 serialize message with numpy array types into buffer
00273 :param buff: buffer, ``StringIO``
00274 :param numpy: numpy python module
00275 """
00276 try:
00277 _x = self
00278 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00279 _x = self.header.frame_id
00280 length = len(_x)
00281 if python3 or type(_x) == unicode:
00282 _x = _x.encode('utf-8')
00283 length = len(_x)
00284 buff.write(struct.pack('<I%ss'%length, length, _x))
00285 _x = self
00286 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00287 _x = self.goal_id.id
00288 length = len(_x)
00289 if python3 or type(_x) == unicode:
00290 _x = _x.encode('utf-8')
00291 length = len(_x)
00292 buff.write(struct.pack('<I%ss'%length, length, _x))
00293 _x = self
00294 buff.write(_struct_3I.pack(_x.goal.header.seq, _x.goal.header.stamp.secs, _x.goal.header.stamp.nsecs))
00295 _x = self.goal.header.frame_id
00296 length = len(_x)
00297 if python3 or type(_x) == unicode:
00298 _x = _x.encode('utf-8')
00299 length = len(_x)
00300 buff.write(struct.pack('<I%ss'%length, length, _x))
00301 length = len(self.goal.motions)
00302 buff.write(_struct_I.pack(length))
00303 for val1 in self.goal.motions:
00304 buff.write(_struct_b.pack(val1.type))
00305 _v9 = val1.goal
00306 _v10 = _v9.position
00307 _x = _v10
00308 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00309 _v11 = _v9.orientation
00310 _x = _v11
00311 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00312 buff.write(_struct_d.pack(val1.command))
00313 _v12 = val1.move_time
00314 _x = _v12
00315 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00316 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00317 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00318
00319 def deserialize_numpy(self, str, numpy):
00320 """
00321 unpack serialized message in str into this message instance using numpy for array types
00322 :param str: byte array of serialized message, ``str``
00323 :param numpy: numpy python module
00324 """
00325 try:
00326 if self.header is None:
00327 self.header = std_msgs.msg.Header()
00328 if self.goal_id is None:
00329 self.goal_id = actionlib_msgs.msg.GoalID()
00330 if self.goal is None:
00331 self.goal = simple_arm_server.msg.MoveArmGoal()
00332 end = 0
00333 _x = self
00334 start = end
00335 end += 12
00336 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00337 start = end
00338 end += 4
00339 (length,) = _struct_I.unpack(str[start:end])
00340 start = end
00341 end += length
00342 if python3:
00343 self.header.frame_id = str[start:end].decode('utf-8')
00344 else:
00345 self.header.frame_id = str[start:end]
00346 _x = self
00347 start = end
00348 end += 8
00349 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00350 start = end
00351 end += 4
00352 (length,) = _struct_I.unpack(str[start:end])
00353 start = end
00354 end += length
00355 if python3:
00356 self.goal_id.id = str[start:end].decode('utf-8')
00357 else:
00358 self.goal_id.id = str[start:end]
00359 _x = self
00360 start = end
00361 end += 12
00362 (_x.goal.header.seq, _x.goal.header.stamp.secs, _x.goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00363 start = end
00364 end += 4
00365 (length,) = _struct_I.unpack(str[start:end])
00366 start = end
00367 end += length
00368 if python3:
00369 self.goal.header.frame_id = str[start:end].decode('utf-8')
00370 else:
00371 self.goal.header.frame_id = str[start:end]
00372 start = end
00373 end += 4
00374 (length,) = _struct_I.unpack(str[start:end])
00375 self.goal.motions = []
00376 for i in range(0, length):
00377 val1 = simple_arm_server.msg.ArmAction()
00378 start = end
00379 end += 1
00380 (val1.type,) = _struct_b.unpack(str[start:end])
00381 _v13 = val1.goal
00382 _v14 = _v13.position
00383 _x = _v14
00384 start = end
00385 end += 24
00386 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00387 _v15 = _v13.orientation
00388 _x = _v15
00389 start = end
00390 end += 32
00391 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00392 start = end
00393 end += 8
00394 (val1.command,) = _struct_d.unpack(str[start:end])
00395 _v16 = val1.move_time
00396 _x = _v16
00397 start = end
00398 end += 8
00399 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00400 self.goal.motions.append(val1)
00401 return self
00402 except struct.error as e:
00403 raise genpy.DeserializationError(e)
00404
00405 _struct_I = genpy.struct_I
00406 _struct_b = struct.Struct("<b")
00407 _struct_d = struct.Struct("<d")
00408 _struct_2i = struct.Struct("<2i")
00409 _struct_3I = struct.Struct("<3I")
00410 _struct_4d = struct.Struct("<4d")
00411 _struct_2I = struct.Struct("<2I")
00412 _struct_3d = struct.Struct("<3d")