ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
TriadGuidance.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/*
17Triad method guidance task header file
18
19Author: Alex Jackson
20*/
21
22#ifndef TRIAD_GUIDANCE_H
23#define TRIAD_GUIDANCE_H
24
25#include "core/macros.h"
26#include "architecture/Tasks.h"
27#include "six_dof_dynamics/Frame.hpp"
28#include "six_dof_dynamics/MRP.hpp"
29
30namespace clockwerk {
31
32 /**
33 * @brief Triad method guidance
34 *
35 * This task applies a simple pointing guidance based on the Triad method
36 * for attitude determination. In this approach, two body axes are selected,
37 * along with desired vectors in the reference frame to which they should
38 * point. The task calculates the attitude body/reference which fully meets
39 * the primary pointing constraint and attempts a best effort at the secondary
40 * pointing constraint.
41 */
42 class TriadGuidance : public Task {
43 public:
44 // Model params
45 // NAME TYPE DEFAULT VALUE
47
49
50 // Model inputs
51 // NAME TYPE DEFAULT VALUE
53 /** The body axis vector which will be pointed to desired_primary */
55 /** The desired primary vector expressed in an arbitrary frame */
57 /** The body axis vector which will be pointed to desired_secondary */
59 /** The desired secondary vector expressed in an arbitrary frame */
62
63 // Model outputs
64 // NAME TYPE DEFAULT VALUE
66 /** The desired attitude of the s/c body with respect to a reference frame that the desired primary and secondary were expressed in */
67 SIGNAL(quat_body_ref, Quaternion<double>, Quaternion<double>({0.0, 0.0, 0.0}))
69
70
71 // Model-specific implementations of startup and derivative
72 TriadGuidance() : Task() {}
73 TriadGuidance(Task &pnt, int schedule_slot=0, const std::string &m_name="triad_guidance")
74 : Task(pnt, schedule_slot, m_name) {}
75 TriadGuidance(Executive &e, int schedule_slot=0, const std::string &m_name="triad_guidance")
76 : Task(e, schedule_slot, m_name) {}
77 ~TriadGuidance() {}
78 protected:
79 int execute();
80
81 // Local vectors to establish DCM -- here for speed
82 CartesianVector3D _body_triadx;
83 CartesianVector3D _body_triady;
84 CartesianVector3D _body_triadz;
85 CartesianVector3D _ref_triadx;
86 CartesianVector3D _ref_triady;
87 CartesianVector3D _ref_triadz;
88
89 // Local variables for DCM body/ref to MRP conversion
90 DCMD _dcm_body_ref;
91 QuaternionD _quat_body_ref;
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
Central control mechanism to run simulations and software.
Definition Executive.h:43
This is the base implementation of the task class.
Definition Tasks.h:68
Task()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Tasks.cpp:21
Task(Task &pnt, int slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.cpp:47
Task(Executive &executive, int slot, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.cpp:62
Triad method guidance.
Definition TriadGuidance.h:42
int execute()
Function to execute the task. All math and calculations should be here.
Definition TriadGuidance.cpp:23
#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 END_INPUTS
Definition macros.h:94
#define START_INPUTS
Definition macros.h:92
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > desired_primary
Definition TriadGuidance.h:56
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > current_secondary_body
Definition TriadGuidance.h:58
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > desired_secondary
Definition TriadGuidance.h:60
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > current_primary_body
Definition TriadGuidance.h:54
clockwerk::DataIO< Quaternion< double > > quat_body_ref
Definition TriadGuidance.h:67