ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
SynodicFrameManagerModel.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/*
17Three body synodic frame manager header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_SUPPORT_SYNODIC_FRAME_MODEL_H
23#define MODELS_SUPPORT_SYNODIC_FRAME_MODEL_H
24
25#include "core/macros.h"
26#include "simulation/Model.h"
27#include "six_dof_dynamics/Frame.hpp"
28#include "utils/frameutils.hpp"
29
30namespace modelspace {
31
32 /**
33 * @brief Synodic Frame Manager Model
34 *
35 * This model creates and maintains the three-body system Synodic frame
36 * according to the definition here:
37 * https://core.ac.uk/download/pdf/36695384.pdf
38 *
39 * It creates a frame as a child of the simulation executive root frame.
40 * This is a key assumption -- see below.
41 *
42 * Definition:
43 * Frame centered at the barycenter of the three body system (root frame origin)
44 * +X axis directed from the primary body to the secondary body
45 * +Z axis directed along the second body's angular momentum vector
46 * +Y axis completes the right hand frame
47 *
48 * Key assumptions:
49 * - The simulation executive root frame is centered at the barycenter of the
50 * three-body system
51 */
53 public:
54 // Model params
55 // NAME TYPE DEFAULT VALUE
57 /** The inertial parent frame which the target frame is orbiting */
59 /** The reference target frame to which the LVLH frame should attach */
62
63 // Model inputs
64 // NAME TYPE DEFAULT VALUE
66
68
69 // Model outputs
70 // NAME TYPE DEFAULT VALUE
72 /** The LVLH frame produced by this model */
75
76 // Model-specific implementations of startup and derivative
77 SynodicFrameManagerModel() : modelspace::Model() {outputs.synodic_frame_ptr(&_synodic_frame);}
78 SynodicFrameManagerModel(modelspace::Model &pnt, int schedule_slot=0, const std::string &m_name="lvlh_frame_manager")
79 : Model(pnt, schedule_slot, m_name) {outputs.synodic_frame_ptr(&_synodic_frame);}
80 SynodicFrameManagerModel(modelspace::SimulationExecutive &e, int schedule_slot=0, const std::string &m_name="lvlh_frame_manager")
81 : Model(e, schedule_slot, m_name) {outputs.synodic_frame_ptr(&_synodic_frame);}
82 virtual ~SynodicFrameManagerModel() {}
83
84 protected:
85 int start();
86 int execute();
87
88 /// @brief This is the actual LVLH frame
89 FrameD _synodic_frame = FrameD("synodic_frame");
90
91 /// @brief Temporary variable to hold lvlh attitude
93 };
94
95}
96
97#endif
DataIO(GraphTreeObject *data_parent, std::string data_name, T initial_value)
Constructor for the DataIO object.
Definition DataIO.hpp:134
int operator()(const T &new_value)
Function to set the value of the DataIO object.
Definition DataIO.hpp:115
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
Model(SimulationExecutive &executive, int schedule_slot, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Model.cpp:35
Model(Model &pnt, int schedule_slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Model.cpp:31
Model()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Model.cpp:21
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
Synodic Frame Manager Model.
Definition SynodicFrameManagerModel.h:52
int execute()
Function to execute the task. All math and calculations should be here.
Definition SynodicFrameManagerModel.cpp:44
clockwerk::DCM< double > _synodic_attitude__r
Temporary variable to hold lvlh attitude.
Definition SynodicFrameManagerModel.h:92
clockwerk::Frame< double > _synodic_frame
This is the actual LVLH frame.
Definition SynodicFrameManagerModel.h:89
int start()
Function to perform task startup activities (step once after creation)
Definition SynodicFrameManagerModel.cpp:22
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition macros.h:87
#define START_PARAMS
Definition macros.h:96
#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 > * > synodic_frame_ptr
Definition SynodicFrameManagerModel.h:73
clockwerk::DataIO< clockwerk::Frame< double > * > secondary_planet_ptr
Definition SynodicFrameManagerModel.h:60
clockwerk::DataIO< clockwerk::Frame< double > * > primary_planet_ptr
Definition SynodicFrameManagerModel.h:58