_SharedWorld.py
Go to the documentation of this file.
00001 """autogenerated by genpy from alica_turtle/SharedWorld.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 turtlesim.msg
00008 
00009 class SharedWorld(genpy.Message):
00010   _md5sum = "c51b9f82d5bf693de203628949b63080"
00011   _type = "alica_turtle/SharedWorld"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """int32 senderID
00014 turtlesim/Pose position
00015 
00016 ================================================================================
00017 MSG: turtlesim/Pose
00018 float32 x
00019 float32 y
00020 float32 theta
00021 
00022 float32 linear_velocity
00023 float32 angular_velocity
00024 """
00025   __slots__ = ['senderID','position']
00026   _slot_types = ['int32','turtlesim/Pose']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        senderID,position
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(SharedWorld, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.senderID is None:
00046         self.senderID = 0
00047       if self.position is None:
00048         self.position = turtlesim.msg.Pose()
00049     else:
00050       self.senderID = 0
00051       self.position = turtlesim.msg.Pose()
00052 
00053   def _get_types(self):
00054     """
00055     internal API method
00056     """
00057     return self._slot_types
00058 
00059   def serialize(self, buff):
00060     """
00061     serialize message into buffer
00062     :param buff: buffer, ``StringIO``
00063     """
00064     try:
00065       _x = self
00066       buff.write(_struct_i5f.pack(_x.senderID, _x.position.x, _x.position.y, _x.position.theta, _x.position.linear_velocity, _x.position.angular_velocity))
00067     except struct.error as se: self._check_types(se)
00068     except TypeError as te: self._check_types(te)
00069 
00070   def deserialize(self, str):
00071     """
00072     unpack serialized message in str into this message instance
00073     :param str: byte array of serialized message, ``str``
00074     """
00075     try:
00076       if self.position is None:
00077         self.position = turtlesim.msg.Pose()
00078       end = 0
00079       _x = self
00080       start = end
00081       end += 24
00082       (_x.senderID, _x.position.x, _x.position.y, _x.position.theta, _x.position.linear_velocity, _x.position.angular_velocity,) = _struct_i5f.unpack(str[start:end])
00083       return self
00084     except struct.error as e:
00085       raise genpy.DeserializationError(e) #most likely buffer underfill
00086 
00087 
00088   def serialize_numpy(self, buff, numpy):
00089     """
00090     serialize message with numpy array types into buffer
00091     :param buff: buffer, ``StringIO``
00092     :param numpy: numpy python module
00093     """
00094     try:
00095       _x = self
00096       buff.write(_struct_i5f.pack(_x.senderID, _x.position.x, _x.position.y, _x.position.theta, _x.position.linear_velocity, _x.position.angular_velocity))
00097     except struct.error as se: self._check_types(se)
00098     except TypeError as te: self._check_types(te)
00099 
00100   def deserialize_numpy(self, str, numpy):
00101     """
00102     unpack serialized message in str into this message instance using numpy for array types
00103     :param str: byte array of serialized message, ``str``
00104     :param numpy: numpy python module
00105     """
00106     try:
00107       if self.position is None:
00108         self.position = turtlesim.msg.Pose()
00109       end = 0
00110       _x = self
00111       start = end
00112       end += 24
00113       (_x.senderID, _x.position.x, _x.position.y, _x.position.theta, _x.position.linear_velocity, _x.position.angular_velocity,) = _struct_i5f.unpack(str[start:end])
00114       return self
00115     except struct.error as e:
00116       raise genpy.DeserializationError(e) #most likely buffer underfill
00117 
00118 _struct_I = genpy.struct_I
00119 _struct_i5f = struct.Struct("<i5f")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends


alica_turtle
Author(s): hendrik
autogenerated on Wed Nov 6 2013 13:55:14