ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
SpicePlanet.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. 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, LLC.
15******************************************************************************/
16/*
17SPICE Planet header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_ASSEMBLIES_SPICE_PLANET_MODEL_H
23#define MODELS_ASSEMBLIES_SPICE_PLANET_MODEL_H
24
25#include "core/macros.h"
26#include "core/CartesianVector.hpp"
27#include "simulation/Model.h"
28#include "six_dof_dynamics/Frame.hpp"
29#include "simulation/SimScheduler.h"
30
31namespace modelspace {
32
33 /**
34 * @brief The model to maintain planet state using SPICE
35 *
36 * The SPICE planet mode uses the JPL cspice framework to
37 * generate highly precise planet state.
38 *
39 * All planet states are set with the inertial state aligned
40 * to the J2000 frame. The rotating frame is then set at the
41 * same position. The root frame is treated as the base of the
42 * J2000 frame used in SPICE, as observed from the Sun.
43 * All states are set relative to that point using the TDB
44 * time maintained by the simulation.
45 *
46 * All DISTANCE units are meters or meters/second
47 * All ANGULAR RATE units are radians/second
48 *
49 * Author: Alex Reynolds <alex.reynolds@attx.tech>
50 */
51 class SpicePlanet : public Model {
52 public:
53 // Model params
54 // NAME TYPE DEFAULT VALUE
56 /** This flag enables or disables outputting attitude states from the SPICE planet. True is enabled */
57 SIGNAL(enable_attitude, int, true)
59
60 // Model inputs
61 // NAME TYPE DEFAULT VALUE
63
65
66 // Model outputs
67 // NAME TYPE DEFAULT VALUE
69 /** Accessor to the inertial frame of the planet. Set to point to _planet_inertial in constructor. */
71 /** Accessor to the rotating frame of the planet. Set to point to _planet_inertial in constructor. */
74
75 // Model-specific implementations of startup and derivative
76 SpicePlanet(SimulationExecutive &e, const std::string &m_name="earth");
77 ~SpicePlanet() {}
78 protected:
79 int start();
80 int execute();
81
82 // The inertial frame of the planet
83 FrameD _planet_inertial = FrameD("planet_inertial_frame");
84
85 // The planet rotating frame
86 FrameD _planet_rotating = FrameD("planet_rotating_frame");
87
88 // Temporary state variables to hold calculations from spice
89 DCMD _tmp_dcm_p_pci;
90 CartesianVector3D _tmp_vec;
91 std::string _attitude_name;
92 };
93
94}
95
96#endif
DataIO(GraphTreeObject *data_parent, std::string data_name, T initial_value)
Constructor for the DataIO object.
Definition DataIO.hpp:134
Frame(const std::string &name, Frame< T > *par=nullptr, bool free=false)
Constructor for the frame object.
Definition Frame.hpp:294
Base model class for derived implementation.
Definition Model.h:56
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
The model to maintain planet state using SPICE.
Definition SpicePlanet.h:51
int execute()
Function to execute the task. All math and calculations should be here.
Definition SpicePlanet.cpp:67
int start()
Function to perform task startup activities (step once after creation)
Definition SpicePlanet.cpp:42
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition macros.h:87
#define START_PARAMS
Definition macros.h:96
#define CartesianVector3D
Definition macros.h:54
#define END_OUTPUTS
Definition macros.h:90
#define END_PARAMS
Definition macros.h:98
#define DCMD
Definition macros.h:70
#define START_OUTPUTS
Definition macros.h:88
#define FrameD
Definition macros.h:64
#define END_INPUTS
Definition macros.h:94
#define START_INPUTS
Definition macros.h:92
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
clockwerk::DataIO< clockwerk::Frame< double > * > inertial_frame
Definition SpicePlanet.h:70
clockwerk::DataIO< clockwerk::Frame< double > * > rotating_frame
Definition SpicePlanet.h:72
clockwerk::DataIO< int > enable_attitude
Definition SpicePlanet.h:57