WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
Servo.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/*
17Servo model header file
18
19Author: James Tabony
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Servo",
24 "exclude" : False,
25 "category" : "Actuators"
26}
27aliases = {"max_angle" : "Maximum Servo Angle",
28 "min_angle" : "Minimum Servo Angle",
29 "servo_noise_std" : "Noise",
30 "seed_value" : "EXCLUDE",
31 "latency" : "EXCLUDE",
32 "misalignment_angle" : "Misalignment Angle",
33 "initial_servo_angle" : "Initial Servo Angle",
34 "servo_speed" : "Servo Speed",
35 "servo_angle_command" : "Command Servo Angle [rad]",
36 "servo_angle_actual" : "Actual Servo Angle [rad]"
37}
38*/
39
40#ifndef MODELS_ACTUATORS_SERVO_MODEL_H
41#define MODELS_ACTUATORS_SERVO_MODEL_H
42
43#include "simulation/Model.h"
46#include "utils/LatencyUtil.hpp"
47
48namespace warptwin {
62 MODEL(Servo)
63 public:
64 // Model params
65 // NAME TYPE DEFAULT VALUE
68 SIGNAL(max_angle, double, 2.0*M_PI)
72 SIGNAL(min_angle, double, -2.0*M_PI)
74 SIGNAL(servo_noise_std, double, 0.0)
76 SIGNAL(seed_value, int, 0)
79 SIGNAL(latency, int, 0)
83 SIGNAL(misalignment_angle, double, 0.0)
85 SIGNAL(initial_servo_angle, double, 0.0)
87 SIGNAL(servo_speed, double, 0.0)
89
90 // Model inputs
91 // NAME TYPE DEFAULT VALUE
94 SIGNAL(servo_angle_command, double, 0.0)
96
97 // Model outputs
98 // NAME TYPE DEFAULT VALUE
102 SIGNAL(servo_angle_actual, double, 0.0)
104
105 int16 activate() override;
106 int16 deactivate() override;
107
108 protected:
109 int16 start() override;
110 int16 execute() override;
111
113 BiasNoiseModel _noise_model;
114
117
120
123
126
129 };
130
131}
132
133#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
Latency model.
Definition LatencyUtil.hpp:41
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)
double _turn_direction
The turn direction of the servo for this time step.
Definition Servo.h:125
double _max_turn_amount
The maximum amount that the servo can spin in the time of a single simulation step.
Definition Servo.h:128
double _servo_angle_actual
Temporary value that has perturbations acted upon it.
Definition Servo.h:119
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
BiasNoiseModel _noise_model
The bias and noise model for servo angle output.
Definition Servo.h:113
LatencyUtil< double > _latency_model
The latency model for servo angle output.
Definition Servo.h:116
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
double _latency_return
Temporary value for the return of the latency value.
Definition Servo.h:122
const floating_point M_PI
Definition unitutils.h:32