|
From: <fli...@li...> - 2020-07-19 13:33:02
|
Revision: 5052
http://sourceforge.net/p/flightgear/fgaddon/5052
Author: dnxkt
Date: 2020-07-19 13:32:59 +0000 (Sun, 19 Jul 2020)
Log Message:
-----------
Dragonfly:
(1) Bridle hook animation
(2) Add 'Hook View'
(3) Bug fix bridle/towrope flickering
Modified Paths:
--------------
trunk/Aircraft/Dragonfly/Dragonfly-jsbsim.xml
trunk/Aircraft/Dragonfly/Dragonfly-set.xml
trunk/Aircraft/Dragonfly/Models/Banner/Banner.xml
trunk/Aircraft/Dragonfly/Models/TowSystem/TowSystem.xml
trunk/Aircraft/Dragonfly/Models/dragonfly.xml
trunk/Aircraft/Dragonfly/Nasal/TowSystem.nas
trunk/Aircraft/Dragonfly/Systems/banner.xml
Modified: trunk/Aircraft/Dragonfly/Dragonfly-jsbsim.xml
===================================================================
--- trunk/Aircraft/Dragonfly/Dragonfly-jsbsim.xml 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Dragonfly-jsbsim.xml 2020-07-19 13:32:59 UTC (rev 5052)
@@ -910,6 +910,19 @@
</direction>
</force>
+ <force name="banner" frame="BODY" unit="LBS" >
+ <location unit="M">
+ <x> 0.0</x>
+ <y> 0.0</y>
+ <z> 0.0</z>
+ </location>
+ <direction>
+ <x>0.0</x>
+ <y>0.0</y>
+ <z>0.0</z>
+ </direction>
+ </force>
+
<force name="parachute" frame="WIND">
<function>
<product>
@@ -932,7 +945,7 @@
<z>0.0</z>
</direction>
</force>
-
+
</external_reactions>
<system file="dragonfly-instruments"/>
@@ -939,5 +952,5 @@
<system file="dragonfly-systems"/>
<system file="BRS"/>
<system file="banner"/>
-
+
</fdm_config>
Modified: trunk/Aircraft/Dragonfly/Dragonfly-set.xml
===================================================================
--- trunk/Aircraft/Dragonfly/Dragonfly-set.xml 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Dragonfly-set.xml 2020-07-19 13:32:59 UTC (rev 5052)
@@ -167,9 +167,10 @@
<float n="9" alias="/sim/model/banner/beta-deg"/>
<float n="10" alias="/sim/model/wind-speed-stage2"/>
<float n="11" alias="/sim/model/wind-integrator"/>
- <float n="12" alias="/sim/model/fuel-tank-effect/pitch-rad"/>
- <float n="13" alias="/sim/model/fuel-tank-effect/roll-rad"/>
- <float n="14" alias="/controls/flight/aileron"/>
+ <float n="12" alias="/consumables/fuel/tank[0]/level-norm-untied"/>
+ <float n="13" alias="/sim/model/fuel-tank-effect/pitch-rad"/>
+ <float n="14" alias="/sim/model/fuel-tank-effect/roll-rad"/>
+ <float n="15" alias="/controls/flight/aileron"/>
</generic>
</multiplay>
<model>
@@ -291,7 +292,24 @@
<z-offset-m archive="y">-1.4341</z-offset-m>
</config>
</view>
-
+
+ <view n="102">
+ <name>Hook View</name>
+ <type>lookfrom</type>
+ <internal archive="y">true</internal>
+ <enabled type="bool">false</enabled>
+ <config>
+ <from-model type="bool">true</from-model>
+ <from-model-idx type="int">0</from-model-idx>
+ <default-field-of-view-deg type="double">55</default-field-of-view-deg>
+ <pitch-offset-deg>0</pitch-offset-deg>
+ <heading-offset-deg type="double">90.</heading-offset-deg>
+ <x-offset-m archive="y">6.</x-offset-m>
+ <y-offset-m archive="y">-0.06759</y-offset-m>
+ <z-offset-m archive="y">3.</z-offset-m>
+ </config>
+ </view>
+
<checklists include="dragonfly-checklists.xml"/>
<systems>
<path>Aircraft/Dragonfly/Systems/systems.xml</path>
@@ -515,6 +533,14 @@
</engines>
<fdm>
<jsbsim>
+ <external_reactions>
+ <hitch>
+ <magnitude type="double">0.</magnitude>
+ <x type="double">0.</x>
+ <y type="double">0.</y>
+ <z type="double">0.</z>
+ </hitch>
+ </external_reactions>
<systems>
<chute>
<chute-cmd-norm type="bool">0</chute-cmd-norm>
Modified: trunk/Aircraft/Dragonfly/Models/Banner/Banner.xml
===================================================================
--- trunk/Aircraft/Dragonfly/Models/Banner/Banner.xml 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Models/Banner/Banner.xml 2020-07-19 13:32:59 UTC (rev 5052)
@@ -20,7 +20,7 @@
<effect>
<inherits-from>Aircraft/Dragonfly/Models/Effects/banner</inherits-from>
-z <parameters>
+ <parameters>
<attachment-x-m type="float">7.43322</attachment-x-m>
</parameters>
<object-name>rect</object-name>
Modified: trunk/Aircraft/Dragonfly/Models/TowSystem/TowSystem.xml
===================================================================
--- trunk/Aircraft/Dragonfly/Models/TowSystem/TowSystem.xml 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Models/TowSystem/TowSystem.xml 2020-07-19 13:32:59 UTC (rev 5052)
@@ -123,7 +123,7 @@
<animation>
<type>translate</type>
<object-name>bridle_segment2</object-name>
- <offset-m>-0.5</offset-m>
+ <offset-m>-0.565</offset-m>
<axis>
<x>1</x>
<y>0</y>
@@ -133,7 +133,7 @@
<animation>
<type>translate</type>
<object-name>bridle_segment2</object-name>
- <offset-m>0.14</offset-m>
+ <offset-m>0.115</offset-m>
<axis>
<x>0</x>
<y>0</y>
Modified: trunk/Aircraft/Dragonfly/Models/dragonfly.xml
===================================================================
--- trunk/Aircraft/Dragonfly/Models/dragonfly.xml 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Models/dragonfly.xml 2020-07-19 13:32:59 UTC (rev 5052)
@@ -943,6 +943,68 @@
</center>
</animation>
+ <!-- bridle hook -->
+ <animation>
+ <type>rotate</type>
+ <object-name>ReleaseArm</object-name>
+ <property>controls/hook-lever-open</property>
+ <factor>-20.</factor>
+ <axis>
+ <x>0.0</x>
+ <y>1.0</y>
+ <z>0.0</z>
+ </axis>
+ <center>
+ <x-m>3.0576</x-m>
+ <y-m>0</y-m>
+ <z-m>-0.6266</z-m>
+ </center>
+ </animation>
+
+ <animation>
+ <type>scale</type>
+ <object-name>ReleaseSpring</object-name>
+ <property>controls/hook-lever-open</property>
+ <x-factor>-0.7</x-factor>
+ <y-factor>1.</y-factor>
+ <z-factor>1.</z-factor>
+ <x-min>0.</x-min>
+ <y-min>1.0</y-min>
+ <z-min>1.</z-min>
+ <x-offset>1</x-offset>
+ <!--
+ <x-min>0.9890</x-min>
+ <y-min>1.0</y-min>
+ <z-min>0.1478</z-min>
+ -->
+ <center>
+ <x-m>3.0361</x-m>
+ <y-m>0</y-m>
+ <z-m>-0.5920</z-m>
+ </center>
+ </animation>
+
+ <animation>
+ <type>rotate</type>
+ <object-name>ReleaseHook</object-name>
+ <property>sim/hitches/aerotow/bridle/exist</property>
+ <interpolation>
+ <entry><ind>0</ind><dep> 0.</dep></entry>
+ <entry><ind>1</ind><dep> 0.</dep></entry>
+ <entry><ind>2</ind><dep>210.</dep></entry>
+ </interpolation>
+ <axis>
+ <x>0.0</x>
+ <y>1.0</y>
+ <z>0.0</z>
+ </axis>
+ <center>
+ <x-m>3.0923</x-m>
+ <y-m>0</y-m>
+ <z-m>-0.6175</z-m>
+ </center>
+ </animation>
+
<!--<animation>
<type>rotate</type>
<object-name>Throttle</object-name>
@@ -960,5 +1022,4 @@
</center>
</animation>-->
-
</PropertyList>
Modified: trunk/Aircraft/Dragonfly/Nasal/TowSystem.nas
===================================================================
--- trunk/Aircraft/Dragonfly/Nasal/TowSystem.nas 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Nasal/TowSystem.nas 2020-07-19 13:32:59 UTC (rev 5052)
@@ -1,7 +1,7 @@
var HitchAnimation = func {
#
# ---------------------------------------------------------------------------------
-# Bridle Animation Status: 14.06.2020
+# Bridle Animation Status: 19.07.2020
# ---------------------------------------------------------------------------------
#
var hitchname = getprop("sim/hitches/aerotow/force_name_jsbsim");
@@ -126,6 +126,12 @@
setprop("fdm/jsbsim/external_reactions/" ~ hitchname~ "/location-y-in", hitch_location_y_m * M2IN);
setprop("fdm/jsbsim/external_reactions/" ~ hitchname~ "/location-z-in", hitch_location_z_m * M2IN);
+ if( getprop("sim/model/banner-on-hook") ){
+ setprop("fdm/jsbsim/external_reactions/banner/location-x-in", hitch_location_x_m * M2IN);
+ setprop("fdm/jsbsim/external_reactions/banner/location-y-in", hitch_location_y_m * M2IN);
+ setprop("fdm/jsbsim/external_reactions/banner/location-z-in", hitch_location_z_m * M2IN);
+ }
+
# hitch location for towrope animation is automatically set by towing function
# but needed for banner-mp
if( getprop("sim/model/banner-on-hook") ){
@@ -146,8 +152,8 @@
# Fake lower bridle segment:
# Use lower hitch at Dragonfly instead of focus f2
# ----- Input from Dragonfly model (Model-System) -----
- var lower_hitch_x_m = 3.15;
- var lower_hitch_z_m = -0.58;
+ var lower_hitch_x_m = 3.085;
+ var lower_hitch_z_m = -0.605;
# -----------------------------------------------------
var dist_x_m = hitch_location_x_m - lower_hitch_x_m;
var dist_y_m = hitch_location_y_m;
@@ -169,18 +175,18 @@
setprop("sim/hitches/aerotow/bridle/bridle_beta_segment2-deg", s2_beta_deg);
#-------------------------------------------------------------------------------------------------------
- # Workaround:
- # FG crashes when writing to fdm/jsbsim/external_reactions/hitch/x inside JSBSim
+ # Workaround:
+ # FG crashes when writing to fdm/jsbsim/external_reactions/banner/x inside JSBSim
#(x calculated in a fcs_function)
# Writing from NASAL is working!
if( getprop("sim/model/banner-on-hook") ){
#print("Banner towing");
- setprop("fdm/jsbsim/external_reactions/hitch/x",
- getprop("fdm/jsbsim/external_reactions/hitch/xx") );
- setprop("fdm/jsbsim/external_reactions/hitch/y",
- getprop("fdm/jsbsim/external_reactions/hitch/yy") );
- setprop("fdm/jsbsim/external_reactions/hitch/z",
- getprop("fdm/jsbsim/external_reactions/hitch/zz") );
+ setprop("fdm/jsbsim/external_reactions/banner/x",
+ getprop("fdm/jsbsim/external_reactions/banner/xx") );
+ setprop("fdm/jsbsim/external_reactions/banner/y",
+ getprop("fdm/jsbsim/external_reactions/banner/yy") );
+ setprop("fdm/jsbsim/external_reactions/banner/z",
+ getprop("fdm/jsbsim/external_reactions/banner/zz") );
}
#-------------------------------------------------------------------------------------------------------
@@ -193,7 +199,7 @@
################################################################################################
#
-# bridle deflection due to aero, gravity and tow force
+# bridle deflection due to aero, gravity and tow/banner force
#
################################################################################################
@@ -251,16 +257,26 @@
var fz_due_to_aero_lbs = - f_vt2 * vz_m_s*math.abs(vz_m_s) *M2FT*M2FT;
#----------------------------------------------------------------------
- # forces on bridle due to banner (banner drag) or towrope (aero-towing)
+ # forces on bridle due to towrope (aero-towing)
var magnitude = getprop("fdm/jsbsim/external_reactions/hitch/magnitude");
# force: fx-> nose / fy -> right wing / fz -> down (JSBSim body-frame)
var fx_due_to_towrope_lbs = getprop("fdm/jsbsim/external_reactions/hitch/x")*magnitude;
var fy_due_to_towrope_lbs = getprop("fdm/jsbsim/external_reactions/hitch/y")*magnitude;
var fz_due_to_towrope_lbs = getprop("fdm/jsbsim/external_reactions/hitch/z")*magnitude;
+#print("towsystem: towrope magnitude= ", magnitude);
- var fx_total_lbs = fx_due_to_acceleration_lbs + fx_due_to_aero_lbs + fx_due_to_towrope_lbs;
- var fy_total_lbs = fy_due_to_acceleration_lbs + fy_due_to_aero_lbs + fy_due_to_towrope_lbs;
- var fz_total_lbs = fz_due_to_acceleration_lbs + fz_due_to_aero_lbs + fz_due_to_towrope_lbs;
+ #----------------------------------------------------------------------
+ # forces on bridle due to banner (banner drag)
+ var magnitude = getprop("fdm/jsbsim/external_reactions/banner/magnitude");
+ # force: fx-> nose / fy -> right wing / fz -> down (JSBSim body-frame)
+ var fx_due_to_banner_lbs = getprop("fdm/jsbsim/external_reactions/banner/x")*magnitude;
+ var fy_due_to_banner_lbs = getprop("fdm/jsbsim/external_reactions/banner/y")*magnitude;
+ var fz_due_to_banner_lbs = getprop("fdm/jsbsim/external_reactions/banner/z")*magnitude;
+#print("towsystem: banner magnitude= ", magnitude);
+
+ var fx_total_lbs = fx_due_to_acceleration_lbs + fx_due_to_aero_lbs + fx_due_to_towrope_lbs + fx_due_to_banner_lbs;
+ var fy_total_lbs = fy_due_to_acceleration_lbs + fy_due_to_aero_lbs + fy_due_to_towrope_lbs + fy_due_to_banner_lbs;
+ var fz_total_lbs = fz_due_to_acceleration_lbs + fz_due_to_aero_lbs + fz_due_to_towrope_lbs + fz_due_to_banner_lbs;
var fxy_total_lbs = math.sqrt(fx_total_lbs*fx_total_lbs + fy_total_lbs*fy_total_lbs);
var alpha_bridle_deg = math.atan2(-fz_total_lbs,fxy_total_lbs) * R2D;
Modified: trunk/Aircraft/Dragonfly/Systems/banner.xml
===================================================================
--- trunk/Aircraft/Dragonfly/Systems/banner.xml 2020-07-19 09:24:52 UTC (rev 5051)
+++ trunk/Aircraft/Dragonfly/Systems/banner.xml 2020-07-19 13:32:59 UTC (rev 5052)
@@ -1,9 +1,12 @@
<?xml version="1.0"?>
<system name="Banner">
+ <property value="0.0">external_reactions/banner/magnitude</property>
+
<channel name="banner">
+ <!-- <channel name="banner" execute="/sim/model/banner-on-hook"> -->
- <fcs_function name="external_reactions/hitch/magnitude"> <!-- lbs -->
+ <fcs_function name="external_reactions/banner/magnitude"> <!-- lbs -->
<function>
<description>Drag_due_to_banner</description>
<product>
@@ -13,7 +16,7 @@
</product>
</function>
</fcs_function>
-
+
<fcs_function name="systems/banner/deflection_aero">
<function>
<description>weighting factor for banner deflection due to aero and gravity
@@ -30,7 +33,7 @@
</min>
</function>
</fcs_function>
-
+
<fcs_function name="systems/banner/dir-x">
<function>
<description>x-direction (not yet normalized)</description>
@@ -48,7 +51,7 @@
</sum>
</function>
</fcs_function>
-
+
<fcs_function name="systems/banner/dir-y">
<function>
<description>y-direction (not yet normalized)</description>
@@ -66,7 +69,7 @@
</sum>
</function>
</fcs_function>
-
+
<fcs_function name="systems/banner/dir-z">
<function>
<description>z-direction (not yet normalized)</description>
@@ -84,7 +87,7 @@
</sum>
</function>
</fcs_function>
-
+
<fcs_function name="systems/banner/dir-xy">
<function>
<description>abs xy-direction</description>
@@ -102,7 +105,7 @@
</sqrt>
</function>
</fcs_function>
-
+
<fcs_function name="systems/banner/alpha-deg">
<function>
<description>alpha for banner animation</description>
@@ -115,7 +118,7 @@
</function>
<output>/sim/model/banner/alpha-deg</output>
</fcs_function>
-
+
<fcs_function name="systems/banner/beta-deg">
<function>
<description>beta for banner animation</description>
@@ -128,8 +131,8 @@
</function>
<output>/sim/model/banner/beta-deg</output>
</fcs_function>
-
- <fcs_function name="external_reactions/hitch/xx">
+
+ <fcs_function name="external_reactions/banner/xx">
<function>
<description>Normalized force x-direction</description>
<quotient>
@@ -138,8 +141,8 @@
</quotient>
</function>
</fcs_function>
-
- <fcs_function name="external_reactions/hitch/yy">
+
+ <fcs_function name="external_reactions/banner/yy">
<function>
<description>Normalized force y-direction</description>
<quotient>
@@ -148,8 +151,8 @@
</quotient>
</function>
</fcs_function>
-
- <fcs_function name="external_reactions/hitch/zz">
+
+ <fcs_function name="external_reactions/banner/zz">
<function>
<description>Normalized force z-direction</description>
<quotient>
@@ -160,5 +163,5 @@
</fcs_function>
</channel>
-
+
</system>
|