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