$search
00001 """autogenerated by genmsg_py from JointPositions.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import brics_actuator.msg 00006 import roslib.rostime 00007 00008 class JointPositions(roslib.message.Message): 00009 _md5sum = "2b7638f5c85f5257bef140a00cd0eec3" 00010 _type = "brics_actuator/JointPositions" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """Poison poisonStamp 00013 JointValue[] positions 00014 00015 ================================================================================ 00016 MSG: brics_actuator/Poison 00017 string originator # node id 00018 string description # encoding still an issue 00019 float32 qos # reliability of the channel 00020 # 0..1 where 1 means healthy 00021 00022 ================================================================================ 00023 MSG: brics_actuator/JointValue 00024 time timeStamp #time of the data 00025 string joint_uri 00026 string unit #if empy expects si units, you can use boost::unit 00027 float64 value 00028 00029 """ 00030 __slots__ = ['poisonStamp','positions'] 00031 _slot_types = ['brics_actuator/Poison','brics_actuator/JointValue[]'] 00032 00033 def __init__(self, *args, **kwds): 00034 """ 00035 Constructor. Any message fields that are implicitly/explicitly 00036 set to None will be assigned a default value. The recommend 00037 use is keyword arguments as this is more robust to future message 00038 changes. You cannot mix in-order arguments and keyword arguments. 00039 00040 The available fields are: 00041 poisonStamp,positions 00042 00043 @param args: complete set of field values, in .msg order 00044 @param kwds: use keyword arguments corresponding to message field names 00045 to set specific fields. 00046 """ 00047 if args or kwds: 00048 super(JointPositions, self).__init__(*args, **kwds) 00049 #message fields cannot be None, assign default values for those that are 00050 if self.poisonStamp is None: 00051 self.poisonStamp = brics_actuator.msg.Poison() 00052 if self.positions is None: 00053 self.positions = [] 00054 else: 00055 self.poisonStamp = brics_actuator.msg.Poison() 00056 self.positions = [] 00057 00058 def _get_types(self): 00059 """ 00060 internal API method 00061 """ 00062 return self._slot_types 00063 00064 def serialize(self, buff): 00065 """ 00066 serialize message into buffer 00067 @param buff: buffer 00068 @type buff: StringIO 00069 """ 00070 try: 00071 _x = self.poisonStamp.originator 00072 length = len(_x) 00073 buff.write(struct.pack('<I%ss'%length, length, _x)) 00074 _x = self.poisonStamp.description 00075 length = len(_x) 00076 buff.write(struct.pack('<I%ss'%length, length, _x)) 00077 buff.write(_struct_f.pack(self.poisonStamp.qos)) 00078 length = len(self.positions) 00079 buff.write(_struct_I.pack(length)) 00080 for val1 in self.positions: 00081 _v1 = val1.timeStamp 00082 _x = _v1 00083 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00084 _x = val1.joint_uri 00085 length = len(_x) 00086 buff.write(struct.pack('<I%ss'%length, length, _x)) 00087 _x = val1.unit 00088 length = len(_x) 00089 buff.write(struct.pack('<I%ss'%length, length, _x)) 00090 buff.write(_struct_d.pack(val1.value)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 if self.poisonStamp is None: 00102 self.poisonStamp = brics_actuator.msg.Poison() 00103 end = 0 00104 start = end 00105 end += 4 00106 (length,) = _struct_I.unpack(str[start:end]) 00107 start = end 00108 end += length 00109 self.poisonStamp.originator = str[start:end] 00110 start = end 00111 end += 4 00112 (length,) = _struct_I.unpack(str[start:end]) 00113 start = end 00114 end += length 00115 self.poisonStamp.description = str[start:end] 00116 start = end 00117 end += 4 00118 (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end]) 00119 start = end 00120 end += 4 00121 (length,) = _struct_I.unpack(str[start:end]) 00122 self.positions = [] 00123 for i in range(0, length): 00124 val1 = brics_actuator.msg.JointValue() 00125 _v2 = val1.timeStamp 00126 _x = _v2 00127 start = end 00128 end += 8 00129 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00130 start = end 00131 end += 4 00132 (length,) = _struct_I.unpack(str[start:end]) 00133 start = end 00134 end += length 00135 val1.joint_uri = str[start:end] 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 start = end 00140 end += length 00141 val1.unit = str[start:end] 00142 start = end 00143 end += 8 00144 (val1.value,) = _struct_d.unpack(str[start:end]) 00145 self.positions.append(val1) 00146 return self 00147 except struct.error as e: 00148 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00149 00150 00151 def serialize_numpy(self, buff, numpy): 00152 """ 00153 serialize message with numpy array types into buffer 00154 @param buff: buffer 00155 @type buff: StringIO 00156 @param numpy: numpy python module 00157 @type numpy module 00158 """ 00159 try: 00160 _x = self.poisonStamp.originator 00161 length = len(_x) 00162 buff.write(struct.pack('<I%ss'%length, length, _x)) 00163 _x = self.poisonStamp.description 00164 length = len(_x) 00165 buff.write(struct.pack('<I%ss'%length, length, _x)) 00166 buff.write(_struct_f.pack(self.poisonStamp.qos)) 00167 length = len(self.positions) 00168 buff.write(_struct_I.pack(length)) 00169 for val1 in self.positions: 00170 _v3 = val1.timeStamp 00171 _x = _v3 00172 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00173 _x = val1.joint_uri 00174 length = len(_x) 00175 buff.write(struct.pack('<I%ss'%length, length, _x)) 00176 _x = val1.unit 00177 length = len(_x) 00178 buff.write(struct.pack('<I%ss'%length, length, _x)) 00179 buff.write(_struct_d.pack(val1.value)) 00180 except struct.error as se: self._check_types(se) 00181 except TypeError as te: self._check_types(te) 00182 00183 def deserialize_numpy(self, str, numpy): 00184 """ 00185 unpack serialized message in str into this message instance using numpy for array types 00186 @param str: byte array of serialized message 00187 @type str: str 00188 @param numpy: numpy python module 00189 @type numpy: module 00190 """ 00191 try: 00192 if self.poisonStamp is None: 00193 self.poisonStamp = brics_actuator.msg.Poison() 00194 end = 0 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 start = end 00199 end += length 00200 self.poisonStamp.originator = str[start:end] 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 start = end 00205 end += length 00206 self.poisonStamp.description = str[start:end] 00207 start = end 00208 end += 4 00209 (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end]) 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 self.positions = [] 00214 for i in range(0, length): 00215 val1 = brics_actuator.msg.JointValue() 00216 _v4 = val1.timeStamp 00217 _x = _v4 00218 start = end 00219 end += 8 00220 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00221 start = end 00222 end += 4 00223 (length,) = _struct_I.unpack(str[start:end]) 00224 start = end 00225 end += length 00226 val1.joint_uri = str[start:end] 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 start = end 00231 end += length 00232 val1.unit = str[start:end] 00233 start = end 00234 end += 8 00235 (val1.value,) = _struct_d.unpack(str[start:end]) 00236 self.positions.append(val1) 00237 return self 00238 except struct.error as e: 00239 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00240 00241 _struct_I = roslib.message.struct_I 00242 _struct_d = struct.Struct("<d") 00243 _struct_2I = struct.Struct("<2I") 00244 _struct_f = struct.Struct("<f")