VR-Engage  2.2
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 Checks if collective control is reversed
208 //! \return True if collective control is reversed, false otherwise
209 //!
210 //! Returns whether the collective control inputs are reversed.
211 //! This affects how the helicopter responds to collective stick movements.
212 virtual bool reverseCollective() const { return myReverseCollective; };
213
214 //! \brief Sets if collective control is reversed
215 //! \param val True to reverse collective control, false for normal operation
216 //!
217 //! Sets whether the collective control inputs are reversed.
218 //! This affects how the helicopter responds to collective stick movements.
219 virtual void setReverseCollective(bool val) { myReverseCollective = val; };
220
221 //! \brief Factory function to create a new instance of this descriptor
222 //! \return Pointer to a newly created descriptor
223 //!
224 //! Static factory function used by the descriptor creation system to instantiate
225 //! new instances of this descriptor type.
226 static DtComponentDescriptor* creator();
227
228protected:
229 //! \brief Stability augmentation mode
230 //!
231 //! Defines the level of automated stability assistance provided to the aircraft.
232 //! Different modes provide different levels of control assistance.
234
235 //! \brief Vertical hold flag for stability augmentation
236 //!
237 //! When true, the stability augmentation system will attempt to maintain
238 //! a constant altitude during flight.
240
241 //! \brief Flag for detonation on crash
242 //!
243 //! When true, the aircraft will detonate when it crashes.
244 DtRwBoolean myDetonateOnCrash;
245
246 //! \brief Proportional gain for the PID controller
247 //!
248 //! The proportional gain value used in the PID controller for flight stability.
249 DtRwReal myPGain;
250
251 //! \brief Integral gain for the PID controller
252 //!
253 //! The integral gain value used in the PID controller for flight stability.
254 DtRwReal myIGain;
255
256 //! \brief Derivative gain for the PID controller
257 //!
258 //! The derivative gain value used in the PID controller for flight stability.
259 DtRwReal myDGain;
260
261 //! \brief Feed-forward gain for the PID controller
262 //!
263 //! The feed-forward gain value used in the PID controller for flight stability.
264 DtRwReal myFGain;
265
266 //! \brief Filter value for PID controller output
267 //!
268 //! Filter value applied to the PID controller output to smooth the control response.
270
271 //! \brief Ramp rate for PID controller output
272 //!
273 //! Ramp rate applied to the PID controller output to limit how quickly control outputs can change.
275
276 //! \brief Maximum integral output value for the PID controller
277 //!
278 //! Maximum value for the integral term output in the PID controller.
279 //! This prevents integral windup by clamping the integral term contribution.
281
282 //! \brief Flag for reversing collective control
283 //!
284 //! When true, the collective control inputs are reversed, affecting
285 //! how the helicopter responds to collective stick movements.
287};
288} // 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:233
virtual bool reverseCollective() const
Checks if collective control is reversed.
Definition vreRotaryWingActuatorDescriptor.h:212
DtRwReal myPidOutputFilter
Filter value for PID controller output.
Definition vreRotaryWingActuatorDescriptor.h:269
DtRwReal myFGain
Feed-forward gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:264
DtRwReal myPidOutputRampRate
Ramp rate for PID controller output.
Definition vreRotaryWingActuatorDescriptor.h:274
DtRwReal myIGain
Integral gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:254
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:259
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:244
virtual double detonateOnCrash() const
Checks if detonation on crash is enabled.
Definition vreRotaryWingActuatorDescriptor.h:109
virtual void setReverseCollective(bool val)
Sets if collective control is reversed.
Definition vreRotaryWingActuatorDescriptor.h:219
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:239
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
DtRwBoolean myReverseCollective
Flag for reversing collective control.
Definition vreRotaryWingActuatorDescriptor.h:286
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:280
DtRwReal myPGain
Proportional gain for the PID controller.
Definition vreRotaryWingActuatorDescriptor.h:249
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
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
const char DtVreRotaryWingActuatorDescriptorType[]
Type identifier string for the rotary wing actuator descriptor.
Definition vreRotaryWingActuatorDescriptor.h:25