Class StatePredictorWithAccControl

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

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

    StatePredictor runs on a state space model given by

     X_{t+1} = f(X_t, U_t, t)
     
    where X is the state vector, U is the input vector. This actor reads a single record(x, y, vx, vy) from the port "current_state" and an array of vector(acc_x, acc_y) from the port "control_inputs". Output is an array of state(x, y, vx, vy) whose length is "prediction horizon". 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:
    Red (shuhei)
    Pt.ProposedRating:
    Red (shuhei)
    • Field Detail

      • timeHorizon

        public Parameter timeHorizon
        The time-horizon which defines the number of steps of prediction.
      • controlInput

        public TypedIOPort controlInput
        control input for robots.
      • currentState

        public TypedIOPort currentState
        current state of robots.
      • predictedStates

        public TypedIOPort predictedStates
        predicted states of robots.
      • jacobianOfStates

        public TypedIOPort jacobianOfStates
        jacobian of predicted states (dX/dU). this port output array of matrix {dX1/dU, dX2/dU, ..., dXn/dU} where Xn means predicted states of n-Step later and U means control input (matrix [U1, U2, ..., Un]).
    • 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.