$search
00001 """autogenerated by genmsg_py from ShapeGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ShapeGoal(roslib.message.Message): 00007 _md5sum = "3b9202ab7292cebe5a95ab2bf6b9c091" 00008 _type = "turtle_actionlib/ShapeGoal" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00011 #goal definition 00012 int32 edges 00013 float32 radius 00014 00015 """ 00016 __slots__ = ['edges','radius'] 00017 _slot_types = ['int32','float32'] 00018 00019 def __init__(self, *args, **kwds): 00020 """ 00021 Constructor. Any message fields that are implicitly/explicitly 00022 set to None will be assigned a default value. The recommend 00023 use is keyword arguments as this is more robust to future message 00024 changes. You cannot mix in-order arguments and keyword arguments. 00025 00026 The available fields are: 00027 edges,radius 00028 00029 @param args: complete set of field values, in .msg order 00030 @param kwds: use keyword arguments corresponding to message field names 00031 to set specific fields. 00032 """ 00033 if args or kwds: 00034 super(ShapeGoal, self).__init__(*args, **kwds) 00035 #message fields cannot be None, assign default values for those that are 00036 if self.edges is None: 00037 self.edges = 0 00038 if self.radius is None: 00039 self.radius = 0. 00040 else: 00041 self.edges = 0 00042 self.radius = 0. 00043 00044 def _get_types(self): 00045 """ 00046 internal API method 00047 """ 00048 return self._slot_types 00049 00050 def serialize(self, buff): 00051 """ 00052 serialize message into buffer 00053 @param buff: buffer 00054 @type buff: StringIO 00055 """ 00056 try: 00057 _x = self 00058 buff.write(_struct_if.pack(_x.edges, _x.radius)) 00059 except struct.error as se: self._check_types(se) 00060 except TypeError as te: self._check_types(te) 00061 00062 def deserialize(self, str): 00063 """ 00064 unpack serialized message in str into this message instance 00065 @param str: byte array of serialized message 00066 @type str: str 00067 """ 00068 try: 00069 end = 0 00070 _x = self 00071 start = end 00072 end += 8 00073 (_x.edges, _x.radius,) = _struct_if.unpack(str[start:end]) 00074 return self 00075 except struct.error as e: 00076 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00077 00078 00079 def serialize_numpy(self, buff, numpy): 00080 """ 00081 serialize message with numpy array types into buffer 00082 @param buff: buffer 00083 @type buff: StringIO 00084 @param numpy: numpy python module 00085 @type numpy module 00086 """ 00087 try: 00088 _x = self 00089 buff.write(_struct_if.pack(_x.edges, _x.radius)) 00090 except struct.error as se: self._check_types(se) 00091 except TypeError as te: self._check_types(te) 00092 00093 def deserialize_numpy(self, str, numpy): 00094 """ 00095 unpack serialized message in str into this message instance using numpy for array types 00096 @param str: byte array of serialized message 00097 @type str: str 00098 @param numpy: numpy python module 00099 @type numpy: module 00100 """ 00101 try: 00102 end = 0 00103 _x = self 00104 start = end 00105 end += 8 00106 (_x.edges, _x.radius,) = _struct_if.unpack(str[start:end]) 00107 return self 00108 except struct.error as e: 00109 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00110 00111 _struct_I = roslib.message.struct_I 00112 _struct_if = struct.Struct("<if")