WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
SimpleThrusterModel.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/*
17Simple thruster model header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Simple Thruster",
24 "exclude" : False,
25 "category" : "Actuators"
26}
27aliases = {"control_body" : "Spacecraft",
28 "thruster_location__body" : "Position",
29 "thruster_pointing__body" : "Pointing Vector",
30 "thrust_bias" : "Bias",
31 "thrust_noise_std" : "Noise",
32 "g" : "EXCLUDE",
33 "seed_value" : "EXCLUDE",
34 "mdot" : "Mass Flow Rate",
35 "Isp" : "Specific Impulse",
36 "applied_thrust" : "EXCLUDE",
37 "applied_force__body" : "Applied Force",
38}
39*/
40
41#ifndef MODELS_ACTUATORS_SIMPLE_THRUSTER_MODEL_H
42#define MODELS_ACTUATORS_SIMPLE_THRUSTER_MODEL_H
43
44#include "simulation/Model.h"
46#include "frames/Body.h"
47#include "frames/Node.h"
50
51namespace warptwin {
52
53 const double ON_STATE = 1e-15; // Mdot threshold below which thruster is considered "off"
54
55 enum cmds_e {
58 };
59
74 MODEL(SimpleThrusterModel)
75 public:
76 // Model params
77 // NAME TYPE DEFAULT VALUE
81 SIGNAL(control_body, Body*, nullptr)
83 SIGNAL(thruster_location__body, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
86 SIGNAL(thruster_pointing__body, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
88 SIGNAL(thrust_bias, double, 0.0)
91 SIGNAL(thrust_noise_std, double, 0.0)
93 SIGNAL(g, double, warpos::earth_wgs84.mean_gravity)
95 SIGNAL(seed_value, int, 0)
97
98 // Model inputs
99 // NAME TYPE DEFAULT VALUE
102 SIGNAL(mdot, double, 0.0)
104 SIGNAL(Isp, double, 0.0)
106
107 // Model outputs
108 // NAME TYPE DEFAULT VALUE
111 SIGNAL(applied_thrust, double, 0.0)
114 SIGNAL(applied_force__body, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
116
117 // Getters for handles to respective frames
118 // TODO: Fix this to not be needed because these can all be public. Until then it's here
119 clockwerk::DataIO<Node*> thrusterNode = clockwerk::DataIO<Node*>(this, "thrusterNode", &_thruster_node);
120 protected:
121 int16 start() override;
122 int16 execute() override;
123
125 BiasNoiseModel _thruster_bias_noise;
126
129
131 double _nominal_thrust = 0.0;
132
135
137 double _total_thrust = 0.0;
138
142 };
143
144}
145
146#endif
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#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
Node class to apply forces and moments to frames.
Definition Node.h:44
#define CartesianVector3
Definition mathmacros.h:43
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
Node _thruster_node
The node at which thrust is applied.
Definition SimpleThrusterModel.h:128
int16 start() override
Class to execute logging.
BiasNoiseModel _thruster_bias_noise
The bias and noise model for thrust output.
Definition SimpleThrusterModel.h:125
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
double _total_thrust
Value to hold total thrust calculation.
Definition SimpleThrusterModel.h:137
int _cmd_state
Value to hold last thrust command.
Definition SimpleThrusterModel.h:140
const double ON_STATE
Definition SimpleThrusterModel.h:53
double _nominal_thrust
Our nominal thrust calculation from Isp and the like.
Definition SimpleThrusterModel.h:131
double _thrust_perturbation
Value to hold perturbation to thrust.
Definition SimpleThrusterModel.h:134
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
cmds_e
Definition SimpleThrusterModel.h:55
@ ON
Definition SimpleThrusterModel.h:57
int _prev_cmd
Definition SimpleThrusterModel.h:141
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
@ OFF
Definition SimpleThrusterModel.h:56