WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
DCM.h
Go to the documentation of this file.
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/*
17DCM header file
18
19Author: Alex Reynolds
20*/
21#ifndef SIX_DOF_DYNAMICS_DCM_HPP
22#define SIX_DOF_DYNAMICS_DCM_HPP
23
24#include <cmath>
25
26#include "core/Matrix.hpp"
28#include "core/safemath.h"
30
31namespace clockwerk {
32
34 class Euler321;
35
36 class Quaternion;
37
38 class MRP;
39
41
50
65
69 class DCM : public Matrix<3, 3> {
70 public:
72 DCM() : Matrix<3, 3>({{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}) {};
73
76 DCM(const floating_point(&initial)[3][3]) : Matrix<3, 3>(initial) {};
77
80 DCM(const DCM &initial) : Matrix<3, 3>(initial) {};
81
84 DCM(const std::array<std::array<floating_point, 3>, 3> &initial) : Matrix<3, 3>(initial) {};
85
88 ~DCM() {}
89
94 int16 inverse(DCM &result) const;
95 DCM inverse() const {DCM tmp; inverse(tmp); return tmp;}
96
106 void rate(const CartesianVector<3> &omega_f1_f2__f1, Matrix<3, 3> &dcmdot_f1_f2);
107
115 int16 toEuler321(Euler321 &euler_f1_f2) const;
117
121 int16 toQuaternion(Quaternion &q_f1_f2) const;
123
127 int16 toMRP(MRP &mrp_f1_f2) const;
128 MRP toMRP();
129 };
130
131}
132
133#endif
Standard vector class derived from Matrix.
Definition CartesianVector.hpp:39
Class defining a direction cosine matrix inherited from Matrix.
Definition DCM.h:69
void rate(const CartesianVector< 3 > &omega_f1_f2__f1, Matrix< 3, 3 > &dcmdot_f1_f2)
Function to calculate the rate of change in the current representation based on the omega vector.
Definition DCM.cpp:31
DCM(const floating_point(&initial)[3][3])
Definition DCM.h:76
~DCM()
Definition DCM.h:88
DCM inverse() const
Definition DCM.h:95
Quaternion toQuaternion()
Definition DCM.cpp:124
DCM()
Default constructor generates DCM as an identity matrix.
Definition DCM.h:72
DCM(const DCM &initial)
Definition DCM.h:80
MRP toMRP()
Definition DCM.cpp:151
Euler321 toEuler321()
Definition DCM.cpp:68
DCM(const std::array< std::array< floating_point, 3 >, 3 > &initial)
Definition DCM.h:84
Class defining a 3-2-1 Euler angle sequence.
Definition Euler321.h:62
Modified Rodrigues Parameter class definiton.
Definition MRP.h:65
Matrix math implementation.
Definition Matrix.hpp:55
Matrix()
Definition Matrix.hpp:233
Quaternion class for attitude representation.
Definition Quaternion.h:68
Definition CircularBuffer.hpp:28