Class World¶
Defined in File world.h
Inheritance Relationships¶
Base Type¶
public lupnt::Object< World >(Template Class Object)
Class Documentation¶
-
class World : public lupnt::Object<World>¶
Shared, read-only physical environment for a
Simulation.The
Worldowns the pieces of a scenario that are common to every agent and expensive to re-specify per agent: the simulation epoch, the reference frame, and the environment models. Two flavors of environment are supported (either or both may be present in theworld:block):Orbital: a
force_model:block (central bodies, gravity degree/order, third bodies, SRP/relativity, integrator) →MakeDynamics()builds a matchingNBodyDynamics, so truth and estimator share one force model.Surface: a central-body point-mass
Gravity()plus, optionally, adem:terrain block → a loadedLunarDemand its local East-North-Up tangent frame, for surface-navigation scenarios (rover/lander).
The
Worlddeliberately does not propagate agents or own their states: eachAgentWithDynamicsself-propagates via its own dynamics pointer. TheWorldonly provides the environment and a read-only truth facade (GetStateAt) so applications can ask “where is agent X at time t” without reaching throughSimulation::GetAgentand down-casting.Public Functions
-
World() = default¶
-
explicit World(Config &world_config)¶
Build a
Worldfrom aworld:config block.Recognized keys:
frame(reference frame, defaultMOON_CI); an optionalforce_model:sub-block (same schema as anNBodyDynamicsdynamics:block:bodies,integrator,dt,abstol,reltol,max_iter,autodiff, and defaultCR/area/mass); an optionalgravity:block (body: MOON|EARTH|...selecting the point-mass GM forGravity(), default MOON); and an optionaldem:block (site_lat_deg,site_lon_deg,half_width_m,max_res_m) loading a LOLA DEM and its ENU tangent frame. The epoch is taken from the global LuPNT epoch (GetLupntEpoch()), whichSimulationsets from the scenarioepoch:.
-
inline void SetSimulation(Simulation *sim)¶
Register the owning
Simulation(called bySimulation::SetWorld), enabling theGetStateAttruth facade to resolve agents by name.
-
inline const Config &GetForceModel() const¶
The raw force-model config block, for inspection/serialization.
-
inline bool HasForceModel() const¶
Whether a
force_model:block was provided (soMakeDynamicsworks).
-
Ptr<NBodyDynamics> MakeDynamics() const¶
Construct a dynamics model for the shared force model, using the force model’s default SRP spacecraft parameters (if any).
-
Ptr<NBodyDynamics> MakeDynamics(double cr, double area_m2, double mass_kg) const¶
Construct a dynamics model for the shared force model, overriding the SRP spacecraft parameters (radiation-pressure coefficient, area [m^2], mass [kg]) for a specific spacecraft.
-
Ptr<NBodyDynamics> MakeTruthDynamics() const¶
Construct a truth dynamics model for the shared force model with the state-transition matrix disabled (
autodiff = false) — truth propagation needs no STM. This is what a physical agent uses when it inherits the commonworld:force model instead of declaring its owndynamics:block. (The STM-carryingMakeDynamics()is for estimators.)
-
inline const Config &GetPlasma() const¶
The raw
plasma:config block (ionosphere/plasmasphere signal-delay environment), if provided. This is a shared truth-environment property, so it lives underworld:rather than in an individual receiver’s application block; the GNSS ODTS app reads it from here. RequiresHasPlasma().
-
inline bool HasPlasma() const¶
Whether a
plasma:block was provided underworld:.
-
inline double GetGM() const¶
Central-body gravitational parameter GM [m^3/s^2].
-
Vec3d Gravity(const Vec3d &r) const¶
Point-mass central-body gravitational acceleration at position
r(in the world frame) [m/s^2] — used by surface INS mechanization.
-
inline bool HasTerrain() const¶
Whether a
dem:terrain block was provided.
-
inline const LunarDem &GetDem() const¶
The loaded terrain DEM (for plotting/geometry). Requires
HasTerrain().
-
double GetElevation(double east_m, double north_m) const¶
Terrain elevation at a local ENU offset (
east_m,north_m) from the DEM/site center [m]. RequiresHasTerrain().
-
Vec3d EnuToWorld(double east_m, double north_m, double up_m) const¶
Convert a local East-North-Up offset (from the site center) to a position in the world frame [m]. Requires
HasTerrain().
-
inline const Mat3d &REnuToWorld() const¶
Rotation from the local ENU tangent frame to the world frame.
-
inline const Vec3d &SiteCenterWorld() const¶
Site center position in the world frame [m] (ENU origin).
-
inline double SiteLatDeg() const¶
Site latitude / east longitude [deg].
-
inline double SiteLonDeg() const¶
-
Cart6 GetStateAt(const std::string &agent_name, Real t) const¶
Read-only truth facade: the Cartesian state
[r; v]of agentagent_nameat simulation timet[s], in the agent’s frame. Resolves the agent through the owningSimulationand calls itsGetStateAt(which self-propagates without mutating the agent). Aborts if noSimulationis registered or the agent is unknown.