ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
FrameStateSensorModel.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/*
17Frams state sensor model header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_STATES_FRAME_STATE_SENSOR_MODEL_H
23#define MODELS_STATES_FRAME_STATE_SENSOR_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 Frame state sensor model
34 *
35 * The frame state sensor model senses the relative state between two
36 * frames and outputs that state difference as represented in a third,
37 * output frame. It applies basic kinematics using base functions
38 * developed in the clockwerk module to generate a step-by-step difference
39 * between two frames.
40 *
41 * The results output by this model can be described as
42 * "the state of target_frame relative to reference_frame as output in
43 * output_frame coordinates"
44 */
45 class FrameStateSensorModel : public Model {
46 public:
47 // Model params
48 // NAME TYPE DEFAULT VALUE
50 /** The target_frame is the frame state we are sensing -- we want to
51 * know where target_frame is */
53 /** The reference_frame is the frame relative to which we are sensing.
54 * Results are output relative to the reference frame, in either
55 * reference frame or output frame coordinates. */
57 /** The output_frame is the frame in which the output results are
58 * represented. If it is set to nullptr, reference_frame is used.
59 * Not used for attitude. */
62
63 // Model inputs
64 // NAME TYPE DEFAULT VALUE
66
68
69 // Model outputs
70 // NAME TYPE DEFAULT VALUE
72 /** This is the position of the target frame origin wrt the reference frame origin,
73 * output in output frame coordinates */
75 /** This is the velocity of our target frame origin as represented IN the reference
76 * frame. It is NOT simply the difference in the velocities of their origins, which
77 * is different. This value accounts for reference frame rotation. Output is in output coordinates */
79 /** This is the inertial velocity of our target frame origin relative to our reference
80 * frame origin, represented in output frame coordinates. It is an inertial differencing
81 * of the origins represented in reference, and does not account for reference rotation. */
83 /** This is the attitude of the target frame relative to the reference frame */
84 SIGNAL(att_tgt_ref, QuaternionD, QuaternionD({1.0, 0.0, 0.0, 0.0}))
85 /** This is the angular velocity of the target frame wrt the reference frame, output in
86 * output frame coordinates */
89
90 // Model-specific implementations of startup and derivative
91 FrameStateSensorModel();
92 FrameStateSensorModel(Model &pnt, const std::string &m_name="frame_state_sensor");
93 FrameStateSensorModel(SimulationExecutive &e, const std::string &m_name="frame_state_sensor");
94 FrameStateSensorModel(Model &pnt, int schedule_slot, const std::string &m_name="frame_state_sensor");
95 FrameStateSensorModel(SimulationExecutive &e, int schedule_slot, const std::string &m_name="frame_state_sensor");
96 virtual ~FrameStateSensorModel() {}
97
98 protected:
99 int start();
100 int execute();
101
102 // DCM relating our reference frame to our root frame
103 DCMD _dcm_tmp;
104
105 CartesianVector3D _tmp_tgt;
106 };
107}
108
109#endif
DataIO(GraphTreeObject *data_parent, std::string data_name, T initial_value)
Constructor for the DataIO object.
Definition DataIO.hpp:134
Frame state sensor model.
Definition FrameStateSensorModel.h:45
int execute()
Function to execute the task. All math and calculations should be here.
Definition FrameStateSensorModel.cpp:51
int start()
Function to perform task startup activities (step once after creation)
Definition FrameStateSensorModel.cpp:34
Base model class for derived implementation.
Definition Model.h:56
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
#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 QuaternionD
Definition macros.h:78
#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::CartesianVector< double, 3 > > vel_tgt_ref_inertial__out
Definition FrameStateSensorModel.h:82
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > vel_tgt_ref__out
Definition FrameStateSensorModel.h:78
clockwerk::DataIO< clockwerk::Quaternion< double > > att_tgt_ref
Definition FrameStateSensorModel.h:84
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > omega_tgt_ref__out
Definition FrameStateSensorModel.h:87
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > pos_tgt_ref__out
Definition FrameStateSensorModel.h:74
clockwerk::DataIO< clockwerk::Frame< double > * > output_frame_ptr
Definition FrameStateSensorModel.h:60
clockwerk::DataIO< clockwerk::Frame< double > * > reference_frame_ptr
Definition FrameStateSensorModel.h:56
clockwerk::DataIO< clockwerk::Frame< double > * > target_frame_ptr
Definition FrameStateSensorModel.h:52