Class State¶
Defined in File state.h
Inheritance Relationships¶
Base Type¶
public VecX
Derived Types¶
public lupnt::Acceleration(Class Acceleration)public lupnt::AngularVelocity(Class AngularVelocity)public lupnt::Attitude(Class Attitude)public lupnt::AzElRange(Class AzElRange)public lupnt::Cart2(Class Cart2)public lupnt::Cart3(Class Cart3)public lupnt::Cart6(Class Cart6)public lupnt::ClassicalOE(Class ClassicalOE)public lupnt::ClockState2(Class ClockState2)public lupnt::ClockState3(Class ClockState3)public lupnt::DelaunayOE(Class DelaunayOE)public lupnt::EquinoctialOE(Class EquinoctialOE)public lupnt::ImuState(Class ImuState)public lupnt::JointOrbitClockState(Class JointOrbitClockState)public lupnt::LatLonAlt(Class LatLonAlt)public lupnt::ParamState(Class ParamState)public lupnt::QuasiNonsingROE(Class QuasiNonsingROE)public lupnt::QuasiNonsingularOE(Class QuasiNonsingularOE)public lupnt::Quaternion(Class Quaternion)public lupnt::RelCart6(Class RelCart6)public lupnt::RollPitchYaw(Class RollPitchYaw)public lupnt::SingularROE(Class SingularROE)public lupnt::SurfaceState2D(Class SurfaceState2D)
Class Documentation¶
-
class State : public VecX¶
Generic labeled state vector: a
VecXaugmented with a type tag, per-element names/units, and a referenceFrame.This is the common base class for all concrete state representations used throughout LuPNT (e.g.
Cart6,ClassicalOE,ClockState3,AttitudeState). Dynamics models (Dynamics::Propagate,Dynamics::PropagateWithParams), frame conversions (ConvertFrame,ConvertState), filters (Filter,JointState), and measurement models pass and returnStateobjects so that the numerical vector always carries along its type/frame/units metadata for bookkeeping, logging (ToString), and runtime type checks (LUPNT_CHECK(x.GetType() == ...)).Subclassed by lupnt::Acceleration, lupnt::AngularVelocity, lupnt::Attitude, lupnt::AzElRange, lupnt::Cart2, lupnt::Cart3, lupnt::Cart6, lupnt::ClassicalOE, lupnt::ClockState2, lupnt::ClockState3, lupnt::DelaunayOE, lupnt::EquinoctialOE, lupnt::ImuState, lupnt::JointOrbitClockState, lupnt::LatLonAlt, lupnt::ParamState, lupnt::QuasiNonsingROE, lupnt::QuasiNonsingularOE, lupnt::Quaternion, lupnt::RelCart6, lupnt::RollPitchYaw, lupnt::SingularROE, lupnt::SurfaceState2D
Public Functions
-
State()¶
Construct an empty (zero-length) state.
-
State(int n)¶
Construct a zero-initialized state of length
n, with placeholder names/units (see SetNamesAndUnits).- Parameters:
n – Number of elements in the state vector.
-
State(int rows, int cols)¶
Construct a zero-initialized column-vector state with
rowselements;colsmust be 1.- Parameters:
rows – Number of elements (vector length).
cols – Must be 1 (states are always column vectors); checked via LUPNT_CHECK.
-
State(const VecX &vec, const std::vector<std::string> &names, const std::vector<std::string> &units)¶
Construct a state from a raw vector together with explicit per-element
namesandunits.Used e.g. by
Dynamics::Propagate/filter_utilsto wrap a propagated numerical vector back into aStatewhile preserving the original state’s element labels and units.- Parameters:
vec – Underlying numerical values.
names – Per-element variable names (same length as
vec).units – Per-element unit strings (same length as
vec).
-
template<typename T, int N>
State(const State &state, const Vector<T, N> &vec)¶ Construct a state by copying the type/names/units/frame metadata from
statebut using the numerical values fromvec.Used when a derived-state type needs to rebuild itself from a plain Eigen vector (e.g. after an arithmetic operation) while keeping the original state’s labeling.
- Parameters:
state – Source state to copy type/names/units/frame from.
vec – New numerical values (must match
state’s size).
-
State(const State &other)¶
Copy constructor: copies the numerical vector plus type/names/units/frame metadata from
other.
-
template<typename Derived, typename = std::enable_if_t<(Derived::ColsAtCompileTime == 1 || Derived::RowsAtCompileTime == 1)>>
inline State(const Eigen::DenseBase<Derived> &x)¶ Construct a state directly from any Eigen column- or row-vector expression, assigning placeholder names/units via SetNamesAndUnits.
Enables implicit/explicit construction of
State(and derived types) from Eigen vector expressions (e.g.Vec6,head()/tail()slices) throughout the dynamics and conversion code.- Parameters:
x – Eigen vector (or row-vector) expression to copy values from.
-
void SetFrame(Frame frame)¶
Set the reference frame (e.g. Frame::GCRF, Frame::MOON_CI) this state’s coordinates are expressed in. Read by
ConvertFrame/ConvertStateto determine the source frame for a conversion.
-
void SetType(StateType type)¶
Set the state-type tag (e.g.
Cart6::TYPE,ClassicalOE::TYPE), used byLUPNT_CHECK(x.GetType() == ...)runtime checks throughout the dynamics/conversion code to verify aStateholds the expected representation.
-
void SetName(const std::string &name)¶
Set the human-readable name of this state (e.g. for logging).
-
void SetNames(const std::vector<std::string> &names)¶
Set the per-element variable names (e.g. {“r_x”,”r_y”,…}), used by
ToString/formatters and byJointStatewhen concatenating sub-states into a combined labeled vector.
-
void SetUnits(const std::vector<std::string> &units)¶
Set the per-element unit strings (e.g. {“m”,”m”,”m”,”m/s”,…}), used by
ToString/formatters and byJointStatewhen concatenating sub-states into a combined labeled vector.
-
Frame GetFrame() const¶
Get the reference frame this state’s coordinates are expressed in.
- Returns:
Reference frame (e.g. Frame::GCRF, Frame::MOON_CI).
-
StateType GetType() const¶
Get the state-type tag (e.g.
Cart6::TYPE).- Returns:
State type identifier string.
-
std::string GetName() const¶
Get the human-readable name of this state.
-
std::vector<std::string> GetNames() const¶
Get the per-element variable names.
- Returns:
Names, one per element of this state vector.
-
std::vector<std::string> GetUnits() const¶
Get the per-element unit strings.
- Returns:
Units, one per element of this state vector.
-
State &operator=(const State &other)¶
Copy-assign the numerical vector plus type/names/units/frame metadata from
other.
-
template<typename Derived, typename = std::enable_if_t<(Derived::ColsAtCompileTime == 1 || Derived::RowsAtCompileTime == 1)>>
inline State &operator=(const Eigen::DenseBase<Derived> &x)¶ Assign this state’s numerical values from any Eigen column- or row-vector expression, leaving existing type/names/units/frame metadata unchanged.
- Parameters:
x – Eigen vector (or row-vector) expression to copy values from (must match this state’s size).
-
State()¶