_EulerAnglesStamped.py
Go to the documentation of this file.
00001 """autogenerated by genpy from starmac_msgs/EulerAnglesStamped.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 starmac_msgs.msg
00008 import std_msgs.msg
00009 
00010 class EulerAnglesStamped(genpy.Message):
00011   _md5sum = "08ed1513cf62c3aa9d3f21c206745853"
00012   _type = "starmac_msgs/EulerAnglesStamped"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 EulerAngles angles
00016 ================================================================================
00017 MSG: std_msgs/Header
00018 # Standard metadata for higher-level stamped data types.
00019 # This is generally used to communicate timestamped data 
00020 # in a particular coordinate frame.
00021 # 
00022 # sequence ID: consecutively increasing ID 
00023 uint32 seq
00024 #Two-integer timestamp that is expressed as:
00025 # * stamp.secs: seconds (stamp_secs) since epoch
00026 # * stamp.nsecs: nanoseconds since stamp_secs
00027 # time-handling sugar is provided by the client library
00028 time stamp
00029 #Frame this data is associated with
00030 # 0: no frame
00031 # 1: global frame
00032 string frame_id
00033 
00034 ================================================================================
00035 MSG: starmac_msgs/EulerAngles
00036 string sequence # as per transformations.py, e.g. 'rzyx' for standard yaw-pitch-roll
00037 bool angles_in_degrees # true if ai, aj, ak are in degrees, otherwise they are in radians
00038 # rotations about 1st, 2nd, 3rd axis:
00039 float64 ai
00040 float64 aj
00041 float64 ak
00042 """
00043   __slots__ = ['header','angles']
00044   _slot_types = ['std_msgs/Header','starmac_msgs/EulerAngles']
00045 
00046   def __init__(self, *args, **kwds):
00047     """
00048     Constructor. Any message fields that are implicitly/explicitly
00049     set to None will be assigned a default value. The recommend
00050     use is keyword arguments as this is more robust to future message
00051     changes.  You cannot mix in-order arguments and keyword arguments.
00052 
00053     The available fields are:
00054        header,angles
00055 
00056     :param args: complete set of field values, in .msg order
00057     :param kwds: use keyword arguments corresponding to message field names
00058     to set specific fields.
00059     """
00060     if args or kwds:
00061       super(EulerAnglesStamped, self).__init__(*args, **kwds)
00062       #message fields cannot be None, assign default values for those that are
00063       if self.header is None:
00064         self.header = std_msgs.msg.Header()
00065       if self.angles is None:
00066         self.angles = starmac_msgs.msg.EulerAngles()
00067     else:
00068       self.header = std_msgs.msg.Header()
00069       self.angles = starmac_msgs.msg.EulerAngles()
00070 
00071   def _get_types(self):
00072     """
00073     internal API method
00074     """
00075     return self._slot_types
00076 
00077   def serialize(self, buff):
00078     """
00079     serialize message into buffer
00080     :param buff: buffer, ``StringIO``
00081     """
00082     try:
00083       _x = self
00084       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00085       _x = self.header.frame_id
00086       length = len(_x)
00087       if python3 or type(_x) == unicode:
00088         _x = _x.encode('utf-8')
00089         length = len(_x)
00090       buff.write(struct.pack('<I%ss'%length, length, _x))
00091       _x = self.angles.sequence
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097       _x = self
00098       buff.write(_struct_B3d.pack(_x.angles.angles_in_degrees, _x.angles.ai, _x.angles.aj, _x.angles.ak))
00099     except struct.error as se: self._check_types(se)
00100     except TypeError as te: self._check_types(te)
00101 
00102   def deserialize(self, str):
00103     """
00104     unpack serialized message in str into this message instance
00105     :param str: byte array of serialized message, ``str``
00106     """
00107     try:
00108       if self.header is None:
00109         self.header = std_msgs.msg.Header()
00110       if self.angles is None:
00111         self.angles = starmac_msgs.msg.EulerAngles()
00112       end = 0
00113       _x = self
00114       start = end
00115       end += 12
00116       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00117       start = end
00118       end += 4
00119       (length,) = _struct_I.unpack(str[start:end])
00120       start = end
00121       end += length
00122       if python3:
00123         self.header.frame_id = str[start:end].decode('utf-8')
00124       else:
00125         self.header.frame_id = str[start:end]
00126       start = end
00127       end += 4
00128       (length,) = _struct_I.unpack(str[start:end])
00129       start = end
00130       end += length
00131       if python3:
00132         self.angles.sequence = str[start:end].decode('utf-8')
00133       else:
00134         self.angles.sequence = str[start:end]
00135       _x = self
00136       start = end
00137       end += 25
00138       (_x.angles.angles_in_degrees, _x.angles.ai, _x.angles.aj, _x.angles.ak,) = _struct_B3d.unpack(str[start:end])
00139       self.angles.angles_in_degrees = bool(self.angles.angles_in_degrees)
00140       return self
00141     except struct.error as e:
00142       raise genpy.DeserializationError(e) #most likely buffer underfill
00143 
00144 
00145   def serialize_numpy(self, buff, numpy):
00146     """
00147     serialize message with numpy array types into buffer
00148     :param buff: buffer, ``StringIO``
00149     :param numpy: numpy python module
00150     """
00151     try:
00152       _x = self
00153       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00154       _x = self.header.frame_id
00155       length = len(_x)
00156       if python3 or type(_x) == unicode:
00157         _x = _x.encode('utf-8')
00158         length = len(_x)
00159       buff.write(struct.pack('<I%ss'%length, length, _x))
00160       _x = self.angles.sequence
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       _x = self
00167       buff.write(_struct_B3d.pack(_x.angles.angles_in_degrees, _x.angles.ai, _x.angles.aj, _x.angles.ak))
00168     except struct.error as se: self._check_types(se)
00169     except TypeError as te: self._check_types(te)
00170 
00171   def deserialize_numpy(self, str, numpy):
00172     """
00173     unpack serialized message in str into this message instance using numpy for array types
00174     :param str: byte array of serialized message, ``str``
00175     :param numpy: numpy python module
00176     """
00177     try:
00178       if self.header is None:
00179         self.header = std_msgs.msg.Header()
00180       if self.angles is None:
00181         self.angles = starmac_msgs.msg.EulerAngles()
00182       end = 0
00183       _x = self
00184       start = end
00185       end += 12
00186       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00187       start = end
00188       end += 4
00189       (length,) = _struct_I.unpack(str[start:end])
00190       start = end
00191       end += length
00192       if python3:
00193         self.header.frame_id = str[start:end].decode('utf-8')
00194       else:
00195         self.header.frame_id = str[start:end]
00196       start = end
00197       end += 4
00198       (length,) = _struct_I.unpack(str[start:end])
00199       start = end
00200       end += length
00201       if python3:
00202         self.angles.sequence = str[start:end].decode('utf-8')
00203       else:
00204         self.angles.sequence = str[start:end]
00205       _x = self
00206       start = end
00207       end += 25
00208       (_x.angles.angles_in_degrees, _x.angles.ai, _x.angles.aj, _x.angles.ak,) = _struct_B3d.unpack(str[start:end])
00209       self.angles.angles_in_degrees = bool(self.angles.angles_in_degrees)
00210       return self
00211     except struct.error as e:
00212       raise genpy.DeserializationError(e) #most likely buffer underfill
00213 
00214 _struct_I = genpy.struct_I
00215 _struct_B3d = struct.Struct("<B3d")
00216 _struct_3I = struct.Struct("<3I")


starmac_msgs
Author(s): bouffard
autogenerated on Sun Jan 5 2014 11:37:37