00001 """autogenerated by genmsg_py from RobotData.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import joint_qualification_controllers.msg
00006
00007 class RobotData(roslib.message.Message):
00008 _md5sum = "025931e8023fe22bd8228a980121730a"
00009 _type = "joint_qualification_controllers/RobotData"
00010 _has_header = False
00011 _full_text = """float32 test_time
00012 bool timeout
00013 int32 num_joints
00014 int32 num_actuators
00015 JointData[] joint_data
00016 ActuatorData[] actuator_data
00017
00018 ================================================================================
00019 MSG: joint_qualification_controllers/JointData
00020 int16 index
00021 string name
00022 byte is_cal
00023 byte has_safety
00024 string type
00025
00026
00027 ================================================================================
00028 MSG: joint_qualification_controllers/ActuatorData
00029 int16 index
00030 string name
00031 int16 id
00032
00033
00034 """
00035 __slots__ = ['test_time','timeout','num_joints','num_actuators','joint_data','actuator_data']
00036 _slot_types = ['float32','bool','int32','int32','joint_qualification_controllers/JointData[]','joint_qualification_controllers/ActuatorData[]']
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 test_time,timeout,num_joints,num_actuators,joint_data,actuator_data
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(RobotData, self).__init__(*args, **kwds)
00054
00055 if self.test_time is None:
00056 self.test_time = 0.
00057 if self.timeout is None:
00058 self.timeout = False
00059 if self.num_joints is None:
00060 self.num_joints = 0
00061 if self.num_actuators is None:
00062 self.num_actuators = 0
00063 if self.joint_data is None:
00064 self.joint_data = []
00065 if self.actuator_data is None:
00066 self.actuator_data = []
00067 else:
00068 self.test_time = 0.
00069 self.timeout = False
00070 self.num_joints = 0
00071 self.num_actuators = 0
00072 self.joint_data = []
00073 self.actuator_data = []
00074
00075 def _get_types(self):
00076 """
00077 internal API method
00078 """
00079 return self._slot_types
00080
00081 def serialize(self, buff):
00082 """
00083 serialize message into buffer
00084 @param buff: buffer
00085 @type buff: StringIO
00086 """
00087 try:
00088 _x = self
00089 buff.write(_struct_fB2i.pack(_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators))
00090 length = len(self.joint_data)
00091 buff.write(_struct_I.pack(length))
00092 for val1 in self.joint_data:
00093 buff.write(_struct_h.pack(val1.index))
00094 _x = val1.name
00095 length = len(_x)
00096 buff.write(struct.pack('<I%ss'%length, length, _x))
00097 _x = val1
00098 buff.write(_struct_2b.pack(_x.is_cal, _x.has_safety))
00099 _x = val1.type
00100 length = len(_x)
00101 buff.write(struct.pack('<I%ss'%length, length, _x))
00102 length = len(self.actuator_data)
00103 buff.write(_struct_I.pack(length))
00104 for val1 in self.actuator_data:
00105 buff.write(_struct_h.pack(val1.index))
00106 _x = val1.name
00107 length = len(_x)
00108 buff.write(struct.pack('<I%ss'%length, length, _x))
00109 buff.write(_struct_h.pack(val1.id))
00110 except struct.error, se: self._check_types(se)
00111 except TypeError, te: self._check_types(te)
00112
00113 def deserialize(self, str):
00114 """
00115 unpack serialized message in str into this message instance
00116 @param str: byte array of serialized message
00117 @type str: str
00118 """
00119 try:
00120 end = 0
00121 _x = self
00122 start = end
00123 end += 13
00124 (_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators,) = _struct_fB2i.unpack(str[start:end])
00125 self.timeout = bool(self.timeout)
00126 start = end
00127 end += 4
00128 (length,) = _struct_I.unpack(str[start:end])
00129 self.joint_data = []
00130 for i in xrange(0, length):
00131 val1 = joint_qualification_controllers.msg.JointData()
00132 start = end
00133 end += 2
00134 (val1.index,) = _struct_h.unpack(str[start:end])
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 start = end
00139 end += length
00140 val1.name = str[start:end]
00141 _x = val1
00142 start = end
00143 end += 2
00144 (_x.is_cal, _x.has_safety,) = _struct_2b.unpack(str[start:end])
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 val1.type = str[start:end]
00151 self.joint_data.append(val1)
00152 start = end
00153 end += 4
00154 (length,) = _struct_I.unpack(str[start:end])
00155 self.actuator_data = []
00156 for i in xrange(0, length):
00157 val1 = joint_qualification_controllers.msg.ActuatorData()
00158 start = end
00159 end += 2
00160 (val1.index,) = _struct_h.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 val1.name = str[start:end]
00167 start = end
00168 end += 2
00169 (val1.id,) = _struct_h.unpack(str[start:end])
00170 self.actuator_data.append(val1)
00171 return self
00172 except struct.error, e:
00173 raise roslib.message.DeserializationError(e)
00174
00175
00176 def serialize_numpy(self, buff, numpy):
00177 """
00178 serialize message with numpy array types into buffer
00179 @param buff: buffer
00180 @type buff: StringIO
00181 @param numpy: numpy python module
00182 @type numpy module
00183 """
00184 try:
00185 _x = self
00186 buff.write(_struct_fB2i.pack(_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators))
00187 length = len(self.joint_data)
00188 buff.write(_struct_I.pack(length))
00189 for val1 in self.joint_data:
00190 buff.write(_struct_h.pack(val1.index))
00191 _x = val1.name
00192 length = len(_x)
00193 buff.write(struct.pack('<I%ss'%length, length, _x))
00194 _x = val1
00195 buff.write(_struct_2b.pack(_x.is_cal, _x.has_safety))
00196 _x = val1.type
00197 length = len(_x)
00198 buff.write(struct.pack('<I%ss'%length, length, _x))
00199 length = len(self.actuator_data)
00200 buff.write(_struct_I.pack(length))
00201 for val1 in self.actuator_data:
00202 buff.write(_struct_h.pack(val1.index))
00203 _x = val1.name
00204 length = len(_x)
00205 buff.write(struct.pack('<I%ss'%length, length, _x))
00206 buff.write(_struct_h.pack(val1.id))
00207 except struct.error, se: self._check_types(se)
00208 except TypeError, te: self._check_types(te)
00209
00210 def deserialize_numpy(self, str, numpy):
00211 """
00212 unpack serialized message in str into this message instance using numpy for array types
00213 @param str: byte array of serialized message
00214 @type str: str
00215 @param numpy: numpy python module
00216 @type numpy: module
00217 """
00218 try:
00219 end = 0
00220 _x = self
00221 start = end
00222 end += 13
00223 (_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators,) = _struct_fB2i.unpack(str[start:end])
00224 self.timeout = bool(self.timeout)
00225 start = end
00226 end += 4
00227 (length,) = _struct_I.unpack(str[start:end])
00228 self.joint_data = []
00229 for i in xrange(0, length):
00230 val1 = joint_qualification_controllers.msg.JointData()
00231 start = end
00232 end += 2
00233 (val1.index,) = _struct_h.unpack(str[start:end])
00234 start = end
00235 end += 4
00236 (length,) = _struct_I.unpack(str[start:end])
00237 start = end
00238 end += length
00239 val1.name = str[start:end]
00240 _x = val1
00241 start = end
00242 end += 2
00243 (_x.is_cal, _x.has_safety,) = _struct_2b.unpack(str[start:end])
00244 start = end
00245 end += 4
00246 (length,) = _struct_I.unpack(str[start:end])
00247 start = end
00248 end += length
00249 val1.type = str[start:end]
00250 self.joint_data.append(val1)
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 self.actuator_data = []
00255 for i in xrange(0, length):
00256 val1 = joint_qualification_controllers.msg.ActuatorData()
00257 start = end
00258 end += 2
00259 (val1.index,) = _struct_h.unpack(str[start:end])
00260 start = end
00261 end += 4
00262 (length,) = _struct_I.unpack(str[start:end])
00263 start = end
00264 end += length
00265 val1.name = str[start:end]
00266 start = end
00267 end += 2
00268 (val1.id,) = _struct_h.unpack(str[start:end])
00269 self.actuator_data.append(val1)
00270 return self
00271 except struct.error, e:
00272 raise roslib.message.DeserializationError(e)
00273
00274 _struct_I = roslib.message.struct_I
00275 _struct_h = struct.Struct("<h")
00276 _struct_fB2i = struct.Struct("<fB2i")
00277 _struct_2b = struct.Struct("<2b")