VR-Engage  2.3
Loading...
Searching...
No Matches
vreRotaryWingActuatorDescriptor.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreRotaryWingActuatorDescriptor.h
7//! \ingroup vreVrfobjparam
8//! \brief Rotary wing actuator descriptor for VREngage
9//!
10//! This file defines the DtVreRotaryWingActuatorDescriptor class, which configures
11//! rotary wing actuator components in VREngage. It extends the base rotary wing actuator
12//! descriptor to add stability control, PID parameters, and other helicopter-specific settings.
13
14#pragma once
15
17
18#include <vrfobjparam/rotaryWingActuatorDescriptor.h>
19
20#include <readerWriter/rwInt.h>
21
22namespace makVre
23{
24//! \brief Type identifier string for the rotary wing actuator descriptor
25const char DtVreRotaryWingActuatorDescriptorType[] = "vre-rotary-wing-actuator-descriptor";
26
27//! \brief Rotary wing actuator descriptor for VREngage
28//!
29//! This class extends the base rotary wing actuator descriptor to add configuration for
30//! stability control, PID parameters, crash behavior, and collective control settings.
31//! It provides detailed controls for helicopter flight dynamics and handling characteristics
32//! in VREngage simulations.
33class VREVRFOBJPARAM_DLL DtVreRotaryWingActuatorDescriptor : public DtRotaryWingActuatorDescriptor
34{
35public:
36 //! \brief Constructor with component name
37 //! \param name The name of this component
38 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
39 //!
40 //! Creates a new rotary wing actuator descriptor with the specified name.
41 DtVreRotaryWingActuatorDescriptor(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
42
43 //! \brief Copy constructor
44 //! \param orig The source descriptor to copy from
45 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
46 //!
47 //! Creates a new rotary wing actuator descriptor as a copy of the provided original.
49 const DtVreRotaryWingActuatorDescriptor& orig, DtReaderWriterRegistry* parentRegistry = 0);
50
51 //! \brief Assignment operator
52 //! \param orig The source descriptor to copy from
53 //! \return Reference to this descriptor after assignment
54 //!
55 //! Assigns the contents of the provided descriptor to this one.
57
58 //! \brief Creates a clone of this descriptor
59 //! \param parentRegistry Parent registry for reader/writer functionality (optional)
60 //! \return Pointer to a new descriptor that is a clone of this one
61 //!
62 //! Creates a new rotary wing actuator descriptor as a deep copy of this one.
63 virtual DtComponentDescriptor* clone(DtReaderWriterRegistry* parentRegistry = 0) const override;
64
65 //! \brief Virtual destructor
66 //!
67 //! Cleans up resources used by the descriptor.
69
70 //! \brief Gets the type identifier for this descriptor
71 //! \return String identifying this descriptor type
72 //!
73 //! Returns a unique type identifier string for this descriptor type.
74 //! Will return DtVreRotaryWingActuatorDescriptorType.
75 virtual DtString type() const override;
76
77 //! \brief Gets the stability augmentation mode
78 //! \return The stability augmentation mode value
79 //!
80 //! Returns the current stability augmentation mode for the rotary wing aircraft.
81 //! Different modes provide different levels of automated stability assistance.
82 virtual int stabilityAugmentationMode() const;
83
84 //! \brief Sets the stability augmentation mode
85 //! \param value The stability augmentation mode value
86 //!
87 //! Sets the stability augmentation mode for the rotary wing aircraft.
88 //! Different modes provide different levels of automated stability assistance.
89 virtual void setStabilityAugmentationMode(int value);
90
91 //! \brief Checks if vertical hold is enabled in stability augmentation
92 //! \return True if vertical hold is enabled, false otherwise
93 //!
94 //! Returns whether the vertical hold feature is enabled in stability augmentation.
95 //! When enabled, the aircraft will attempt to maintain a constant altitude.
97
98 //! \brief Sets if vertical hold is enabled in stability augmentation
99 //! \param value True to enable vertical hold, false to disable
100 //!
101 //! Sets whether the vertical hold feature is enabled in stability augmentation.
102 //! When enabled, the aircraft will attempt to maintain a constant altitude.
103 virtual void setStabilityAugmentationVerticalHold(bool value);
104
105 //! \brief Checks if detonation on crash is enabled
106 //! \return True if detonation on crash is enabled, false otherwise
107 //!
108 //! Returns whether the aircraft will detonate when it crashes.
109 virtual double detonateOnCrash() const { return myDetonateOnCrash; };
110
111 //! \brief Sets if detonation on crash is enabled
112 //! \param val True to enable detonation on crash, false to disable
113 //!
114 //! Sets whether the aircraft will detonate when it crashes.
115 virtual void setDetonateOnCrash(double val) { myDetonateOnCrash = val; };
116
117 //! \brief Gets the proportional gain for the PID controller
118 //! \return The proportional gain value
119 //!
120 //! Returns the proportional gain value used in the PID controller for flight stability.
121 virtual double pGain() const { return myPGain; };
122
123 //! \brief Sets the proportional gain for the PID controller
124 //! \param val The proportional gain value
125 //!
126 //! Sets the proportional gain value used in the PID controller for flight stability.
127 virtual void setPGain(double val) { myPGain = val; };
128
129 //! \brief Gets the integral gain for the PID controller
130 //! \return The integral gain value
131 //!
132 //! Returns the integral gain value used in the PID controller for flight stability.
133 virtual double iGain() const { return myIGain; };
134
135 //! \brief Sets the integral gain for the PID controller
136 //! \param val The integral gain value
137 //!
138 //! Sets the integral gain value used in the PID controller for flight stability.
139 virtual void setIGain(double val) { myIGain = val; };
140
141 //! \brief Gets the derivative gain for the PID controller
142 //! \return The derivative gain value
143 //!
144 //! Returns the derivative gain value used in the PID controller for flight stability.
145 virtual double dGain() const { return myDGain; };
146
147 //! \brief Sets the derivative gain for the PID controller
148 //! \param val The derivative gain value
149 //!
150 //! Sets the derivative gain value used in the PID controller for flight stability.
151 virtual void setDGain(double val) { myDGain = val; };
152
153 //! \brief Gets the feed-forward gain for the PID controller
154 //! \return The feed-forward gain value
155 //!
156 //! Returns the feed-forward gain value used in the PID controller for flight stability.
157 virtual double fGain() const { return myFGain; };
158
159 //! \brief Sets the feed-forward gain for the PID controller
160 //! \param val The feed-forward gain value
161 //!
162 //! Sets the feed-forward gain value used in the PID controller for flight stability.
163 virtual void setFGain(double val) { myFGain = val; };
164
165 //! \brief Gets the PID output filter value
166 //! \return The PID output filter value
167 //!
168 //! Returns the filter value applied to the PID controller output
169 //! to smooth the control response.
170 virtual double pidOutputFilter() const { return myPidOutputFilter; };
171
172 //! \brief Sets the PID output filter value
173 //! \param val The PID output filter value
174 //!
175 //! Sets the filter value applied to the PID controller output
176 //! to smooth the control response.
177 virtual void setPidOutputFilter(double val) { myPidOutputFilter = val; };
178
179 //! \brief Gets the PID output ramp rate
180 //! \return The PID output ramp rate value
181 //!
182 //! Returns the ramp rate applied to the PID controller output
183 //! to limit how quickly control outputs can change.
184 virtual double pidOutputRampRate() const { return myPidOutputRampRate; };
185
186 //! \brief Sets the PID output ramp rate
187 //! \param val The PID output ramp rate value
188 //!
189 //! Sets the ramp rate applied to the PID controller output
190 //! to limit how quickly control outputs can change.
191 virtual void setPidOutputRampRate(double val) { myPidOutputRampRate = val; };
192
193 //! \brief Gets the maximum integral output for the PID controller
194 //! \return The maximum integral output value
195 //!
196 //! Returns the maximum value for the integral term output in the PID controller.
197 //! This prevents integral windup by clamping the integral term contribution.
198 virtual double pidMaxIOutput() const { return myPidMaxIOutput; };
199
200 //! \brief Sets the maximum integral output for the PID controller
201 //! \param val The maximum integral output value
202 //!
203 //! Sets the maximum value for the integral term output in the PID controller.
204 //! This prevents integral windup by clamping the integral term contribution.
205 virtual void setPidMaxIOutput(double val) { myPidMaxIOutput = val; };
206
207 //! \brief Factory function to create a new instance of this descriptor
208 //! \return Pointer to a newly created descriptor
209 //!
210 //! Static factory function used by the descriptor creation system to instantiate
211 //! new instances of this descriptor type.
212 static DtComponentDescriptor* creator();
213
214protected:
215 //! \brief Stability augmentation mode
216 //!
217 //! Defines the level of automated stability assistance provided to the aircraft.
218 //! Different modes provide different levels of control assistance.
220
221 //! \brief Vertical hold flag for stability augmentation
222 //!
223 //! When true, the stability augmentation system will attempt to maintain
224 //! a constant altitude during flight.
226
227 //! \brief Flag for detonation on crash
228 //!
229 //! When true, the aircraft will detonate when it crashes.
230 DtRwBoolean myDetonateOnCrash;
231
232 //! \brief Proportional gain for the PID controller
233 //!
234 //! The proportional gain value used in the PID controller for flight stability.
235 DtRwReal myPGain;
236
237 //! \brief Integral gain for the PID controller
238 //!
239 //! The integral gain value used in the PID controller for flight stability.
240 DtRwReal myIGain;
241
242 //! \brief Derivative gain for the PID controller
243 //!
244 //! The derivative gain value used in the PID controller for flight stability.
245 DtRwReal myDGain;
246
247 //! \brief Feed-forward gain for the PID controller
248 //!
249 //! The feed-forward gain value used in the PID controller for flight stability.
250 DtRwReal myFGain;
251
252 //! \brief Filter value for PID controller output
253 //!
254 //! Filter value applied to the PID controller output to smooth the control response.
256
257 //! \brief Ramp rate for PID controller output
258 //!
259 //! Ramp rate applied to the PID controller output to limit how quickly control outputs can change.
261
262 //! \brief Maximum integral output value for the PID controller
263 //!
264 //! Maximum value for the integral term output in the PID controller.
265 //! This prevents integral windup by clamping the integral term contribution.
267};
268} // namespace makVre
DtVreRotaryWingActuatorDescriptor & operator=(const DtVreRotaryWingActuatorDescriptor &orig)
Assignment operator.
virtual void setPGain(double val)
Sets the proportional gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:127
virtual void setDGain(double val)
Sets the derivative gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:151
virtual void setPidOutputFilter(double val)
Sets the PID output filter value.
Definition vreRotaryWingActuatorDescriptor.h:177
DtRwInt myStabilityAugmentationMode
Stability augmentation mode.
Definition vreRotaryWingActuatorDescriptor.h:219
DtRwReal myPidOutputFilter
Filter value for PID controller output.
Definition vreRotaryWingActuatorDescriptor.h:255
DtRwReal myFGain
Feed-forward gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:250
DtRwReal myPidOutputRampRate
Ramp rate for PID controller output.
Definition vreRotaryWingActuatorDescriptor.h:260
DtRwReal myIGain
Integral gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:240
virtual int stabilityAugmentationMode() const
Gets the stability augmentation mode.
virtual void setStabilityAugmentationVerticalHold(bool value)
Sets if vertical hold is enabled in stability augmentation.
virtual void setFGain(double val)
Sets the feed-forward gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:163
virtual void setPidMaxIOutput(double val)
Sets the maximum integral output for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:205
virtual bool stabilityAugmentationVerticalHold() const
Checks if vertical hold is enabled in stability augmentation.
DtRwReal myDGain
Derivative gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:245
virtual DtString type() const override
Gets the type identifier for this descriptor.
static DtComponentDescriptor * creator()
Factory function to create a new instance of this descriptor.
virtual double dGain() const
Gets the derivative gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:145
virtual double fGain() const
Gets the feed-forward gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:157
virtual double pGain() const
Gets the proportional gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:121
virtual void setIGain(double val)
Sets the integral gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:139
DtRwBoolean myDetonateOnCrash
Flag for detonation on crash.
Definition vreRotaryWingActuatorDescriptor.h:230
virtual double detonateOnCrash() const
Checks if detonation on crash is enabled.
Definition vreRotaryWingActuatorDescriptor.h:109
DtVreRotaryWingActuatorDescriptor(const DtVreRotaryWingActuatorDescriptor &orig, DtReaderWriterRegistry *parentRegistry=0)
Copy constructor.
virtual double pidOutputRampRate() const
Gets the PID output ramp rate.
Definition vreRotaryWingActuatorDescriptor.h:184
virtual double iGain() const
Gets the integral gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:133
DtRwBoolean myStabilityAugmentationVerticalHold
Vertical hold flag for stability augmentation.
Definition vreRotaryWingActuatorDescriptor.h:225
virtual void setStabilityAugmentationMode(int value)
Sets the stability augmentation mode.
DtVreRotaryWingActuatorDescriptor(const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
Constructor with component name.
virtual double pidOutputFilter() const
Gets the PID output filter value.
Definition vreRotaryWingActuatorDescriptor.h:170
virtual void setDetonateOnCrash(double val)
Sets if detonation on crash is enabled.
Definition vreRotaryWingActuatorDescriptor.h:115
virtual void setPidOutputRampRate(double val)
Sets the PID output ramp rate.
Definition vreRotaryWingActuatorDescriptor.h:191
virtual double pidMaxIOutput() const
Gets the maximum integral output for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:198
virtual DtComponentDescriptor * clone(DtReaderWriterRegistry *parentRegistry=0) const override
Creates a clone of this descriptor.
DtRwReal myPidMaxIOutput
Maximum integral output value for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:266
DtRwReal myPGain
Proportional gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:235
virtual ~DtVreRotaryWingActuatorDescriptor() override
Virtual destructor.
Export macros for the VREngage Object Parameter library.
#define VREVRFOBJPARAM_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
!
Definition glsVreMessageUtil.h:50
const char DtVreRotaryWingActuatorDescriptorType[]
Type identifier string for the rotary wing actuator descriptor.
Definition vreRotaryWingActuatorDescriptor.h:25