WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
StarTracker.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/*
17Star Tracker model header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Star Tracker",
24 "exclude" : False,
25 "category" : "Sensors"
26}
27aliases = {"reference_frame" : "Att. Reference Frame",
28 "bias" : "Bias",
29 "cross_axis_accuracy" : "Cross Axis Accuracy",
30 "twist_accuracy" : "Twist Axis Accuracy",
31 "fov" : "FOV",
32 "mount_frame" : "Spacecraft Body",
33 "mount_position__mf" : "Body Mount Position",
34 "mount_alignment_mf" : "Body Mount Alignment",
35 "rad_tolerance" : "Rad. Tolerance",
36 "rate_hz" : "Rate Hz",
37 "seed_value" : "EXCLUDE",
38 "meas_quat_sf_ref" : "Meas. Attitude",
39 "perfect_quat_sf_ref" : "EXCLUDE",
40 "operational_power_draw" : "Operational Power Draw",
41 "mass" : "Mass",
42 "current_power_draw" : "Current Power Draw",
43}
44*/
45
46#ifndef MODELS_SENSORS_STAR_TRACKER_H
47#define MODELS_SENSORS_STAR_TRACKER_H
48
49#include "simulation/Model.h"
50#include "dynamics/Euler321.h"
51#include "dynamics/Quaternion.h"
52#include "dynamics/DCM.h"
53#include "frames/Frame.h"
56
57namespace warptwin {
58
81 MODEL(StarTracker)
82 public:
83 // Model params
84 // NAME TYPE DEFAULT VALUE
89 SIGNAL(bias, clockwerk::Euler321, clockwerk::Euler321({0.0, 0.0, 0.0}))
91 SIGNAL(cross_axis_accuracy, double, 0.0)
93 SIGNAL(twist_accuracy, double, 0.0)
97 SIGNAL(fov, double, M_PI/6)
99 SIGNAL(mass, double, 0.0)
103 SIGNAL(mount_frame, Frame*, nullptr)
106 SIGNAL(mount_position__mf, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
108 SIGNAL(mount_alignment_mf, clockwerk::Quaternion, clockwerk::Quaternion({1.0, 0.0, 0.0, 0.0}))
110 SIGNAL(rad_tolerance, double, 0.0)
114 SIGNAL(reference_frame, Frame*, nullptr)
117 SIGNAL(rate_hz, int, 0)
119 SIGNAL(seed_value, int, 0)
122 SIGNAL(operational_power_draw, double, 0.0)
124
125 // Model inputs
126 // NAME TYPE DEFAULT VALUE
128
130
131 // Model outputs
132 // NAME TYPE DEFAULT VALUE
137 SIGNAL(output_time, clockwerk::Time, clockwerk::Time(0, 0))
141 SIGNAL(meas_quat_sf_ref, clockwerk::Quaternion, clockwerk::Quaternion({1.0, 0.0, 0.0, 0.0}))
145 SIGNAL(perfect_quat_sf_ref, clockwerk::Quaternion, clockwerk::Quaternion({1.0, 0.0, 0.0, 0.0}))
148 SIGNAL(current_power_draw, double, 0.0)
150
152 clockwerk::DataIO<Frame*> sensor_frame = clockwerk::DataIO<Frame*>(this, "sensor_frame", &_sensor_frame);
153
156 warptwin::BiasNoiseModel* biasNoiseModel() {return &_sensor_bias_noise;}
157
160 warptwin::RateMonitor* rateMonitor() {return &_rate_monitor;}
161
162 int16 activate() override;
163 int16 deactivate() override;
164
165 protected:
166 int16 start() override;
167 int16 execute() override;
168
170 void _configureInternal();
171
174
176 BiasNoiseModel _sensor_bias_noise;
177
179 RateMonitor _rate_monitor;
180
181 // Temporary DCM to hold temporary attitude calculations
182 clockwerk::DCM _tmp_dcm;
183
184 // Internal variable to hold full bias and noise
185 clockwerk::Euler321 _total_error;
186 };
187
188}
189
190#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
Frame class definition.
Definition Frame.h:96
#define CartesianVector3
Definition mathmacros.h:43
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
int16 start() override
Class to execute logging.
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
BiasNoiseModel _sensor_bias_noise
The bias and noise model for sensor output.
Definition SimpleCamera.h:165
Frame _sensor_frame
The sensor frame in which all measurements will be taken.
Definition Accelerometer.h:237
void _configureInternal()
Function to configure sensor – runs in all constructors.
warptwin::RateMonitor * rateMonitor()
Accessor for the internal rate monitor model.
Definition Accelerometer.h:224
int16 activate() override
MODEL(Servo) public int16 deactivate() override
Model to simulate a servo's motion.
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
clockwerk::DCM _tmp_dcm
Definition SimpleCamera.h:171
CartesianVector3 _total_error
Temporary variable to hold total error for gyro.
Definition Gyroscope.h:223
MODEL(Magnetometer) public warptwin::MarkovUncertaintyModel * biasNoiseModel()
Accessor for the internal bias and noise model.
Definition Magnetometer.h:202
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
RateMonitor _rate_monitor
Rate monitor to control the rate at which the sensor runs.
Definition Accelerometer.h:243
const floating_point M_PI
Definition unitutils.h:32