00001 """autogenerated by genpy from articulation_msgs/ParamMsg.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class ParamMsg(genpy.Message):
00009 _md5sum = "6b116ef40eb37aa2f03e65c1a95f8bf1"
00010 _type = "articulation_msgs/ParamMsg"
00011 _has_header = False
00012 _full_text = """# Single parameter passed to or from model fitting
00013 #
00014 # This mechanism allows to flexibly pass parameters to
00015 # model fitting (and vice versa). Note that these parameters
00016 # are model-specific: A client may supply additional
00017 # parameters to the model estimator, and, similarly, a estimator
00018 # may add the estimated model parameters to the model message.
00019 # When the model is then evaluated, for example to make predictions
00020 # or to compute the likelihood, the model class can then use
00021 # these parameters.
00022 #
00023 # A parameter has a name, a value, and a type. The type globally
00024 # indicates whether it is a prior parameter (prior to model fitting),
00025 # or a model parameter (found during model fitting, using a maximum-
00026 # likelihood estimator), or a cached evaluation (e.g., the likelihood
00027 # or the BIC are a typical "side"-product of model estimation, and
00028 # can therefore already be cached).
00029 #
00030 # For a list of currently used parameters, see the documentation at
00031 # http://www.ros.org/wiki/articulation_models
00032 #
00033
00034 uint8 PRIOR=0 # indicates a prior model parameter
00035 # (e.g., "sigma_position")
00036 uint8 PARAM=1 # indicates a estimated model parameter
00037 # (e.g., "rot_radius", the estimated radius)
00038 uint8 EVAL=2 # indicates a cached evaluation of the model, given
00039 # the current trajectory
00040 # (e.g., "loglikelihood", the log likelihood of the
00041 # data, given the model and its parameters)
00042
00043 string name # name of the parameter
00044 float64 value # value of the parameter
00045 uint8 type # type of the parameter (PRIOR, PARAM, EVAL)
00046
00047
00048 """
00049
00050 PRIOR = 0
00051 PARAM = 1
00052 EVAL = 2
00053
00054 __slots__ = ['name','value','type']
00055 _slot_types = ['string','float64','uint8']
00056
00057 def __init__(self, *args, **kwds):
00058 """
00059 Constructor. Any message fields that are implicitly/explicitly
00060 set to None will be assigned a default value. The recommend
00061 use is keyword arguments as this is more robust to future message
00062 changes. You cannot mix in-order arguments and keyword arguments.
00063
00064 The available fields are:
00065 name,value,type
00066
00067 :param args: complete set of field values, in .msg order
00068 :param kwds: use keyword arguments corresponding to message field names
00069 to set specific fields.
00070 """
00071 if args or kwds:
00072 super(ParamMsg, self).__init__(*args, **kwds)
00073
00074 if self.name is None:
00075 self.name = ''
00076 if self.value is None:
00077 self.value = 0.
00078 if self.type is None:
00079 self.type = 0
00080 else:
00081 self.name = ''
00082 self.value = 0.
00083 self.type = 0
00084
00085 def _get_types(self):
00086 """
00087 internal API method
00088 """
00089 return self._slot_types
00090
00091 def serialize(self, buff):
00092 """
00093 serialize message into buffer
00094 :param buff: buffer, ``StringIO``
00095 """
00096 try:
00097 _x = self.name
00098 length = len(_x)
00099 if python3 or type(_x) == unicode:
00100 _x = _x.encode('utf-8')
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 _x = self
00104 buff.write(_struct_dB.pack(_x.value, _x.type))
00105 except struct.error as se: self._check_types(se)
00106 except TypeError as te: self._check_types(te)
00107
00108 def deserialize(self, str):
00109 """
00110 unpack serialized message in str into this message instance
00111 :param str: byte array of serialized message, ``str``
00112 """
00113 try:
00114 end = 0
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 if python3:
00121 self.name = str[start:end].decode('utf-8')
00122 else:
00123 self.name = str[start:end]
00124 _x = self
00125 start = end
00126 end += 9
00127 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
00128 return self
00129 except struct.error as e:
00130 raise genpy.DeserializationError(e)
00131
00132
00133 def serialize_numpy(self, buff, numpy):
00134 """
00135 serialize message with numpy array types into buffer
00136 :param buff: buffer, ``StringIO``
00137 :param numpy: numpy python module
00138 """
00139 try:
00140 _x = self.name
00141 length = len(_x)
00142 if python3 or type(_x) == unicode:
00143 _x = _x.encode('utf-8')
00144 length = len(_x)
00145 buff.write(struct.pack('<I%ss'%length, length, _x))
00146 _x = self
00147 buff.write(_struct_dB.pack(_x.value, _x.type))
00148 except struct.error as se: self._check_types(se)
00149 except TypeError as te: self._check_types(te)
00150
00151 def deserialize_numpy(self, str, numpy):
00152 """
00153 unpack serialized message in str into this message instance using numpy for array types
00154 :param str: byte array of serialized message, ``str``
00155 :param numpy: numpy python module
00156 """
00157 try:
00158 end = 0
00159 start = end
00160 end += 4
00161 (length,) = _struct_I.unpack(str[start:end])
00162 start = end
00163 end += length
00164 if python3:
00165 self.name = str[start:end].decode('utf-8')
00166 else:
00167 self.name = str[start:end]
00168 _x = self
00169 start = end
00170 end += 9
00171 (_x.value, _x.type,) = _struct_dB.unpack(str[start:end])
00172 return self
00173 except struct.error as e:
00174 raise genpy.DeserializationError(e)
00175
00176 _struct_I = genpy.struct_I
00177 _struct_dB = struct.Struct("<dB")