Module: singleActuatorLTI
Executive Summary
The SingleActuatorLTI module implements a single-input, single-output (SISO) linear time-invariant model by specializing LinearTimeInvariantSystem. It maps scalar actuator messages into the LTI input and publishes the scalar LTI output using SingleActuatorMsgPayload.
Module Description
The inherited LTI dynamics are
with fixed dimensions for this subclass:
input size: \(m=1\)
output size: \(p=1\)
The message mapping is
and the published output is
System matrices \(\mathbf{A},\mathbf{B},\mathbf{C},\mathbf{D}\) are configured through the base class (for example with setA, setB, setC, setD or configureSecondOrder).
Message Interfaces
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
inMsg |
Input scalar actuator command. The |
|
outMsg |
Output scalar actuator command. The |
Module Assumptions and Limitations
The model is strictly SISO (input/output dimensions are always 1).
The state dimension is inherited from the configured base-class matrices.
If no state is configured, output uses direct feedthrough from \(\mathbf{D}\) when available.
-
class SingleActuatorLTI : public LinearTimeInvariantSystem
- #include <singleActuatorLTI.h>
Linear SISO actuator model built on top of LinearTimeInvariantSystem.
This class implements a single-input, single-output LTI system where both the input and output are carried through a SingleActuatorMsgPayload.
The internal dynamics are defined by the A, B, C, D matrices stored in the base class LinearTimeInvariantSystem.
Public Functions
-
SingleActuatorLTI() = default
Default constructor.
The underlying LinearTimeInvariantSystem matrices must be configured (for example, via configureSecondOrder or direct setA/setB/setC/setD calls) before the simulation is run.
-
inline virtual size_t getInputSize() const override
Get the dimension of the input vector.
This model is strictly SISO, so the input dimension is always 1.
- Returns:
Number of inputs (always 1).
-
inline virtual size_t getOutputSize() const override
Get the dimension of the output vector.
This model is strictly SISO, so the output dimension is always 1.
- Returns:
Number of outputs (always 1).
-
virtual Eigen::VectorXd readInput(uint64_t CurrentSimNanos) override
Read the current input vector from the subscribed input message.
This method constructs a 1x1 Eigen::VectorXd whose single element is taken from inMsg().input.
- Parameters:
CurrentSimNanos – Current simulation time in nanoseconds.
- Returns:
Input vector u of size 1.
-
virtual void writeOutput(uint64_t CurrentSimNanos, const Eigen::VectorXd &y) override
Write the current output vector to the output message.
The first element of the output vector y is written to outMsg as the ‘input’ field of SingleActuatorMsgPayload.
- Parameters:
CurrentSimNanos – Current simulation time in nanoseconds.
y – Output vector of size 1.
Public Members
-
Message<SingleActuatorMsgPayload> outMsg
Output message carrying the actuator command.
The ‘input’ field is populated from the first element of the output vector y computed by LinearTimeInvariantSystem.
-
ReadFunctor<SingleActuatorMsgPayload> inMsg
Input message read functor providing the actuator command.
The ‘input’ field of the payload is mapped to the input vector u(0).
-
SingleActuatorLTI() = default