00001 """autogenerated by genpy from hrl_haptic_manipulation_in_clutter_msgs/HapticMpcWeights.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 HapticMpcWeights(genpy.Message):
00010 _md5sum = "184ad004377fca7d8eed4bce033b748b"
00011 _type = "hrl_haptic_manipulation_in_clutter_msgs/HapticMpcWeights"
00012 _has_header = True
00013 _full_text = """Header header
00014 float64 position_weight
00015 float64 orient_weight
00016 float64 posture_weight
00017
00018
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data
00023 # in a particular coordinate frame.
00024 #
00025 # sequence ID: consecutively increasing ID
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036
00037 """
00038 __slots__ = ['header','position_weight','orient_weight','posture_weight']
00039 _slot_types = ['std_msgs/Header','float64','float64','float64']
00040
00041 def __init__(self, *args, **kwds):
00042 """
00043 Constructor. Any message fields that are implicitly/explicitly
00044 set to None will be assigned a default value. The recommend
00045 use is keyword arguments as this is more robust to future message
00046 changes. You cannot mix in-order arguments and keyword arguments.
00047
00048 The available fields are:
00049 header,position_weight,orient_weight,posture_weight
00050
00051 :param args: complete set of field values, in .msg order
00052 :param kwds: use keyword arguments corresponding to message field names
00053 to set specific fields.
00054 """
00055 if args or kwds:
00056 super(HapticMpcWeights, self).__init__(*args, **kwds)
00057
00058 if self.header is None:
00059 self.header = std_msgs.msg.Header()
00060 if self.position_weight is None:
00061 self.position_weight = 0.
00062 if self.orient_weight is None:
00063 self.orient_weight = 0.
00064 if self.posture_weight is None:
00065 self.posture_weight = 0.
00066 else:
00067 self.header = std_msgs.msg.Header()
00068 self.position_weight = 0.
00069 self.orient_weight = 0.
00070 self.posture_weight = 0.
00071
00072 def _get_types(self):
00073 """
00074 internal API method
00075 """
00076 return self._slot_types
00077
00078 def serialize(self, buff):
00079 """
00080 serialize message into buffer
00081 :param buff: buffer, ``StringIO``
00082 """
00083 try:
00084 _x = self
00085 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00086 _x = self.header.frame_id
00087 length = len(_x)
00088 if python3 or type(_x) == unicode:
00089 _x = _x.encode('utf-8')
00090 length = len(_x)
00091 buff.write(struct.pack('<I%ss'%length, length, _x))
00092 _x = self
00093 buff.write(_struct_3d.pack(_x.position_weight, _x.orient_weight, _x.posture_weight))
00094 except struct.error as se: self._check_types(se)
00095 except TypeError as te: self._check_types(te)
00096
00097 def deserialize(self, str):
00098 """
00099 unpack serialized message in str into this message instance
00100 :param str: byte array of serialized message, ``str``
00101 """
00102 try:
00103 if self.header is None:
00104 self.header = std_msgs.msg.Header()
00105 end = 0
00106 _x = self
00107 start = end
00108 end += 12
00109 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00110 start = end
00111 end += 4
00112 (length,) = _struct_I.unpack(str[start:end])
00113 start = end
00114 end += length
00115 if python3:
00116 self.header.frame_id = str[start:end].decode('utf-8')
00117 else:
00118 self.header.frame_id = str[start:end]
00119 _x = self
00120 start = end
00121 end += 24
00122 (_x.position_weight, _x.orient_weight, _x.posture_weight,) = _struct_3d.unpack(str[start:end])
00123 return self
00124 except struct.error as e:
00125 raise genpy.DeserializationError(e)
00126
00127
00128 def serialize_numpy(self, buff, numpy):
00129 """
00130 serialize message with numpy array types into buffer
00131 :param buff: buffer, ``StringIO``
00132 :param numpy: numpy python module
00133 """
00134 try:
00135 _x = self
00136 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00137 _x = self.header.frame_id
00138 length = len(_x)
00139 if python3 or type(_x) == unicode:
00140 _x = _x.encode('utf-8')
00141 length = len(_x)
00142 buff.write(struct.pack('<I%ss'%length, length, _x))
00143 _x = self
00144 buff.write(_struct_3d.pack(_x.position_weight, _x.orient_weight, _x.posture_weight))
00145 except struct.error as se: self._check_types(se)
00146 except TypeError as te: self._check_types(te)
00147
00148 def deserialize_numpy(self, str, numpy):
00149 """
00150 unpack serialized message in str into this message instance using numpy for array types
00151 :param str: byte array of serialized message, ``str``
00152 :param numpy: numpy python module
00153 """
00154 try:
00155 if self.header is None:
00156 self.header = std_msgs.msg.Header()
00157 end = 0
00158 _x = self
00159 start = end
00160 end += 12
00161 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00162 start = end
00163 end += 4
00164 (length,) = _struct_I.unpack(str[start:end])
00165 start = end
00166 end += length
00167 if python3:
00168 self.header.frame_id = str[start:end].decode('utf-8')
00169 else:
00170 self.header.frame_id = str[start:end]
00171 _x = self
00172 start = end
00173 end += 24
00174 (_x.position_weight, _x.orient_weight, _x.posture_weight,) = _struct_3d.unpack(str[start:end])
00175 return self
00176 except struct.error as e:
00177 raise genpy.DeserializationError(e)
00178
00179 _struct_I = genpy.struct_I
00180 _struct_3I = struct.Struct("<3I")
00181 _struct_3d = struct.Struct("<3d")