$search
00001 """autogenerated by genmsg_py from CartesianTwist.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import brics_actuator.msg 00006 import roslib.rostime 00007 00008 class CartesianTwist(roslib.message.Message): 00009 _md5sum = "e86336d0ca57e442a1f55b8cb29e1a22" 00010 _type = "brics_actuator/CartesianTwist" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """time timeStamp 00013 Poison poisonStamp 00014 string base_frame_uri 00015 string target_frame_uri 00016 # need some more frames? 00017 CartesianVector translation 00018 CartesianVector rotation 00019 00020 ================================================================================ 00021 MSG: brics_actuator/Poison 00022 string originator # node id 00023 string description # encoding still an issue 00024 float32 qos # reliability of the channel 00025 # 0..1 where 1 means healthy 00026 00027 ================================================================================ 00028 MSG: brics_actuator/CartesianVector 00029 string unit 00030 float64 x 00031 float64 y 00032 float64 z 00033 00034 """ 00035 __slots__ = ['timeStamp','poisonStamp','base_frame_uri','target_frame_uri','translation','rotation'] 00036 _slot_types = ['time','brics_actuator/Poison','string','string','brics_actuator/CartesianVector','brics_actuator/CartesianVector'] 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 timeStamp,poisonStamp,base_frame_uri,target_frame_uri,translation,rotation 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(CartesianTwist, self).__init__(*args, **kwds) 00054 #message fields cannot be None, assign default values for those that are 00055 if self.timeStamp is None: 00056 self.timeStamp = roslib.rostime.Time() 00057 if self.poisonStamp is None: 00058 self.poisonStamp = brics_actuator.msg.Poison() 00059 if self.base_frame_uri is None: 00060 self.base_frame_uri = '' 00061 if self.target_frame_uri is None: 00062 self.target_frame_uri = '' 00063 if self.translation is None: 00064 self.translation = brics_actuator.msg.CartesianVector() 00065 if self.rotation is None: 00066 self.rotation = brics_actuator.msg.CartesianVector() 00067 else: 00068 self.timeStamp = roslib.rostime.Time() 00069 self.poisonStamp = brics_actuator.msg.Poison() 00070 self.base_frame_uri = '' 00071 self.target_frame_uri = '' 00072 self.translation = brics_actuator.msg.CartesianVector() 00073 self.rotation = brics_actuator.msg.CartesianVector() 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_2I.pack(_x.timeStamp.secs, _x.timeStamp.nsecs)) 00090 _x = self.poisonStamp.originator 00091 length = len(_x) 00092 buff.write(struct.pack('<I%ss'%length, length, _x)) 00093 _x = self.poisonStamp.description 00094 length = len(_x) 00095 buff.write(struct.pack('<I%ss'%length, length, _x)) 00096 buff.write(_struct_f.pack(self.poisonStamp.qos)) 00097 _x = self.base_frame_uri 00098 length = len(_x) 00099 buff.write(struct.pack('<I%ss'%length, length, _x)) 00100 _x = self.target_frame_uri 00101 length = len(_x) 00102 buff.write(struct.pack('<I%ss'%length, length, _x)) 00103 _x = self.translation.unit 00104 length = len(_x) 00105 buff.write(struct.pack('<I%ss'%length, length, _x)) 00106 _x = self 00107 buff.write(_struct_3d.pack(_x.translation.x, _x.translation.y, _x.translation.z)) 00108 _x = self.rotation.unit 00109 length = len(_x) 00110 buff.write(struct.pack('<I%ss'%length, length, _x)) 00111 _x = self 00112 buff.write(_struct_3d.pack(_x.rotation.x, _x.rotation.y, _x.rotation.z)) 00113 except struct.error as se: self._check_types(se) 00114 except TypeError as te: self._check_types(te) 00115 00116 def deserialize(self, str): 00117 """ 00118 unpack serialized message in str into this message instance 00119 @param str: byte array of serialized message 00120 @type str: str 00121 """ 00122 try: 00123 if self.timeStamp is None: 00124 self.timeStamp = roslib.rostime.Time() 00125 if self.poisonStamp is None: 00126 self.poisonStamp = brics_actuator.msg.Poison() 00127 if self.translation is None: 00128 self.translation = brics_actuator.msg.CartesianVector() 00129 if self.rotation is None: 00130 self.rotation = brics_actuator.msg.CartesianVector() 00131 end = 0 00132 _x = self 00133 start = end 00134 end += 8 00135 (_x.timeStamp.secs, _x.timeStamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 start = end 00140 end += length 00141 self.poisonStamp.originator = str[start:end] 00142 start = end 00143 end += 4 00144 (length,) = _struct_I.unpack(str[start:end]) 00145 start = end 00146 end += length 00147 self.poisonStamp.description = str[start:end] 00148 start = end 00149 end += 4 00150 (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end]) 00151 start = end 00152 end += 4 00153 (length,) = _struct_I.unpack(str[start:end]) 00154 start = end 00155 end += length 00156 self.base_frame_uri = str[start:end] 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 start = end 00161 end += length 00162 self.target_frame_uri = str[start:end] 00163 start = end 00164 end += 4 00165 (length,) = _struct_I.unpack(str[start:end]) 00166 start = end 00167 end += length 00168 self.translation.unit = str[start:end] 00169 _x = self 00170 start = end 00171 end += 24 00172 (_x.translation.x, _x.translation.y, _x.translation.z,) = _struct_3d.unpack(str[start:end]) 00173 start = end 00174 end += 4 00175 (length,) = _struct_I.unpack(str[start:end]) 00176 start = end 00177 end += length 00178 self.rotation.unit = str[start:end] 00179 _x = self 00180 start = end 00181 end += 24 00182 (_x.rotation.x, _x.rotation.y, _x.rotation.z,) = _struct_3d.unpack(str[start:end]) 00183 self.timeStamp.canon() 00184 return self 00185 except struct.error as e: 00186 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00187 00188 00189 def serialize_numpy(self, buff, numpy): 00190 """ 00191 serialize message with numpy array types into buffer 00192 @param buff: buffer 00193 @type buff: StringIO 00194 @param numpy: numpy python module 00195 @type numpy module 00196 """ 00197 try: 00198 _x = self 00199 buff.write(_struct_2I.pack(_x.timeStamp.secs, _x.timeStamp.nsecs)) 00200 _x = self.poisonStamp.originator 00201 length = len(_x) 00202 buff.write(struct.pack('<I%ss'%length, length, _x)) 00203 _x = self.poisonStamp.description 00204 length = len(_x) 00205 buff.write(struct.pack('<I%ss'%length, length, _x)) 00206 buff.write(_struct_f.pack(self.poisonStamp.qos)) 00207 _x = self.base_frame_uri 00208 length = len(_x) 00209 buff.write(struct.pack('<I%ss'%length, length, _x)) 00210 _x = self.target_frame_uri 00211 length = len(_x) 00212 buff.write(struct.pack('<I%ss'%length, length, _x)) 00213 _x = self.translation.unit 00214 length = len(_x) 00215 buff.write(struct.pack('<I%ss'%length, length, _x)) 00216 _x = self 00217 buff.write(_struct_3d.pack(_x.translation.x, _x.translation.y, _x.translation.z)) 00218 _x = self.rotation.unit 00219 length = len(_x) 00220 buff.write(struct.pack('<I%ss'%length, length, _x)) 00221 _x = self 00222 buff.write(_struct_3d.pack(_x.rotation.x, _x.rotation.y, _x.rotation.z)) 00223 except struct.error as se: self._check_types(se) 00224 except TypeError as te: self._check_types(te) 00225 00226 def deserialize_numpy(self, str, numpy): 00227 """ 00228 unpack serialized message in str into this message instance using numpy for array types 00229 @param str: byte array of serialized message 00230 @type str: str 00231 @param numpy: numpy python module 00232 @type numpy: module 00233 """ 00234 try: 00235 if self.timeStamp is None: 00236 self.timeStamp = roslib.rostime.Time() 00237 if self.poisonStamp is None: 00238 self.poisonStamp = brics_actuator.msg.Poison() 00239 if self.translation is None: 00240 self.translation = brics_actuator.msg.CartesianVector() 00241 if self.rotation is None: 00242 self.rotation = brics_actuator.msg.CartesianVector() 00243 end = 0 00244 _x = self 00245 start = end 00246 end += 8 00247 (_x.timeStamp.secs, _x.timeStamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 start = end 00252 end += length 00253 self.poisonStamp.originator = str[start:end] 00254 start = end 00255 end += 4 00256 (length,) = _struct_I.unpack(str[start:end]) 00257 start = end 00258 end += length 00259 self.poisonStamp.description = str[start:end] 00260 start = end 00261 end += 4 00262 (self.poisonStamp.qos,) = _struct_f.unpack(str[start:end]) 00263 start = end 00264 end += 4 00265 (length,) = _struct_I.unpack(str[start:end]) 00266 start = end 00267 end += length 00268 self.base_frame_uri = str[start:end] 00269 start = end 00270 end += 4 00271 (length,) = _struct_I.unpack(str[start:end]) 00272 start = end 00273 end += length 00274 self.target_frame_uri = str[start:end] 00275 start = end 00276 end += 4 00277 (length,) = _struct_I.unpack(str[start:end]) 00278 start = end 00279 end += length 00280 self.translation.unit = str[start:end] 00281 _x = self 00282 start = end 00283 end += 24 00284 (_x.translation.x, _x.translation.y, _x.translation.z,) = _struct_3d.unpack(str[start:end]) 00285 start = end 00286 end += 4 00287 (length,) = _struct_I.unpack(str[start:end]) 00288 start = end 00289 end += length 00290 self.rotation.unit = str[start:end] 00291 _x = self 00292 start = end 00293 end += 24 00294 (_x.rotation.x, _x.rotation.y, _x.rotation.z,) = _struct_3d.unpack(str[start:end]) 00295 self.timeStamp.canon() 00296 return self 00297 except struct.error as e: 00298 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00299 00300 _struct_I = roslib.message.struct_I 00301 _struct_3d = struct.Struct("<3d") 00302 _struct_2I = struct.Struct("<2I") 00303 _struct_f = struct.Struct("<f")