ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
FrameDynamics.hpp
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/*
17Frame Dynamics header file
18--------------------------
19
20Author: Alex Reynolds
21*/
22#ifndef SIX_DOF_DYNAMICS_FRAME_DYNAMICS_HPP
23#define SIX_DOF_DYNAMICS_FRAME_DYNAMICS_HPP
24
25#include "utils/Rates.hpp"
26#include "core/CartesianVector.hpp"
27#include "core/Matrix.hpp"
28
29#define NUM_INTEGRATED_STATES 13
30
31namespace clockwerk {
32
33 template <typename T>
34 class FrameDynamics : public Rates<T, NUM_INTEGRATED_STATES> {
35 public:
36 /// @brief Function to calculate frame rates of change for a frame
37 /// @param time The time input for the calculation. Uses current time
38 /// @param state UNUSED FOR THIS IMPLEMENTATION IN FAVOR OF FRAME PTR
39 /// @param out_rates Implicit return of rates of change in states
40 int calculateRates(T time,
41 const std::array<T, NUM_INTEGRATED_STATES> &state,
42 std::array<T, NUM_INTEGRATED_STATES> &out_rates) {
43 /// IMPORTANT: Note that we DO NOT USE our state input because
44 /// our frame is passed as a pointer. This is an override for
45 /// speed and simplicity, but it is the responsibility of the
46 /// user to understand this
47 /// Calculate the rate of change of each element of the frame
48 /// state and set rates
49 _frame_ptr->getStateVectorDot(out_rates);
50 return NO_ERROR;
51 }
52
53 /// Getter and setter for the frame pointer
54 void setFramePtr(Frame<T>* frame_ptr) {_frame_ptr = frame_ptr;}
55 Frame<T>* getFramePtr() {return _frame_ptr;}
56 private:
57 /// Pointer to the frame being integrated. MUST be set before
58 /// calculating rates
59 Frame<T>* _frame_ptr;
60 };
61
62}
63
64#endif
#define NUM_INTEGRATED_STATES
Definition Frame.hpp:35
Definition FrameDynamics.hpp:34
int calculateRates(T time, const std::array< T, 13 > &state, std::array< T, 13 > &out_rates)
Function to calculate frame rates of change for a frame.
Definition FrameDynamics.hpp:40
Definition Rates.hpp:27
#define NO_ERROR
Definition clockwerkerrors.h:31