WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
SpicePlanet.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16/*
17SPICE Planet header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "SPICE Planet",
24 "exclude" : False,
25 "category" : "Assemblies"
26}
27aliases = {"enable_attitude" : "EXCLUDE",
28 "self_id" : "Self",
29 "inertial_frame" : "Planet Inertial Frame",
30 "rotating_frame" : "Planet Rotating Frame",
31 "eq_radius" : "Equatorial Radius",
32 "flattening" : "Ellipse Flattening",
33 "mu" : "GM",
34 "J2" : "J2",
35 "J3" : "J3",
36 "mean_ang_vel" : "Planet Ang. Vel.",
37 "self_id" : "Planet"
38}
39*/
40
41#ifndef MODELS_ASSEMBLIES_SPICE_PLANET_MODEL_H
42#define MODELS_ASSEMBLIES_SPICE_PLANET_MODEL_H
43
45#include "simulation/Model.h"
46#include "frames/Frame.h"
49
50namespace warptwin {
51
78 class SpicePlanet : public Model {
79 public:
80 // Model params
81 // NAME TYPE DEFAULT VALUE
84 SIGNAL(enable_attitude, int, true)
86
87 // Model inputs
88 // NAME TYPE DEFAULT VALUE
90
92
93 // Model outputs
94 // NAME TYPE DEFAULT VALUE
99 SIGNAL(self_id, GraphTreeObject*, nullptr)
101 SIGNAL(inertial_frame, Frame*, nullptr)
103 SIGNAL(rotating_frame, Frame*, nullptr)
106 SIGNAL(eq_radius, double, warpos::earth_wgs84.eq_radius)
109 SIGNAL(flattening, double, warpos::earth_wgs84.flattening)
112 SIGNAL(mu, double, warpos::earth_wgs84.mu)
115 SIGNAL(J2, double, warpos::earth_wgs84.J2)
118 SIGNAL(J3, double, warpos::earth_wgs84.J3)
121 SIGNAL(mean_ang_vel, CartesianVector3, CartesianVector3({0.0,0.0,warpos::earth_wgs84.mean_ang_vel}))
123
124 // Model-specific implementations of startup and derivative
125 SpicePlanet(SimulationExecutive &e, const std::string &m_name="earth");
126 ~SpicePlanet();
127
128 protected:
129 int16 start() override;
130 int16 execute() override;
131
132 // The inertial frame of the planet
133 Frame _planet_inertial = Frame("planet_inertial_frame");
134
135 // The planet rotating frame
136 Frame _planet_rotating = Frame("planet_rotating_frame");
137
138 // Temporary state variables to hold calculations from spice
141 std::string _attitude_name;
142 };
143
144}
145
146#endif
#define START_PARAMS
Definition appmacros.h:42
#define END_OUTPUTS
Definition appmacros.h:33
#define END_PARAMS
Definition appmacros.h:47
#define START_OUTPUTS
Definition appmacros.h:28
#define END_INPUTS
Definition appmacros.h:40
#define START_INPUTS
Definition appmacros.h:35
Class defining a direction cosine matrix inherited from Matrix.
Definition DCM.h:69
GraphTreeObject(const char *gt_nme="", GraphTreeObject **storage_array=nullptr, uint32 storage_size=0)
Name-based constructor for GraphTreeObject which will have no children by default.
Definition GraphTreeObject.cpp:23
Frame class definition.
Definition Frame.h:96
Model(Model &pnt, int16 schedule_slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Model.cpp:26
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:64
High fidelity planet model using the JPL cspice framework under the hood for ultra accurate states.
Definition SpicePlanet.h:78
int16 execute() override
Definition SpicePlanet.cpp:111
CartesianVector3 _tmp_vec
Definition SpicePlanet.h:140
Frame _planet_rotating
Definition SpicePlanet.h:136
~SpicePlanet()
Definition SpicePlanet.cpp:52
START_PARAMS SIGNAL(enable_attitude, int, true) END_PARAMS START_INPUTS END_INPUTS START_OUTPUTS SIGNAL(self_id
Frame _planet_inertial
Definition SpicePlanet.h:133
int16 start() override
Definition SpicePlanet.cpp:54
START_PARAMS GraphTreeObject nullptr Frame nullptr warpos::earth_wgs84 flattening warpos::earth_wgs84 J2 const std::string & m_name
Definition SpicePlanet.h:125
clockwerk::DCM _tmp_dcm_p_pci
Definition SpicePlanet.h:139
START_PARAMS GraphTreeObject nullptr Frame nullptr warpos::earth_wgs84 flattening warpos::earth_wgs84 J2 CartesianVector3
Definition SpicePlanet.h:121
std::string _attitude_name
Definition SpicePlanet.h:141
Definition DeadReckon.cpp:20
PlanetDefaults earth_wgs84
Definition planetdefaults.cpp:22
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22