Module: dynParamManager
Manager of states for Basilisk dynamical systems. Allows the state- effector models of a dynamic object to create, get, and update states present in the model.
-
class StateVector
- #include <dynParamManager.h>
StateVector represents an ordered collection of StateData, with each state having a unique name.
Public Functions
-
StateVector() = default
Default constructor
-
StateVector(const StateVector &other)
Copy constructor
-
StateVector &operator=(const StateVector&)
Assignment operator
-
void setStates(const StateVector &operand)
Sets the values of the states of this StateVector to a copy the values of the states of the other StateVector.
Note that we assume that both StateVectors have the same states and in the same order !!!
-
void addStates(const StateVector &operand)
Adds the states of the given StateVector to the states of this StateVector.
Note that we assume that both StateVectors have the same states and in the same order !!!
-
void scaleStates(double scaleFactor)
Scales the states of this StateVector by the given factor
-
void propagateStates(double dt)
Scales the states of this StateVector by the given delta time
Public Members
-
std::map<std::string, std::unique_ptr<StateData>> stateMap
All states managed by the StateVector, cached by name.
StateData classes have virtual methods, and this class should be capable of supporting subclasses of StateData. To do so, we need to store StateData objects as pointers. To facilitate memory management, we use unique_ptr.
-
StateVector() = default
-
class DynParamManager
- #include <dynParamManager.h>
A class that manages a set of states and properties.
Public Functions
-
template<typename StateDataType = StateData, std::enable_if_t<std::is_base_of_v<StateData, StateDataType>, bool> = true>
StateDataType *registerState(uint32_t nRow, uint32_t nCol, std::string stateName) Creates and stores a new state to be managed by this class.
The state name should be unique: registering two states with the same name will cause either an error or a warning.
This method may optionally be templated to create StateData of subclasses of StateData.
-
StateData *getStateObject(std::string stateName)
Retrieves the handler to a previously registered StateData.
Calling this method for a state name not previously registered will raise a warning and return a nullptr.
-
Eigen::MatrixXd *createProperty(std::string propName, const Eigen::MatrixXd &propValue)
Creates and stores a new property to be managed by this class.
The property name should be unique: registering two properties with the same name will cause a warning or an error.
-
Eigen::MatrixXd *getPropertyReference(std::string propName)
Retrieves the handler to a previously registered property.
Calling this method for a property name not previously registered will raise an error.
-
void setPropertyValue(const std::string propName, const Eigen::MatrixXd &propValue)
Sets the value for a property.
An error will be raised if no property exists with name or the size of the given matrix is different from the size of the existing property.
-
void updateStateVector(const StateVector &newState)
Sets the values of the states managed by this class to a copy the values of the states of the given StateVector.
Note that we assume that given StateVector have the same states and in the same order as this object !!!
-
void propagateStateVector(double dt)
Propagates the states managed by this class a given delta time.
Public Members
-
std::map<std::string, Eigen::MatrixXd> dynProperties
A map of properties managed by this class.
Properties are matrices of doubles that are defined and updated by modules. They are not integrated at any point, so it is the responsability of the user to update them so that they remain current.
-
StateVector stateContainer
A collection of states managed by this class
-
BSKLogger bskLogger
Logger used by this class
-
template<typename StateDataType = StateData, std::enable_if_t<std::is_base_of_v<StateData, StateDataType>, bool> = true>