WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
PdAttitudeControl.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/*
17LED Blinker header file
18
19Author: Alex Reynolds
20*/
21#ifndef APPS_PD_ATTITUDE_CONTROL_H
22#define APPS_PD_ATTITUDE_CONTROL_H
23
24#include "flight/App.h"
27#include "dynamics/Quaternion.h"
28#include "dynamics/DCM.h"
29#include "core/mathmacros.h"
30
33
34namespace warpos {
35
55 class PdAttitudeControl : public App {
56 public:
64 SIGNAL(angle_deadband_rad, floating_point, 0.0)
66
77
84 SIGNAL(err_angle, floating_point, 0.0)
88
90
91 virtual ~PdAttitudeControl() {};
92
95 int16 activate() override;
96
99 int16 deactivate() override;
100
106 int16 command(uint16 apid, uint8* buffer, uint16 size) override;
107 protected:
108 int16 start() override;
109 int16 execute() override;
110
112 floating_point _angle;
113
117 floating_point _att_deadband_rad = 0.0;
118
121
125
128
131 };
132}
133
134#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
Quaternion class for attitude representation.
Definition Quaternion.h:68
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
Executive derivation specifically to run flight systems.
Definition FlightExecutive.h:46
int16 execute() override
Definition PdAttitudeControl.cpp:41
floating_point _att_deadband_rad
Definition PdAttitudeControl.h:117
virtual ~PdAttitudeControl()
Definition PdAttitudeControl.h:91
int16 start() override
Definition PdAttitudeControl.cpp:33
int16 command(uint16 apid, uint8 *buffer, uint16 size) override
Process commands issued to the app.
Definition PdAttitudeControl.cpp:123
clockwerk::Quaternion _quat_act_cmd
Quaternion representing the distance between the actual and commanded quaternion.
Definition PdAttitudeControl.h:127
clockwerk::CartesianVector< 3 > _PP
Definition PdAttitudeControl.h:116
clockwerk::CartesianVector< 3 > _deriv_cmd
Definition PdAttitudeControl.h:124
floating_point _angle
Internal variable for the attiude angle error (radians).
Definition PdAttitudeControl.h:112
int16 deactivate() override
Deactivate the app. The app will not step when deactivated.
Definition PdAttitudeControl.cpp:108
PdAttitudeControl(FlightExecutive &executive)
Definition PdAttitudeControl.cpp:21
clockwerk::CartesianVector< 3 > _err_quat_vec
Temporary vector for quaternion vector component.
Definition PdAttitudeControl.h:120
clockwerk::CartesianVector< 3 > _prop_cmd
Temporary vectors to hold proportional and derivative command terms:
Definition PdAttitudeControl.h:123
clockwerk::CartesianVector< 3 > _K
Internal constants for gains.
Definition PdAttitudeControl.h:115
tlm_gnc_pd_att_ctrl_data _tlm_data
Internal variables to hold telemetry buffer for packing tlm.
Definition PdAttitudeControl.h:130
int16 activate() override
Activate the app. The app will step when active.
Definition PdAttitudeControl.cpp:102
#define CartesianVector3
Definition mathmacros.h:43
Definition DeadReckon.cpp:20
PD Control packet definition.
Definition tlm_PdAttitudeControl.h:42
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > cmd_omega__cmd
Definition PdAttitudeControl.h:73
clockwerk::DataIO< clockwerk::Quaternion > act_quat
Definition PdAttitudeControl.h:71
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > act_omega__act
Definition PdAttitudeControl.h:75
clockwerk::DataIO< clockwerk::Quaternion > cmd_quat
Definition PdAttitudeControl.h:69
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > cmd_torque__body
Definition PdAttitudeControl.h:80
clockwerk::DataIO< floating_point > err_angle
Definition PdAttitudeControl.h:84
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > err_omega
Definition PdAttitudeControl.h:86
clockwerk::DataIO< clockwerk::Quaternion > err_quat
Definition PdAttitudeControl.h:82
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > K
Definition PdAttitudeControl.h:61
clockwerk::DataIO< clockwerk::CartesianVector< 3 > > P
Definition PdAttitudeControl.h:59
clockwerk::DataIO< floating_point > angle_deadband_rad
Definition PdAttitudeControl.h:64