WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
MagUpdate.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/*
17Inertial Navigation EKF: Magnetometer Measurement Update Header File
18
19Author: James Tabony
20*/
21
22#ifndef APPS_GNC_INERTIAL_NAV_MAG_UPDATE_APP_H
23#define APPS_GNC_INERTIAL_NAV_MAG_UPDATE_APP_H
24
25#include "core/mathmacros.h"
26
27#include "flight/App.h"
29
32
35
37namespace warpos{
38
58 class MagUpdate : public App {
59 public:
69 SIGNAL(mag_meas_noise, clockwerk::CartesianVector<3>, clockwerk::CartesianVector<3>({0.0, 0.0, 0.0}))
74
76 // ***** STATE INPUT DEFINITIONS ***** //
77
108
109 // ***** MAG MEASUREMENT INPUT DEFINITIONS ***** //
110
111
113 SIGNAL(mag_meas_vec__MAG, clockwerk::CartesianVector<3>, clockwerk::CartesianVector<3>({0.0, 0.0, 0.0}))
122
123 // ***** ADDITIONAL INPUT DEFINITIONS ***** //
124
127 SIGNAL(expected_mag_vec__REF, clockwerk::CartesianVector<3>, clockwerk::CartesianVector<3>({0.0, 0.0, 0.0}))
132
165 SIGNAL(pre_residual, clockwerk::CartesianVector<3>, clockwerk::CartesianVector<3>({0.0, 0.0, 0.0}))
169
170 MagUpdate(FlightExecutive &executive);
171
172 virtual ~MagUpdate() {};
173
176 int16 activate() override;
177
180 int16 deactivate() override;
181
187 int16 command(uint16 apid, uint8* buffer, uint16 size) override;
188
192
193 protected:
194 int16 start() override;
195 int16 execute() override;
196
202
204 std::array<floating_point, 3> _dummy3;
205 std::array<floating_point, 4> _dummy4;
207
214
217
220
223
227 };
228}
229
230
231#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
Standard vector class derived from Matrix.
Definition CartesianVector.hpp:39
Quaternion class for attitude representation.
Definition Quaternion.h:68
Wrapper to manage and convert time as timespce.
Definition Time.h:53
App(FlightExecutive &executive, const char *name, uint16 apid, uint8 instance=0)
Executive-based constructor for the task.
Definition App.cpp:21
uint16 apid()
Get the apid for this app.
Definition App.h:105
Generic, templated EKF measurement update class.
Definition EkfMeasurementUpdate.hpp:49
Executive derivation specifically to run flight systems.
Definition FlightExecutive.h:46
int16 deactivate() override
Deactivate the app. The app will not step when deactivated.
Definition MagUpdate.cpp:185
inertial_nav::StateVector _state_input_array
Temporary variables for the array input/outputs passed into the EkfMeasurementUpdate object.
Definition MagUpdate.h:209
int16 start() override
Definition MagUpdate.cpp:36
int16 activate() override
Activate the app. The app will step when active.
Definition MagUpdate.cpp:178
inertial_nav::MagMeasVector _measurement_array
Temporary variables for the array input/outputs passed into the EkfMeasurementUpdate object.
Definition MagUpdate.h:213
PointingVectorMeasurements< inertial_nav::STATE_SIZE > _measurements
Reference variable to the internal Measurements.
Definition MagUpdate.h:198
tlm_gnc_mag_update_state _tlm_a_posteriori_state
Packet to hold state after measurement incorporation.
Definition MagUpdate.h:222
MagUpdate(FlightExecutive &executive)
Definition MagUpdate.cpp:24
int16 command(uint16 apid, uint8 *buffer, uint16 size) override
Process commands issued to the app.
Definition MagUpdate.cpp:200
clockwerk::CartesianVector< 3 > _mag_meas_vec__B
Definition MagUpdate.h:216
inertial_nav::MagMeasVector _residual
Definition MagUpdate.h:213
virtual ~MagUpdate()
Definition MagUpdate.h:172
inertial_nav::MagObsVector _state_observer_array
Temporary variables for the array input/outputs passed into the EkfMeasurementUpdate object.
Definition MagUpdate.h:211
std::array< floating_point, 4 > _dummy4
Definition MagUpdate.h:205
clockwerk::Quaternion _unit_quat
Temporary variable for unitizing a quaternion.
Definition MagUpdate.h:219
EkfMeasurementUpdate< inertial_nav::STATE_SIZE, POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS, POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS > _measUpdate
Reference variable to the internal EkfMeasurementsUpdate.
Definition MagUpdate.h:201
inertial_nav::StateVector _state_output_array
Definition MagUpdate.h:209
int16 execute() override
Definition MagUpdate.cpp:47
inertial_nav::MagObsVector _dummyObs
Definition MagUpdate.h:206
clockwerk::Time _repeat_check_time
Variables to verify we are not processing stale measurements.
Definition MagUpdate.h:225
clockwerk::CartesianVector< 3 > _expected_mag_vec__pI
Internal variables for the transformed measurements.
Definition MagUpdate.h:216
clockwerk::CartesianVector< 3 > _repeat_check_meas
Definition MagUpdate.h:226
std::array< floating_point, 3 > _dummy3
Dummy temporary array for swapping between std::array and clockwerk::CartesianVector.
Definition MagUpdate.h:204
inertial_nav::MagMeasVector getResidual()
Getter function to grab the internal residual.
Definition MagUpdate.h:191
Definition PointingVectorMeasurements.hpp:61
#define CartesianVector3
Definition mathmacros.h:43
#define Matrix16
Definition mathmacros.h:32
Definition CircularBuffer.hpp:28
std::array< floating_point, MAG_MEAS_SIZE > MagMeasVector
Definition InertialNavigationDefinition.hpp:304
std::array< floating_point, STATE_SIZE > StateVector
Definition InertialNavigationDefinition.hpp:298
std::array< floating_point, MAG_OBSERVER_SIZE > MagObsVector
Definition InertialNavigationDefinition.hpp:303
constexpr uint32 STATE_SIZE
Definition InertialNavigationDefinition.hpp:98
Definition DeadReckon.cpp:20
const uint32 POINTING_MEASUREMENT_MEASUREMENT_VECTOR_ELEMENTS(3)
const uint32 POINTING_MEASUREMENT_OBSERVER_VECTOR_ELEMENTS(3)
Definition tlm_InertialNavigationMagnetometerMeasurementUpdate.h:52
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > accelBias_B_pI__pI
Definition MagUpdate.h:99
clockwerk::DataIO< clockwerk::Quaternion > quat_B_pI
Definition MagUpdate.h:89
clockwerk::DataIO< clockwerk::Matrix< 16, 16 > > state_cov
Definition MagUpdate.h:103
clockwerk::DataIO< clockwerk::Quaternion > quat_pI_REF
Definition MagUpdate.h:130
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > expected_mag_vec__REF
Definition MagUpdate.h:127
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > vel_B_pI__pI
Definition MagUpdate.h:85
clockwerk::DataIO< bool > MAG_meas_validity_flag
Definition MagUpdate.h:121
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > pos_B_pI__pI
Definition MagUpdate.h:81
clockwerk::DataIO< clockwerk::Time > MAG_meas_time_stamp
Definition MagUpdate.h:117
clockwerk::DataIO< clockwerk::Time > state_input_time_stamp
Definition MagUpdate.h:107
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > gyroBias_B_pI__pI
Definition MagUpdate.h:94
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > mag_meas_vec__MAG
Definition MagUpdate.h:113
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > pos_B_pI__pI
Definition MagUpdate.h:137
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > post_residual
Definition MagUpdate.h:167
clockwerk::DataIO< clockwerk::Matrix< 16, 16 > > state_cov
Definition MagUpdate.h:159
clockwerk::DataIO< clockwerk::Time > state_output_time_stamp
Definition MagUpdate.h:163
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > accelBias_B_pI__pI
Definition MagUpdate.h:155
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > vel_B_pI__pI
Definition MagUpdate.h:141
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > pre_residual
Definition MagUpdate.h:165
clockwerk::DataIO< clockwerk::Quaternion > quat_B_pI
Definition MagUpdate.h:145
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > gyroBias_B_pI__pI
Definition MagUpdate.h:150
clockwerk::DataIO< clockwerk::Time > time_diff_stale_bound
Definition MagUpdate.h:64
clockwerk::DataIO< clockwerk::Quaternion > quat_MAG_B
Definition MagUpdate.h:72
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > mag_meas_noise
Definition MagUpdate.h:69