Go to the documentation of this file.00001 """autogenerated by genpy from navp_action/nav_actionFeedback.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 std_msgs.msg
00008
00009 class nav_actionFeedback(genpy.Message):
00010 _md5sum = "e3a506f00b86d89645273f384ec10fb9"
00011 _type = "navp_action/nav_actionFeedback"
00012 _has_header = False
00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 #feedback
00015 std_msgs/Float32 speed
00016 std_msgs/Float32 distance
00017
00018
00019 ================================================================================
00020 MSG: std_msgs/Float32
00021 float32 data
00022 """
00023 __slots__ = ['speed','distance']
00024 _slot_types = ['std_msgs/Float32','std_msgs/Float32']
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 speed,distance
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(nav_actionFeedback, self).__init__(*args, **kwds)
00042
00043 if self.speed is None:
00044 self.speed = std_msgs.msg.Float32()
00045 if self.distance is None:
00046 self.distance = std_msgs.msg.Float32()
00047 else:
00048 self.speed = std_msgs.msg.Float32()
00049 self.distance = std_msgs.msg.Float32()
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, ``StringIO``
00061 """
00062 try:
00063 _x = self
00064 buff.write(_struct_2f.pack(_x.speed.data, _x.distance.data))
00065 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00066 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00067
00068 def deserialize(self, str):
00069 """
00070 unpack serialized message in str into this message instance
00071 :param str: byte array of serialized message, ``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 genpy.DeserializationError(e)
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_2f.pack(_x.speed.data, _x.distance.data))
00097 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00098 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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.speed is None:
00108 self.speed = std_msgs.msg.Float32()
00109 if self.distance is None:
00110 self.distance = std_msgs.msg.Float32()
00111 end = 0
00112 _x = self
00113 start = end
00114 end += 8
00115 (_x.speed.data, _x.distance.data,) = _struct_2f.unpack(str[start:end])
00116 return self
00117 except struct.error as e:
00118 raise genpy.DeserializationError(e)
00119
00120 _struct_I = genpy.struct_I
00121 _struct_2f = struct.Struct("<2f")