Class CovarianceStatePredictor

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class CovarianceStatePredictor
    extends TypedAtomicActor
    Implementation of StatePredictor witch uses acceleration control input.

    This actor reads a single record(x, y, vx, vy, covariance) from the port current_state and an array of vector(acc_x, acc_y) from the port "control_inputs". Output is an array of states(x, y, vx, vy, covariance) whose length is prediction horizon. Output states are calculated using a state space model given by

     X_{t+1} = f(X_t) = [P_{t+1}; V_{t+1}]
        P_{t+1} = P_t + V_t + 0.5*Acc_t
        V_{t+1} = V_t + Acc_t
     C_{t+1} = A*C_t*AT
     

    where X is the state vector(P: position, V: velocity), Acc is an acceleration input vector, C is the covariance matrix of X, and A is the jacobian of transition function f(X). If the length of control_inputs is shorter than prediction horizon, the last value of cotrol_inputs is used until the step of prediction horizon.

    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Shuhei Emoto
    Pt.AcceptedRating:
    Pt.ProposedRating:
    Red (shuhei)
    • Field Detail

      • controlInput

        public TypedIOPort controlInput
        control input for robots.
      • currentState

        public TypedIOPort currentState
        current state of robots.
      • predictedStates

        public TypedIOPort predictedStates
        predicted states of robots.
      • timeHorizon

        public PortParameter timeHorizon
        The time-horizon which defines the number of steps of prediction.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Description copied from class: NamedObj
        React to a change in an attribute. This method is called by a contained attribute when its value changes. In this base class, the method does nothing. In derived classes, this method may throw an exception, indicating that the new attribute value is invalid. It is up to the caller to restore the attribute to a valid value if an exception is thrown.
        Overrides:
        attributeChanged in class NamedObj
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the change is not acceptable to this container (not thrown in this base class).
      • prefire

        public boolean prefire()
                        throws IllegalActionException
        Description copied from class: AtomicActor
        Return true. Derived classes override this method to define operations to be performed at the beginning of every iteration of its execution, prior the invocation of the fire() method. Derived classes may also use it to check preconditions for an iteration, if there are any.
        Specified by:
        prefire in interface Executable
        Overrides:
        prefire in class AtomicActor<TypedIOPort>
        Returns:
        True if this actor is ready for firing, false otherwise.
        Throws:
        IllegalActionException - Not thrown in this base class.