Board index FlightGear Development Spaceflight

Space Shuttle - Development

Discussion about development and usage of spacecraft

Re: Space Shuttle - Development

Postby Thorsten » Wed Nov 20, 2019 12:20 pm

A lot of scripts, and the FDM takes significantly more than 5 seconds to init... The whole craft takes a good 3 minutes to load. But I'm not looking for a hack here, I'm looking for an understanding of the root cause.
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle - Development

Postby Necolatis » Wed Nov 20, 2019 1:14 pm

I got curious and took a look, why have lines like this:

Code: Select all
var xtrack = SpaceShuttle.sgeo_crosstrack(actual_course, launch_azimuth, dist)  * 0.0005399568;


Its the same as having:

Code: Select all
var xtrack = sgeo_crosstrack(actual_course, launch_azimuth, dist)  * 0.0005399568;


..since they are in same namespace, all vars in <SpaceShuttle> is directly accessible.

var n = 0; In one nasal file will just be 'n' also in your other files.

Is it just for tidiness, or to be 100% to not call anything in $fgdata/Nasal?

PS. The reason I wait for fdm initialized is that I am 100% all my nasal files have been parsed and ran, when that signal happens.

PPS. If you rely on the order the files are listed in xml, I am not sure you can be 100% they always run in that order, at least not anymore. I had some trouble with that, and started calling all from central place in the correct order (after fdm signal). But I also use separate namespaces for almost every file, maybe that's why, don't know.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2077
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Space Shuttle - Development

Postby Thorsten » Wed Nov 20, 2019 2:09 pm

I got curious and took a look, why have lines like this:


Habits acquired from C++ coding - generally it's considered good style to explicitly reference the namespace.

If you rely on the order the files are listed in xml, I am not sure you can be 100% they always run in that order,


I don't think I do - usually init calls are below the definition of the hash in the same file, so the hash should be parsed regardless of the order in which files are read,

Anyway - the error is not that the hash is not found (which I would understand if parsing were not complete for some reason) but that the member function of the hash is not found. This is akin to incomplete parsing.
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle - Development

Postby legoboyvdlp » Wed Nov 20, 2019 4:23 pm

I had trouble earlier where the same vector in my class was used for each instance; I had to manually ensure that each object created its own vector - may be another symptom; anyway this is certainly extremely mysterious and it's going to be a pain to debug as it's not reproducible...

@eatdirt are you able to compile FG or are you using nightlies?
User avatar
legoboyvdlp
 
Posts: 7403
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: next
OS: Windows 10 HP

Re: Space Shuttle - Development

Postby Thorsten » Wed Nov 20, 2019 5:28 pm

I had trouble earlier where the same vector in my class was used for each instance; I had to manually ensure that each object created its own vector


That just sounds like the difference between call by reference and call by value. Variables in Nasal are called by value, but vectors by reference - which is less explicit than in C++.

But that would not be a problem unique to a single user.
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle - Development

Postby eatdirt » Thu Nov 21, 2019 10:31 pm

@lego, yes, I am compiling it myself, in fact, I am using (and contributing) to the mageia specfile for flightgear.

Thanks for the info on the devel list, we were indeed missing a DCMAKE_BUILD_TYPE in addition to the DFG_BUILT_TYPE. But fixing it, and setting them both to Release, did not change anything. I have also spotted that ENABLE_SIMD is ON by default and override any other compilation option with some -O3 -sseX thing, but even reverting to safer -O2 does not help our issues. That should be something explicitly coded; and not some side compilation-related effects.
eatdirt
 
Posts: 495
Joined: Wed Aug 15, 2018 2:06 pm

Re: Space Shuttle - Development

Postby Hooray » Sun Nov 24, 2019 2:25 pm

Thorsten wrote in Tue Nov 19, 2019 7:15 am:
Code: Select all
Nasal runtime error: No such member: new

These are really worrisome - they'd be a sign of Nasal memory corruption of sorts. Basically the instruction finds an object with the correct name of the hash that contains the class in question, but that object is not actually a hash, so it has no instancing member function new().


Note that new is not really a keyword in Nasal, so it has nothing to do with OOP necessarily, it just says that it cannot find the member "new" inside the hash.
As far as I know there has been some GC work, I would suggest to to review the commit logs, and #ifdef those changes or add a runtime flag, so that the new code paths can be optionally disabled, to see if they are related or not.

I believe that both, Richard and James previously reported GC related work ?
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11603
Joined: Tue Mar 25, 2008 8:40 am

Re: Space Shuttle - Development

Postby Thorsten » Mon Nov 25, 2019 4:35 pm

