-
Notifications
You must be signed in to change notification settings - Fork 462
/
visual-reference-point-extensions.xml
263 lines (237 loc) · 7.14 KB
/
visual-reference-point-extensions.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0"?>
<!--
Extension properties for the JSBSim visual reference point (VRP).
Copyright (C) 2015 - 2023 Anders Gidenstam (anders(at)gidenstam.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
-->
<system name="visual-reference-point-extensions">
<channel name="position">
<fcs_function name="position/vrp-cg-altitude-offset-ft">
<description>
Altitude offset of the visual reference point w.r.t. the centre of gravity.
FIXME: Verify the roll dependence.
</description>
<function>
<sum>
<product>
<value>-0.083333333</value>
<difference>
<property>metrics/visualrefpoint-x-in</property>
<property>inertia/cg-x-in</property>
</difference>
<sin>
<property>attitude/pitch-rad</property>
</sin>
</product>
<product>
<value>0.083333333</value>
<difference>
<property>metrics/visualrefpoint-z-in</property>
<property>inertia/cg-z-in</property>
</difference>
<cos>
<property>attitude/pitch-rad</property>
</cos>
</product>
<product>
<value>-0.083333333</value>
<difference>
<property>metrics/visualrefpoint-y-in</property>
<property>inertia/cg-y-in</property>
</difference>
<sin>
<property>attitude/roll-rad</property>
</sin>
</product>
<!-- product>
<value>0.083333333</value>
<difference>
<property>metrics/visualrefpoint-z-in</property>
<property>inertia/cg-z-in</property>
</difference>
<cos>
<property>attitude/roll-rad</property>
</cos>
</product -->
</sum>
</function>
</fcs_function>
<fcs_function name="position/vrp-altitude-ft">
<description>
Altitude of the visual reference point.
</description>
<function>
<sum>
<property>position/h-sl-ft</property>
<property>position/vrp-cg-altitude-offset-ft</property>
</sum>
</function>
</fcs_function>
<fcs_function name="position/vrp-altitude-agl-ft">
<description>
Distance between the visual reference point and the ground surface.
</description>
<function>
<sum>
<property>position/h-agl-ft</property>
<property>position/vrp-cg-altitude-offset-ft</property>
</sum>
</function>
</fcs_function>
<fcs_function name="position/vrp-latitude-deg">
<description>
Latitude of the visual reference point.
Based on the geocentric to geodetic conversion
vrp-latitude-deg = atan(tan(vrp-gc-latitude_deg)/(1-f)^2))
where for WGS 84 f = 1.0/298.25722.
</description>
<function>
<product>
<value>57.29578</value>
<atan>
<product>
<tan>
<product>
<value>0.017453293</value>
<property>position/vrp-gc-latitude_deg</property>
</product>
</tan>
<value>1.0067395</value>
</product>
</atan>
</product>
</function>
</fcs_function>
<fcs_function name="position/vrp-longitude-deg">
<description>
Longitude of the visual reference point.
</description>
<function>
<property>position/vrp-longitude_deg</property>
</function>
</fcs_function>
<fcs_function name="position/latitude-unit-distance-ft_deg">
<description>
Feet per degree of latitude at the present position.
The conversion is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</description>
<function>
<product>
<value>3.2808399</value>
<!-- Approximate WGS 84 meters per latitude deg. -->
<sum>
<value>111132.92</value>
<product>
<value>-559.82</value>
<cos>
<product>
<value>2.0</value>
<value>0.017453293</value>
<property>position/vrp-latitude-deg</property>
</product>
</cos>
</product>
</sum>
</product>
</function>
</fcs_function>
<fcs_function name="position/longitude-unit-distance-ft_deg">
<description>
Feet per degree of longitude at the present position.
The conversion is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</description>
<function>
<product>
<value>3.2808399</value>
<!-- Approximate WGS 84 meters per longitude deg. -->
<sum>
<product>
<value>111412.84</value>
<cos>
<product>
<value>0.017453293</value>
<property>position/vrp-latitude-deg</property>
</product>
</cos>
</product>
<product>
<value>-93.5</value>
<cos>
<product>
<value>3.0</value>
<value>0.017453293</value>
<property>position/vrp-latitude-deg</property>
</product>
</cos>
</product>
</sum>
</product>
</function>
</fcs_function>
</channel>
<channel name="velocities">
<!-- NOTE:
Computing the velocity by derivating the position is probably not
the best way.
-->
<pid name="velocities/vrp-v-north-deg_sec">
<input>position/vrp-latitude-deg</input>
<kp>0.0</kp>
<ki>0.0</ki>
<kd>1.0</kd>
</pid>
<fcs_function name="velocities/vrp-v-north-fps">
<description>
The conversion from degrees of latitude per second to ft/sec is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</description>
<function>
<product>
<property>position/latitude-unit-distance-ft_deg</property>
<property>velocities/vrp-v-north-deg_sec</property>
</product>
</function>
</fcs_function>
<pid name="velocities/vrp-v-east-deg_sec">
<input>position/vrp-longitude-deg</input>
<kp>0.0</kp>
<ki>0.0</ki>
<kd>1.0</kd>
</pid>
<fcs_function name="velocities/vrp-v-east-fps">
<description>
The conversion from degrees of longitude per second to ft/sec is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</description>
<function>
<product>
<property>position/longitude-unit-distance-ft_deg</property>
<property>velocities/vrp-v-east-deg_sec</property>
</product>
</function>
</fcs_function>
<pid name="velocities/vrp-v-down-fps">
<input>position/vrp-altitude-ft</input>
<kp>0.0</kp>
<ki>0.0</ki>
<kd>-1.0</kd>
</pid>
</channel>
</system>