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