_PoseTrajectory.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/PoseTrajectory.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 nasa_r2_common_msgs.msg
00009 import genpy
00010 import std_msgs.msg
00011 
00012 class PoseTrajectory(genpy.Message):
00013   _md5sum = "635ae07b754d8dde1d1ec77316124e02"
00014   _type = "nasa_r2_common_msgs/PoseTrajectory"
00015   _has_header = True #flag to mark the presence of a Header object
00016   _full_text = """Header header
00017 # length of nodes must match length of poses in each point
00018 string[] nodes
00019 # priorities must have nodes length or be omitted which defaults all to HIGH
00020 PriorityArray[]  node_priorities
00021 # refFrames must either have one item or be nodes length
00022 string[] refFrames
00023 PoseTrajectoryPoint[] points
00024 
00025 
00026 ================================================================================
00027 MSG: std_msgs/Header
00028 # Standard metadata for higher-level stamped data types.
00029 # This is generally used to communicate timestamped data 
00030 # in a particular coordinate frame.
00031 # 
00032 # sequence ID: consecutively increasing ID 
00033 uint32 seq
00034 #Two-integer timestamp that is expressed as:
00035 # * stamp.secs: seconds (stamp_secs) since epoch
00036 # * stamp.nsecs: nanoseconds since stamp_secs
00037 # time-handling sugar is provided by the client library
00038 time stamp
00039 #Frame this data is associated with
00040 # 0: no frame
00041 # 1: global frame
00042 string frame_id
00043 
00044 ================================================================================
00045 MSG: nasa_r2_common_msgs/PriorityArray
00046 # axis_priorities must be 0, 1, or 6 elements
00047 # empty defaults to high, 1 sets all axes equal priority, 6 sets each axis (x, y, z, r, p, y)
00048 uint8[]  axis_priorities
00049 
00050 uint8 IGNORE          = 0   # Exclude from trajectory
00051 uint8 CRITICAL        = 1   # Most important priority in trajectory
00052 uint8 HIGH            = 2   # Second most important priority in trajectory
00053 uint8 MEDIUM          = 3   # Medium prioirty in trajectory
00054 uint8 LOW             = 4   # Low priority in trajectory
00055 uint8 OPT             = 5   # Optimize trajectory (solve for, but do not iterate to achieve)
00056 
00057 #uint8 IGNORE = 0
00058 #uint8 LOW = 1
00059 #uint8 MEDIUM = 128
00060 #uint8 HIGH = 254
00061 #uint8 CRITICAL = 255
00062 
00063 ================================================================================
00064 MSG: nasa_r2_common_msgs/PoseTrajectoryPoint
00065 # currently, position only but could add velocity and acceleration later
00066 geometry_msgs/Pose[] positions
00067 geometry_msgs/Twist[] velocities
00068 geometry_msgs/Twist[] accelerations
00069 duration time_from_start
00070 
00071 ================================================================================
00072 MSG: geometry_msgs/Pose
00073 # A representation of pose in free space, composed of postion and orientation. 
00074 Point position
00075 Quaternion orientation
00076 
00077 ================================================================================
00078 MSG: geometry_msgs/Point
00079 # This contains the position of a point in free space
00080 float64 x
00081 float64 y
00082 float64 z
00083 
00084 ================================================================================
00085 MSG: geometry_msgs/Quaternion
00086 # This represents an orientation in free space in quaternion form.
00087 
00088 float64 x
00089 float64 y
00090 float64 z
00091 float64 w
00092 
00093 ================================================================================
00094 MSG: geometry_msgs/Twist
00095 # This expresses velocity in free space broken into its linear and angular parts.
00096 Vector3  linear
00097 Vector3  angular
00098 
00099 ================================================================================
00100 MSG: geometry_msgs/Vector3
00101 # This represents a vector in free space. 
00102 
00103 float64 x
00104 float64 y
00105 float64 z
00106 """
00107   __slots__ = ['header','nodes','node_priorities','refFrames','points']
00108   _slot_types = ['std_msgs/Header','string[]','nasa_r2_common_msgs/PriorityArray[]','string[]','nasa_r2_common_msgs/PoseTrajectoryPoint[]']
00109 
00110   def __init__(self, *args, **kwds):
00111     """
00112     Constructor. Any message fields that are implicitly/explicitly
00113     set to None will be assigned a default value. The recommend
00114     use is keyword arguments as this is more robust to future message
00115     changes.  You cannot mix in-order arguments and keyword arguments.
00116 
00117     The available fields are:
00118        header,nodes,node_priorities,refFrames,points
00119 
00120     :param args: complete set of field values, in .msg order
00121     :param kwds: use keyword arguments corresponding to message field names
00122     to set specific fields.
00123     """
00124     if args or kwds:
00125       super(PoseTrajectory, self).__init__(*args, **kwds)
00126       #message fields cannot be None, assign default values for those that are
00127       if self.header is None:
00128         self.header = std_msgs.msg.Header()
00129       if self.nodes is None:
00130         self.nodes = []
00131       if self.node_priorities is None:
00132         self.node_priorities = []
00133       if self.refFrames is None:
00134         self.refFrames = []
00135       if self.points is None:
00136         self.points = []
00137     else:
00138       self.header = std_msgs.msg.Header()
00139       self.nodes = []
00140       self.node_priorities = []
00141       self.refFrames = []
00142       self.points = []
00143 
00144   def _get_types(self):
00145     """
00146     internal API method
00147     """
00148     return self._slot_types
00149 
00150   def serialize(self, buff):
00151     """
00152     serialize message into buffer
00153     :param buff: buffer, ``StringIO``
00154     """
00155     try:
00156       _x = self
00157       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00158       _x = self.header.frame_id
00159       length = len(_x)
00160       if python3 or type(_x) == unicode:
00161         _x = _x.encode('utf-8')
00162         length = len(_x)
00163       buff.write(struct.pack('<I%ss'%length, length, _x))
00164       length = len(self.nodes)
00165       buff.write(_struct_I.pack(length))
00166       for val1 in self.nodes:
00167         length = len(val1)
00168         if python3 or type(val1) == unicode:
00169           val1 = val1.encode('utf-8')
00170           length = len(val1)
00171         buff.write(struct.pack('<I%ss'%length, length, val1))
00172       length = len(self.node_priorities)
00173       buff.write(_struct_I.pack(length))
00174       for val1 in self.node_priorities:
00175         _x = val1.axis_priorities
00176         length = len(_x)
00177         # - if encoded as a list instead, serialize as bytes instead of string
00178         if type(_x) in [list, tuple]:
00179           buff.write(struct.pack('<I%sB'%length, length, *_x))
00180         else:
00181           buff.write(struct.pack('<I%ss'%length, length, _x))
00182       length = len(self.refFrames)
00183       buff.write(_struct_I.pack(length))
00184       for val1 in self.refFrames:
00185         length = len(val1)
00186         if python3 or type(val1) == unicode:
00187           val1 = val1.encode('utf-8')
00188           length = len(val1)
00189         buff.write(struct.pack('<I%ss'%length, length, val1))
00190       length = len(self.points)
00191       buff.write(_struct_I.pack(length))
00192       for val1 in self.points:
00193         length = len(val1.positions)
00194         buff.write(_struct_I.pack(length))
00195         for val2 in val1.positions:
00196           _v1 = val2.position
00197           _x = _v1
00198           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00199           _v2 = val2.orientation
00200           _x = _v2
00201           buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00202         length = len(val1.velocities)
00203         buff.write(_struct_I.pack(length))
00204         for val2 in val1.velocities:
00205           _v3 = val2.linear
00206           _x = _v3
00207           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00208           _v4 = val2.angular
00209           _x = _v4
00210           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00211         length = len(val1.accelerations)
00212         buff.write(_struct_I.pack(length))
00213         for val2 in val1.accelerations:
00214           _v5 = val2.linear
00215           _x = _v5
00216           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00217           _v6 = val2.angular
00218           _x = _v6
00219           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00220         _v7 = val1.time_from_start
00221         _x = _v7
00222         buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00223     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00224     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00225 
00226   def deserialize(self, str):
00227     """
00228     unpack serialized message in str into this message instance
00229     :param str: byte array of serialized message, ``str``
00230     """
00231     try:
00232       if self.header is None:
00233         self.header = std_msgs.msg.Header()
00234       if self.node_priorities is None:
00235         self.node_priorities = None
00236       if self.points is None:
00237         self.points = None
00238       end = 0
00239       _x = self
00240       start = end
00241       end += 12
00242       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00243       start = end
00244       end += 4
00245       (length,) = _struct_I.unpack(str[start:end])
00246       start = end
00247       end += length
00248       if python3:
00249         self.header.frame_id = str[start:end].decode('utf-8')
00250       else:
00251         self.header.frame_id = str[start:end]
00252       start = end
00253       end += 4
00254       (length,) = _struct_I.unpack(str[start:end])
00255       self.nodes = []
00256       for i in range(0, length):
00257         start = end
00258         end += 4
00259         (length,) = _struct_I.unpack(str[start:end])
00260         start = end
00261         end += length
00262         if python3:
00263           val1 = str[start:end].decode('utf-8')
00264         else:
00265           val1 = str[start:end]
00266         self.nodes.append(val1)
00267       start = end
00268       end += 4
00269       (length,) = _struct_I.unpack(str[start:end])
00270       self.node_priorities = []
00271       for i in range(0, length):
00272         val1 = nasa_r2_common_msgs.msg.PriorityArray()
00273         start = end
00274         end += 4
00275         (length,) = _struct_I.unpack(str[start:end])
00276         start = end
00277         end += length
00278         val1.axis_priorities = str[start:end]
00279         self.node_priorities.append(val1)
00280       start = end
00281       end += 4
00282       (length,) = _struct_I.unpack(str[start:end])
00283       self.refFrames = []
00284       for i in range(0, length):
00285         start = end
00286         end += 4
00287         (length,) = _struct_I.unpack(str[start:end])
00288         start = end
00289         end += length
00290         if python3:
00291           val1 = str[start:end].decode('utf-8')
00292         else:
00293           val1 = str[start:end]
00294         self.refFrames.append(val1)
00295       start = end
00296       end += 4
00297       (length,) = _struct_I.unpack(str[start:end])
00298       self.points = []
00299       for i in range(0, length):
00300         val1 = nasa_r2_common_msgs.msg.PoseTrajectoryPoint()
00301         start = end
00302         end += 4
00303         (length,) = _struct_I.unpack(str[start:end])
00304         val1.positions = []
00305         for i in range(0, length):
00306           val2 = geometry_msgs.msg.Pose()
00307           _v8 = val2.position
00308           _x = _v8
00309           start = end
00310           end += 24
00311           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00312           _v9 = val2.orientation
00313           _x = _v9
00314           start = end
00315           end += 32
00316           (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00317           val1.positions.append(val2)
00318         start = end
00319         end += 4
00320         (length,) = _struct_I.unpack(str[start:end])
00321         val1.velocities = []
00322         for i in range(0, length):
00323           val2 = geometry_msgs.msg.Twist()
00324           _v10 = val2.linear
00325           _x = _v10
00326           start = end
00327           end += 24
00328           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00329           _v11 = val2.angular
00330           _x = _v11
00331           start = end
00332           end += 24
00333           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00334           val1.velocities.append(val2)
00335         start = end
00336         end += 4
00337         (length,) = _struct_I.unpack(str[start:end])
00338         val1.accelerations = []
00339         for i in range(0, length):
00340           val2 = geometry_msgs.msg.Twist()
00341           _v12 = val2.linear
00342           _x = _v12
00343           start = end
00344           end += 24
00345           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00346           _v13 = val2.angular
00347           _x = _v13
00348           start = end
00349           end += 24
00350           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00351           val1.accelerations.append(val2)
00352         _v14 = val1.time_from_start
00353         _x = _v14
00354         start = end
00355         end += 8
00356         (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00357         self.points.append(val1)
00358       return self
00359     except struct.error as e:
00360       raise genpy.DeserializationError(e) #most likely buffer underfill
00361 
00362 
00363   def serialize_numpy(self, buff, numpy):
00364     """
00365     serialize message with numpy array types into buffer
00366     :param buff: buffer, ``StringIO``
00367     :param numpy: numpy python module
00368     """
00369     try:
00370       _x = self
00371       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00372       _x = self.header.frame_id
00373       length = len(_x)
00374       if python3 or type(_x) == unicode:
00375         _x = _x.encode('utf-8')
00376         length = len(_x)
00377       buff.write(struct.pack('<I%ss'%length, length, _x))
00378       length = len(self.nodes)
00379       buff.write(_struct_I.pack(length))
00380       for val1 in self.nodes:
00381         length = len(val1)
00382         if python3 or type(val1) == unicode:
00383           val1 = val1.encode('utf-8')
00384           length = len(val1)
00385         buff.write(struct.pack('<I%ss'%length, length, val1))
00386       length = len(self.node_priorities)
00387       buff.write(_struct_I.pack(length))
00388       for val1 in self.node_priorities:
00389         _x = val1.axis_priorities
00390         length = len(_x)
00391         # - if encoded as a list instead, serialize as bytes instead of string
00392         if type(_x) in [list, tuple]:
00393           buff.write(struct.pack('<I%sB'%length, length, *_x))
00394         else:
00395           buff.write(struct.pack('<I%ss'%length, length, _x))
00396       length = len(self.refFrames)
00397       buff.write(_struct_I.pack(length))
00398       for val1 in self.refFrames:
00399         length = len(val1)
00400         if python3 or type(val1) == unicode:
00401           val1 = val1.encode('utf-8')
00402           length = len(val1)
00403         buff.write(struct.pack('<I%ss'%length, length, val1))
00404       length = len(self.points)
00405       buff.write(_struct_I.pack(length))
00406       for val1 in self.points:
00407         length = len(val1.positions)
00408         buff.write(_struct_I.pack(length))
00409         for val2 in val1.positions:
00410           _v15 = val2.position
00411           _x = _v15
00412           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00413           _v16 = val2.orientation
00414           _x = _v16
00415           buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00416         length = len(val1.velocities)
00417         buff.write(_struct_I.pack(length))
00418         for val2 in val1.velocities:
00419           _v17 = val2.linear
00420           _x = _v17
00421           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00422           _v18 = val2.angular
00423           _x = _v18
00424           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00425         length = len(val1.accelerations)
00426         buff.write(_struct_I.pack(length))
00427         for val2 in val1.accelerations:
00428           _v19 = val2.linear
00429           _x = _v19
00430           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00431           _v20 = val2.angular
00432           _x = _v20
00433           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00434         _v21 = val1.time_from_start
00435         _x = _v21
00436         buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00437     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00438     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00439 
00440   def deserialize_numpy(self, str, numpy):
00441     """
00442     unpack serialized message in str into this message instance using numpy for array types
00443     :param str: byte array of serialized message, ``str``
00444     :param numpy: numpy python module
00445     """
00446     try:
00447       if self.header is None:
00448         self.header = std_msgs.msg.Header()
00449       if self.node_priorities is None:
00450         self.node_priorities = None
00451       if self.points is None:
00452         self.points = None
00453       end = 0
00454       _x = self
00455       start = end
00456       end += 12
00457       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00458       start = end
00459       end += 4
00460       (length,) = _struct_I.unpack(str[start:end])
00461       start = end
00462       end += length
00463       if python3:
00464         self.header.frame_id = str[start:end].decode('utf-8')
00465       else:
00466         self.header.frame_id = str[start:end]
00467       start = end
00468       end += 4
00469       (length,) = _struct_I.unpack(str[start:end])
00470       self.nodes = []
00471       for i in range(0, length):
00472         start = end
00473         end += 4
00474         (length,) = _struct_I.unpack(str[start:end])
00475         start = end
00476         end += length
00477         if python3:
00478           val1 = str[start:end].decode('utf-8')
00479         else:
00480           val1 = str[start:end]
00481         self.nodes.append(val1)
00482       start = end
00483       end += 4
00484       (length,) = _struct_I.unpack(str[start:end])
00485       self.node_priorities = []
00486       for i in range(0, length):
00487         val1 = nasa_r2_common_msgs.msg.PriorityArray()
00488         start = end
00489         end += 4
00490         (length,) = _struct_I.unpack(str[start:end])
00491         start = end
00492         end += length
00493         val1.axis_priorities = str[start:end]
00494         self.node_priorities.append(val1)
00495       start = end
00496       end += 4
00497       (length,) = _struct_I.unpack(str[start:end])
00498       self.refFrames = []
00499       for i in range(0, length):
00500         start = end
00501         end += 4
00502         (length,) = _struct_I.unpack(str[start:end])
00503         start = end
00504         end += length
00505         if python3:
00506           val1 = str[start:end].decode('utf-8')
00507         else:
00508           val1 = str[start:end]
00509         self.refFrames.append(val1)
00510       start = end
00511       end += 4
00512       (length,) = _struct_I.unpack(str[start:end])
00513       self.points = []
00514       for i in range(0, length):
00515         val1 = nasa_r2_common_msgs.msg.PoseTrajectoryPoint()
00516         start = end
00517         end += 4
00518         (length,) = _struct_I.unpack(str[start:end])
00519         val1.positions = []
00520         for i in range(0, length):
00521           val2 = geometry_msgs.msg.Pose()
00522           _v22 = val2.position
00523           _x = _v22
00524           start = end
00525           end += 24
00526           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00527           _v23 = val2.orientation
00528           _x = _v23
00529           start = end
00530           end += 32
00531           (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00532           val1.positions.append(val2)
00533         start = end
00534         end += 4
00535         (length,) = _struct_I.unpack(str[start:end])
00536         val1.velocities = []
00537         for i in range(0, length):
00538           val2 = geometry_msgs.msg.Twist()
00539           _v24 = val2.linear
00540           _x = _v24
00541           start = end
00542           end += 24
00543           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00544           _v25 = val2.angular
00545           _x = _v25
00546           start = end
00547           end += 24
00548           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00549           val1.velocities.append(val2)
00550         start = end
00551         end += 4
00552         (length,) = _struct_I.unpack(str[start:end])
00553         val1.accelerations = []
00554         for i in range(0, length):
00555           val2 = geometry_msgs.msg.Twist()
00556           _v26 = val2.linear
00557           _x = _v26
00558           start = end
00559           end += 24
00560           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00561           _v27 = val2.angular
00562           _x = _v27
00563           start = end
00564           end += 24
00565           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00566           val1.accelerations.append(val2)
00567         _v28 = val1.time_from_start
00568         _x = _v28
00569         start = end
00570         end += 8
00571         (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00572         self.points.append(val1)
00573       return self
00574     except struct.error as e:
00575       raise genpy.DeserializationError(e) #most likely buffer underfill
00576 
00577 _struct_I = genpy.struct_I
00578 _struct_2i = struct.Struct("<2i")
00579 _struct_3I = struct.Struct("<3I")
00580 _struct_4d = struct.Struct("<4d")
00581 _struct_3d = struct.Struct("<3d")


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34