_JointAnglesWithSpeedActionGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nao_msgs/JointAnglesWithSpeedActionGoal.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 nao_msgs.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011 
00012 class JointAnglesWithSpeedActionGoal(genpy.Message):
00013   _md5sum = "9b722e9749aa53fc0e8ca7aa12e95efb"
00014   _type = "nao_msgs/JointAnglesWithSpeedActionGoal"
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 
00018 Header header
00019 actionlib_msgs/GoalID goal_id
00020 JointAnglesWithSpeedGoal goal
00021 
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data 
00026 # in a particular coordinate frame.
00027 # 
00028 # sequence ID: consecutively increasing ID 
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039 
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalID
00042 # The stamp should store the time at which this goal was requested.
00043 # It is used by an action server when it tries to preempt all
00044 # goals that were requested before a certain time
00045 time stamp
00046 
00047 # The id provides a way to associate feedback and
00048 # result message with specific goal requests. The id
00049 # specified must be unique.
00050 string id
00051 
00052 
00053 ================================================================================
00054 MSG: nao_msgs/JointAnglesWithSpeedGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 # goal: a registered body pose name
00057 nao_msgs/JointAnglesWithSpeed joint_angles
00058 
00059 ================================================================================
00060 MSG: nao_msgs/JointAnglesWithSpeed
00061 Header header
00062 
00063 # A list of joint names, corresponding to their names in the Nao docs.
00064 # This must be either the same lenght of joint_angles or 1 if it's a
00065 # keyword such as 'Body' (for all angles)
00066 string[] joint_names
00067 float32[] joint_angles
00068 
00069 #fraction of max joint velocity [0:1]
00070 float32 speed
00071 
00072 # Absolute angle(=0, default) or relative change
00073 uint8 relative
00074 
00075 """
00076   __slots__ = ['header','goal_id','goal']
00077   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','nao_msgs/JointAnglesWithSpeedGoal']
00078 
00079   def __init__(self, *args, **kwds):
00080     """
00081     Constructor. Any message fields that are implicitly/explicitly
00082     set to None will be assigned a default value. The recommend
00083     use is keyword arguments as this is more robust to future message
00084     changes.  You cannot mix in-order arguments and keyword arguments.
00085 
00086     The available fields are:
00087        header,goal_id,goal
00088 
00089     :param args: complete set of field values, in .msg order
00090     :param kwds: use keyword arguments corresponding to message field names
00091     to set specific fields.
00092     """
00093     if args or kwds:
00094       super(JointAnglesWithSpeedActionGoal, self).__init__(*args, **kwds)
00095       #message fields cannot be None, assign default values for those that are
00096       if self.header is None:
00097         self.header = std_msgs.msg.Header()
00098       if self.goal_id is None:
00099         self.goal_id = actionlib_msgs.msg.GoalID()
00100       if self.goal is None:
00101         self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal()
00102     else:
00103       self.header = std_msgs.msg.Header()
00104       self.goal_id = actionlib_msgs.msg.GoalID()
00105       self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal()
00106 
00107   def _get_types(self):
00108     """
00109     internal API method
00110     """
00111     return self._slot_types
00112 
00113   def serialize(self, buff):
00114     """
00115     serialize message into buffer
00116     :param buff: buffer, ``StringIO``
00117     """
00118     try:
00119       _x = self
00120       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00121       _x = self.header.frame_id
00122       length = len(_x)
00123       if python3 or type(_x) == unicode:
00124         _x = _x.encode('utf-8')
00125         length = len(_x)
00126       buff.write(struct.pack('<I%ss'%length, length, _x))
00127       _x = self
00128       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00129       _x = self.goal_id.id
00130       length = len(_x)
00131       if python3 or type(_x) == unicode:
00132         _x = _x.encode('utf-8')
00133         length = len(_x)
00134       buff.write(struct.pack('<I%ss'%length, length, _x))
00135       _x = self
00136       buff.write(_struct_3I.pack(_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs))
00137       _x = self.goal.joint_angles.header.frame_id
00138       length = len(_x)
00139       if python3 or type(_x) == unicode:
00140         _x = _x.encode('utf-8')
00141         length = len(_x)
00142       buff.write(struct.pack('<I%ss'%length, length, _x))
00143       length = len(self.goal.joint_angles.joint_names)
00144       buff.write(_struct_I.pack(length))
00145       for val1 in self.goal.joint_angles.joint_names:
00146         length = len(val1)
00147         if python3 or type(val1) == unicode:
00148           val1 = val1.encode('utf-8')
00149           length = len(val1)
00150         buff.write(struct.pack('<I%ss'%length, length, val1))
00151       length = len(self.goal.joint_angles.joint_angles)
00152       buff.write(_struct_I.pack(length))
00153       pattern = '<%sf'%length
00154       buff.write(struct.pack(pattern, *self.goal.joint_angles.joint_angles))
00155       _x = self
00156       buff.write(_struct_fB.pack(_x.goal.joint_angles.speed, _x.goal.joint_angles.relative))
00157     except struct.error as se: self._check_types(se)
00158     except TypeError as te: self._check_types(te)
00159 
00160   def deserialize(self, str):
00161     """
00162     unpack serialized message in str into this message instance
00163     :param str: byte array of serialized message, ``str``
00164     """
00165     try:
00166       if self.header is None:
00167         self.header = std_msgs.msg.Header()
00168       if self.goal_id is None:
00169         self.goal_id = actionlib_msgs.msg.GoalID()
00170       if self.goal is None:
00171         self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal()
00172       end = 0
00173       _x = self
00174       start = end
00175       end += 12
00176       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00177       start = end
00178       end += 4
00179       (length,) = _struct_I.unpack(str[start:end])
00180       start = end
00181       end += length
00182       if python3:
00183         self.header.frame_id = str[start:end].decode('utf-8')
00184       else:
00185         self.header.frame_id = str[start:end]
00186       _x = self
00187       start = end
00188       end += 8
00189       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00190       start = end
00191       end += 4
00192       (length,) = _struct_I.unpack(str[start:end])
00193       start = end
00194       end += length
00195       if python3:
00196         self.goal_id.id = str[start:end].decode('utf-8')
00197       else:
00198         self.goal_id.id = str[start:end]
00199       _x = self
00200       start = end
00201       end += 12
00202       (_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00203       start = end
00204       end += 4
00205       (length,) = _struct_I.unpack(str[start:end])
00206       start = end
00207       end += length
00208       if python3:
00209         self.goal.joint_angles.header.frame_id = str[start:end].decode('utf-8')
00210       else:
00211         self.goal.joint_angles.header.frame_id = str[start:end]
00212       start = end
00213       end += 4
00214       (length,) = _struct_I.unpack(str[start:end])
00215       self.goal.joint_angles.joint_names = []
00216       for i in range(0, length):
00217         start = end
00218         end += 4
00219         (length,) = _struct_I.unpack(str[start:end])
00220         start = end
00221         end += length
00222         if python3:
00223           val1 = str[start:end].decode('utf-8')
00224         else:
00225           val1 = str[start:end]
00226         self.goal.joint_angles.joint_names.append(val1)
00227       start = end
00228       end += 4
00229       (length,) = _struct_I.unpack(str[start:end])
00230       pattern = '<%sf'%length
00231       start = end
00232       end += struct.calcsize(pattern)
00233       self.goal.joint_angles.joint_angles = struct.unpack(pattern, str[start:end])
00234       _x = self
00235       start = end
00236       end += 5
00237       (_x.goal.joint_angles.speed, _x.goal.joint_angles.relative,) = _struct_fB.unpack(str[start:end])
00238       return self
00239     except struct.error as e:
00240       raise genpy.DeserializationError(e) #most likely buffer underfill
00241 
00242 
00243   def serialize_numpy(self, buff, numpy):
00244     """
00245     serialize message with numpy array types into buffer
00246     :param buff: buffer, ``StringIO``
00247     :param numpy: numpy python module
00248     """
00249     try:
00250       _x = self
00251       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00252       _x = self.header.frame_id
00253       length = len(_x)
00254       if python3 or type(_x) == unicode:
00255         _x = _x.encode('utf-8')
00256         length = len(_x)
00257       buff.write(struct.pack('<I%ss'%length, length, _x))
00258       _x = self
00259       buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00260       _x = self.goal_id.id
00261       length = len(_x)
00262       if python3 or type(_x) == unicode:
00263         _x = _x.encode('utf-8')
00264         length = len(_x)
00265       buff.write(struct.pack('<I%ss'%length, length, _x))
00266       _x = self
00267       buff.write(_struct_3I.pack(_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs))
00268       _x = self.goal.joint_angles.header.frame_id
00269       length = len(_x)
00270       if python3 or type(_x) == unicode:
00271         _x = _x.encode('utf-8')
00272         length = len(_x)
00273       buff.write(struct.pack('<I%ss'%length, length, _x))
00274       length = len(self.goal.joint_angles.joint_names)
00275       buff.write(_struct_I.pack(length))
00276       for val1 in self.goal.joint_angles.joint_names:
00277         length = len(val1)
00278         if python3 or type(val1) == unicode:
00279           val1 = val1.encode('utf-8')
00280           length = len(val1)
00281         buff.write(struct.pack('<I%ss'%length, length, val1))
00282       length = len(self.goal.joint_angles.joint_angles)
00283       buff.write(_struct_I.pack(length))
00284       pattern = '<%sf'%length
00285       buff.write(self.goal.joint_angles.joint_angles.tostring())
00286       _x = self
00287       buff.write(_struct_fB.pack(_x.goal.joint_angles.speed, _x.goal.joint_angles.relative))
00288     except struct.error as se: self._check_types(se)
00289     except TypeError as te: self._check_types(te)
00290 
00291   def deserialize_numpy(self, str, numpy):
00292     """
00293     unpack serialized message in str into this message instance using numpy for array types
00294     :param str: byte array of serialized message, ``str``
00295     :param numpy: numpy python module
00296     """
00297     try:
00298       if self.header is None:
00299         self.header = std_msgs.msg.Header()
00300       if self.goal_id is None:
00301         self.goal_id = actionlib_msgs.msg.GoalID()
00302       if self.goal is None:
00303         self.goal = nao_msgs.msg.JointAnglesWithSpeedGoal()
00304       end = 0
00305       _x = self
00306       start = end
00307       end += 12
00308       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00309       start = end
00310       end += 4
00311       (length,) = _struct_I.unpack(str[start:end])
00312       start = end
00313       end += length
00314       if python3:
00315         self.header.frame_id = str[start:end].decode('utf-8')
00316       else:
00317         self.header.frame_id = str[start:end]
00318       _x = self
00319       start = end
00320       end += 8
00321       (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00322       start = end
00323       end += 4
00324       (length,) = _struct_I.unpack(str[start:end])
00325       start = end
00326       end += length
00327       if python3:
00328         self.goal_id.id = str[start:end].decode('utf-8')
00329       else:
00330         self.goal_id.id = str[start:end]
00331       _x = self
00332       start = end
00333       end += 12
00334       (_x.goal.joint_angles.header.seq, _x.goal.joint_angles.header.stamp.secs, _x.goal.joint_angles.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00335       start = end
00336       end += 4
00337       (length,) = _struct_I.unpack(str[start:end])
00338       start = end
00339       end += length
00340       if python3:
00341         self.goal.joint_angles.header.frame_id = str[start:end].decode('utf-8')
00342       else:
00343         self.goal.joint_angles.header.frame_id = str[start:end]
00344       start = end
00345       end += 4
00346       (length,) = _struct_I.unpack(str[start:end])
00347       self.goal.joint_angles.joint_names = []
00348       for i in range(0, length):
00349         start = end
00350         end += 4
00351         (length,) = _struct_I.unpack(str[start:end])
00352         start = end
00353         end += length
00354         if python3:
00355           val1 = str[start:end].decode('utf-8')
00356         else:
00357           val1 = str[start:end]
00358         self.goal.joint_angles.joint_names.append(val1)
00359       start = end
00360       end += 4
00361       (length,) = _struct_I.unpack(str[start:end])
00362       pattern = '<%sf'%length
00363       start = end
00364       end += struct.calcsize(pattern)
00365       self.goal.joint_angles.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00366       _x = self
00367       start = end
00368       end += 5
00369       (_x.goal.joint_angles.speed, _x.goal.joint_angles.relative,) = _struct_fB.unpack(str[start:end])
00370       return self
00371     except struct.error as e:
00372       raise genpy.DeserializationError(e) #most likely buffer underfill
00373 
00374 _struct_I = genpy.struct_I
00375 _struct_fB = struct.Struct("<fB")
00376 _struct_3I = struct.Struct("<3I")
00377 _struct_2I = struct.Struct("<2I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


nao_msgs
Author(s): Armin Hornung, Stefan Osswald, Daniel Maier
autogenerated on Tue Oct 15 2013 10:05:22