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