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