WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
SimpleCamera.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/*
17Camera sensor model header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Simple Camera",
24 "exclude" : False,
25 "category" : "Sensors"
26}
27aliases = {"target_obj_frame" : "Sensed Target",
28 "alpha_bias" : "Alpha Angle Bias",
29 "beta_bias" : "Beta Angle Bias",
30 "alpha_gaussian_noise" : "Alpha Angle Noise",
31 "beta_gaussian_noise" : "Beta Angle Noise",
32 "mount_frame" : "Spacecraft Body",
33 "mount_position__mf" : "Body Mount Position",
34 "mount_alignment_mf" : "Body Mount Alignment",
35 "rate_hz" : "Rate Hz",
36 "seed_value" : "EXCLUDE",
37 "measured_alpha" : "Meas. Alpha Angle",
38 "measured_beta" : "Meas. Beta Angle",
39 "perfect_alpha" : "EXCLUDE",
40 "perfect_beta" : "EXCLUDE",
41 "operational_power_draw" : "Operational Power Draw",
42 "mass" : "Mass",
43 "current_power_draw" : "Current Power Draw",
44}
45*/
46
47#ifndef MODELS_SENSORS_SIMPLE_CAMERA_SENSOR_H
48#define MODELS_SENSORS_SIMPLE_CAMERA_SENSOR_H
49
50#include "simulation/Model.h"
51#include "dynamics/Euler321.h"
52#include "dynamics/Quaternion.h"
53#include "dynamics/DCM.h"
54#include "frames/Frame.h"
57
58namespace warptwin {
59
68 MODEL(SimpleCamera)
69 public:
70 // Model params
71 // NAME TYPE DEFAULT VALUE
74 SIGNAL(target_obj_frame, Frame*, nullptr)
78 SIGNAL(alpha_bias, double, 0.0)
82 SIGNAL(beta_bias, double, 0.0)
85 SIGNAL(alpha_gaussian_noise, double, 0.0)
88 SIGNAL(beta_gaussian_noise, double, 0.0)
92 SIGNAL(mount_frame, Frame*, nullptr)
95 SIGNAL(mount_position__mf, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
97 SIGNAL(mount_alignment_mf, clockwerk::Quaternion, clockwerk::Quaternion({1.0, 0.0, 0.0, 0.0}))
100 SIGNAL(rate_hz, int, 0)
102 SIGNAL(seed_value, int, 0)
105 SIGNAL(operational_power_draw, double, 0.0)
107 SIGNAL(mass, double, 0.0)
109
110 // Model inputs
111 // NAME TYPE DEFAULT VALUE
113
115
116 // Model outputs
117 // NAME TYPE DEFAULT VALUE
122 SIGNAL(measured_alpha, double, 0.0)
126 SIGNAL(measured_beta, double, 0.0)
130 SIGNAL(perfect_alpha, double, 0.0)
134 SIGNAL(perfect_beta, double, 0.0)
137 SIGNAL(current_power_draw, double, 0.0)
139
141 clockwerk::DataIO<Frame*> sensor_frame = clockwerk::DataIO<Frame*>(this, "sensor_frame", &_sensor_frame);
142
145 warptwin::BiasNoiseModel* biasNoiseModel() {return &_sensor_bias_noise;}
146
149 warptwin::RateMonitor* rateMonitor() {return &_rate_monitor;}
150
151 int16 activate() override;
152 int16 deactivate() override;
153
154 protected:
155 int16 start() override;
156 int16 execute() override;
157
159 void _configureInternal();
160
163
165 BiasNoiseModel _sensor_bias_noise;
166
168 RateMonitor _rate_monitor;
169
170 // Temporary DCM to hold temporary attitude calculations
172
173 // Internal variable to hold full bias and noise
175 };
176
177}
178
179#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
Class defining a direction cosine matrix inherited from Matrix.
Definition DCM.h:69
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
CartesianVector3 _pos_tgt_mount__mount
Definition SimpleCamera.h:174
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
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