I have a hunch why I didn't implement the interconnect valves before... Cross-feeding with gaseous manifolds is... ridiculously complex. There's situations like 'valve is open, but pressure differential prevents flow' or 'engine stops working and needs no longer helium purge' which all in principle would need to be considered.

So we're going for a simplified scheme that will solve single failures. :(
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle - Development

Postby GinGin » Mon Nov 25, 2019 5:22 pm

Mmm indeed .
Helium sub system is quite a thing.

I would say as long as we can simply simulate with the interconnect switches a cross feed from an engine to another of helium if one lost its helium system and we can avoid an engine failure, It can be already very interesting
GinGin
 
Posts: 918
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby Thorsten » Tue Nov 26, 2019 5:35 pm

Meh... I have a sort of working solution, but it makes me unhappy. So I'll start from scratch and do it properly.

Sometimes it sucks to be a perfectionist....
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle - Development

Postby wlbragg » Tue Nov 26, 2019 6:13 pm

@Thorsten, did you ever finish the F-16, Shuttle Approach AI scenario and push it anywhere? That looks like a lot of fun!
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 5235
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: Space Shuttle - Development

Postby Thorsten » Tue Nov 26, 2019 6:27 pm

It's on FGData - though it didn't actually 'finish' - the last few hundred meters are missing.
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

Re: Space Shuttle - Development

Postby GinGin » Tue Nov 26, 2019 7:09 pm

I have a sort of working solution, but it makes me unhappy. So I'll start from scratch and do it properly.

Sometimes it sucks to be a perfectionist....


Ahah indeed.
That reminds me the dimming of screens with fuel celll failure. Small details that make a sim great :)


@Wayne: Do you think it is possible to have some attachment points on Hubble to Grapple it and put it back to the bay ? :)
GinGin
 
Posts: 918
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

Re: Space Shuttle - Development

Postby wkitty42 » Wed Nov 27, 2019 2:13 am

i'm consistently getting the following with the latest shuttle dev repo and the latest FG next repo...
Code: Select all
  233.50 [ALRT]:nasal      Applying theme: PAD
  497.54 [ALRT]:nasal      Applying theme: SRB
  499.80 [ALRT]:nasal      Nasal runtime error: floating point error in math.asin()
  499.80 [ALRT]:nasal        at /home/wkitty42/myflightgear/Aircraft/SpaceShuttle/Nasal/stages.nas, line 954
  499.80 [ALRT]:nasal        called from: /home/wkitty42/myflightgear/Aircraft/SpaceShuttle/Nasal/failures.nas, line 39
  499.80 [ALRT]:nasal        called from: /home/wkitty42/myflightgear/Aircraft/SpaceShuttle/Nasal/limits.nas, line 118
  499.80 [ALRT]:nasal        called from: /home/wkitty42/myflightgear/Aircraft/SpaceShuttle/Nasal/stages.nas, line 553
  500.46 [ALRT]:nasal      Reading i-loaded stage 2 trajectory display data.


i'd like to get more data from the code output to my console but don't really know where to start with this craft to do that... i'm running a Dev/RelWithDebInfo build... i could switch back to a Dev/Debug build if that would already provide more logging...

Code: Select all
** Build Info: **
***********************************************************************
PLib:    a542b8a03f8de1fe844af6ab4734b64d11e272e9
OSG 3.6: 415925b024ba28ae6f6cc8d066ee7ea139df0cd8
Simgear: d5957b8c5f2188674eb6b3d480bd8eb70d253f79
FGFS:    2f5edf6558d48d925484929bbf32c1b6da7f53c8
FGData:  1e7a0beb9abb148d4500a6ed63f2f3bb2df87ded
FGAddon: r4334 | helijah | 2019-11-25 11:22:57 -0500 (Mon, 25 Nov 2019)
SpaceShuttle:  fa590b1f8101aadf8fa3f9b667d234dc5d276613
***********************************************************************
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6139
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Space Shuttle - Development

Postby Thorsten » Wed Nov 27, 2019 6:12 am

i'm consistently getting the following with the latest shuttle dev repo and the latest FG next repo.


That seems to be SRB-separation.

What are the values of

/ai/models/ballistic[0]/orientation/hdg-deg
/ai/models/ballistic[0]/orientation/pitch-deg
/ai/models/ballistic[0]/orientation/roll-deg

at that point?

Also - is this a regression, i.e. does it work for you in older FG versions, or isit characteristic for your setup (I'm not seeing this on any of my setups).
Thorsten
 
Posts: 11469
Joined: Mon Nov 02, 2009 8:33 am

PreviousNext

Return to Spaceflight

Who is online

Users browsing this forum: No registered users and 1 guest