def init(self, boot_spec): DerivAgentRobust.init(self, boot_spec) shape = boot_spec.get_observations().shape() if len(shape) != 1: msg = 'This agent only works with 1D signals' raise UnsupportedSpec(msg) self.estimator = instantiate_spec(self.estimator_spec) if not isinstance(self.estimator, BDSEEstimatorInterface): msg = ('Expected a BDSEEstimatorInterface, got %s' % describe_type(self.estimator)) raise ValueError(msg) self.commands_spec = boot_spec.get_commands()
def publish(self, pub): with pub.subsection('estimator') as sub: self.estimator.publish(sub) DerivAgentRobust.publish(self, pub)
def __init__(self, servo, estimator, **others): print('Servo: %r' % servo) DerivAgentRobust.__init__(self, **others) self.servo = servo self.estimator_spec = estimator