예제 #1
0
    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()
예제 #2
0
 def publish(self, pub):
     with pub.subsection('estimator') as sub:
         self.estimator.publish(sub)
     DerivAgentRobust.publish(self, pub)
예제 #3
0
 def __init__(self, servo, estimator, **others):
     print('Servo: %r' % servo)
     DerivAgentRobust.__init__(self, **others)
     self.servo = servo
     self.estimator_spec = estimator