$search
00001 """autogenerated by genmsg_py from nav_actionFeedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class nav_actionFeedback(roslib.message.Message): 00008 _md5sum = "e3a506f00b86d89645273f384ec10fb9" 00009 _type = "navp_action/nav_actionFeedback" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 #feedback 00013 std_msgs/Float32 speed 00014 std_msgs/Float32 distance 00015 00016 00017 ================================================================================ 00018 MSG: std_msgs/Float32 00019 float32 data 00020 """ 00021 __slots__ = ['speed','distance'] 00022 _slot_types = ['std_msgs/Float32','std_msgs/Float32'] 00023 00024 def __init__(self, *args, **kwds): 00025 """ 00026 Constructor. Any message fields that are implicitly/explicitly 00027 set to None will be assigned a default value. The recommend 00028 use is keyword arguments as this is more robust to future message 00029 changes. You cannot mix in-order arguments and keyword arguments. 00030 00031 The available fields are: 00032 speed,distance 00033 00034 @param args: complete set of field values, in .msg order 00035 @param kwds: use keyword arguments corresponding to message field names 00036 to set specific fields. 00037 """ 00038 if args or kwds: 00039 super(nav_actionFeedback, self).__init__(*args, **kwds) 00040 #message fields cannot be None, assign default values for those that are 00041 if self.speed is None: 00042 self.speed = std_msgs.msg.Float32() 00043 if self.distance is None: 00044 self.distance = std_msgs.msg.Float32() 00045 else: 00046 self.speed = std_msgs.msg.Float32() 00047 self.distance = std_msgs.msg.Float32() 00048 00049 def _get_types(self): 00050 """ 00051 internal API method 00052 """ 00053 return self._slot_types 00054 00055 def serialize(self, buff): 00056 """ 00057 serialize message into buffer 00058 @param buff: buffer 00059 @type buff: StringIO 00060 """ 00061 try: 00062 _x = self 00063 buff.write(_struct_2f.pack(_x.speed.data, _x.distance.data)) 00064 except struct.error as se: self._check_types(se) 00065 except TypeError as te: self._check_types(te) 00066 00067 def deserialize(self, str): 00068 """ 00069 unpack serialized message in str into this message instance 00070 @param str: byte array of serialized message 00071 @type str: str 00072 """ 00073 try: 00074 if self.speed is None: 00075 self.speed = std_msgs.msg.Float32() 00076 if self.distance is None: 00077 self.distance = std_msgs.msg.Float32() 00078 end = 0 00079 _x = self 00080 start = end 00081 end += 8 00082 (_x.speed.data, _x.distance.data,) = _struct_2f.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_2f.pack(_x.speed.data, _x.distance.data)) 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.speed is None: 00112 self.speed = std_msgs.msg.Float32() 00113 if self.distance is None: 00114 self.distance = std_msgs.msg.Float32() 00115 end = 0 00116 _x = self 00117 start = end 00118 end += 8 00119 (_x.speed.data, _x.distance.data,) = _struct_2f.unpack(str[start:end]) 00120 return self 00121 except struct.error as e: 00122 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00123 00124 _struct_I = roslib.message.struct_I 00125 _struct_2f = struct.Struct("<2f")