Source code for do_mpc.estimator._ekf
#
# This file is part of do-mpc
#
# do-mpc: An environment for the easy, modular and efficient implementation of
# robust nonlinear model predictive control
#
# Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean
# TU Dortmund. All rights reserved
#
# do-mpc is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# do-mpc is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with do-mpc. If not, see <http://www.gnu.org/licenses/>.
import numpy as np
from ._base import Estimator
[docs]
class EKF(Estimator):
"""Extended Kalman Filter. Setup this class and use :py:func:`EKF.make_step`
during runtime to obtain the currently estimated states given the measurements ``y0``.
Warnings:
Not currently implemented.
"""
def __init__(self, model):
raise Exception('EKF is not currently supported. This is a placeholder.')
super().__init__(model)
# Flags are checked when calling .setup.
self.flags = {
'setup': False,
}
def make_step(self, y0):
"""Main method during runtime. Pass the most recent measurement and
retrieve the estimated state."""
assert self.flags['setup'] == True, 'EKF was not setup yet. Please call EKF.setup().'
None