Board index FlightGear Support Flying

Error message: "input is NaN"  Topic is solved

Controlling your aircraft, using the autopilot etc.

Error message: "input is NaN"

Postby dg-505 » Thu Nov 09, 2017 4:17 pm

Hi there,

when I start my JSBSim variant of the DHC-6 Twin Otter, the log file and the console output in the terminal get spammed with these error messages:

Console output:
Code: Select all
input is NaN.


fgfs.log:
Code: Select all
autopilot:5:/build/flightgear-5xbSS6/flightgear-2017.4.0~13143+git02ceb8832/src/Autopilot/inputvalue.cxx:209:input is NaN.



This spams the log and the terminal with literally thousands of lines until FG crashes.
It writes this line in the log over 3000 times in about one minute :shock:

So my question would be, what have I to do that I don't get these errors?
However, with the Yasim version I don't get them.

Thanks in advance
Jonathan

Edit:
If needed, I can put online a copy of the JSBSim variant.
I don't want to push it to FGAddon already because it breaks quite a number of things in the existing Yasim version...
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"

Postby wlbragg » Thu Nov 09, 2017 4:22 pm

If that is what I think it is, it might be that your creating property definitions after they are being used initially.

What I'm talking about happens when you define a property in a ancillary xml instead of the -set xml.

I would need to see the code and errors to be sure.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Error message: "input is NaN"

Postby dg-505 » Thu Nov 09, 2017 5:09 pm

Due to the log output I believe that it has something to do with the autopilot...

Well, here's the current state: (watch out, 130MB)
https://drive.google.com/file/d/1Q6QH6qLFKBvt-CuOgPdULYqUkc2IqWfr/view?usp=sharing
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"

Postby Thorsten » Thu Nov 09, 2017 5:20 pm

A JSBSim tag evaluation resulting in a NaN probably? Trigonometry usually does the trick, like calling an arcsin with an argument > 1.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Error message: "input is NaN"

Postby wlbragg » Thu Nov 09, 2017 6:21 pm

Well, here's the current state: (watch out, 130MB)

I always get a kick out of that line, it took all of 1.5 second to download. I am really old school when we were really styling it with a 10 meg hard drive. I can't even count that small now. :lol:

I'll take a look.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Error message: "input is NaN"

Postby dg-505 » Thu Nov 09, 2017 6:39 pm

Hehe, you're right, 130 MB are nothing these days :lol:

But there are guys around here with a slow/expensive internet connection....
and I just took a look: This aircraft has the biggest file size of all official FG aircraft :shock::
http://fgfs.goneabitbursar.com/official/?C=S;O=D
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"

Postby wlbragg » Thu Nov 09, 2017 6:51 pm

Wow, not so simple. I don't necessarily think it is the "autopilot" per-se. I think that error is referring to the autopilot system and in creation of property-rule's. I tried commenting out suspected property rules to narrow it down, but that is hit or miss and can lead to many other issues. It did pretty much eliminate the "autopilot" though as with it removed you still get NaN errors.

I'm inclined to think Thorsten is closer to the issue than what I thought it might be.

Any way you can narrow it down as to when the error crept in and what you were working on?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Error message: "input is NaN"

Postby dg-505 » Thu Nov 09, 2017 7:02 pm

Well, I started working on this version about one year ago, there this error didn't occur.

Then I made a pause since January or February and last week I started again. Then I got surprised by these messages.

I googled for this error message and it led me to a commit, TorstenD pushed this July. I believe there this message got introduced:
https://sourceforge.net/p/flightgear/flightgear/ci/169b0f59e54b595b7dc4cbc7625673bdda5987d8/

Hope this helps
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"

Postby Thorsten » Thu Nov 09, 2017 7:06 pm

The commit is unlikely to have created the NaN, it looks like it merely affects the way it is handled. JSBSim usually handles NaN results gracefully, but here it seems they are used is input for an autopilot definition, which then is de-railed.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Error message: "input is NaN"

Postby dg-505 » Thu Nov 09, 2017 7:24 pm

Did also some commenting out:
If I comment out line 329 to 332 in dhc6jsb.xml (the system files) and the whole "systems" section (line 102 - 129) in dhc6jsb-set.xml, then this error doesn't occur.

Now the task is to find out what system causes the error



Thorsten wrote in Thu Nov 09, 2017 7:06 pm:The commit is unlikely to have created the NaN, it looks like it merely affects the way it is handled

Well, you're right. But as far as I understand it, this commit is the reason that the error is printed in the terminal and log
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"

Postby bugman » Thu Nov 09, 2017 8:31 pm

dg-505 wrote in Thu Nov 09, 2017 7:24 pm:
Thorsten wrote in Thu Nov 09, 2017 7:06 pm:The commit is unlikely to have created the NaN, it looks like it merely affects the way it is handled

Well, you're right. But as far as I understand it, this commit is the reason that the error is printed in the terminal and log


Better debugging printouts have a tendency to highlight previously unseen bugs, which is not such a bad thing ;)

Regards,
Edward
bugman
Moderator
 
Posts: 1808
Joined: Thu Mar 19, 2015 10:01 am
Version: next

Re: Error message: "input is NaN"

Postby dg-505 » Thu Nov 09, 2017 8:36 pm

I dont't see it as a bad thing in general, quite the opposite; but nevertheless it causes me quite a headache :wink: :lol:
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"

Postby wkitty42 » Fri Nov 10, 2017 2:19 am

finding ignored problems is, generally speaking, a headache, yes... better to find the problems and fix them than to assume that everything is alright when it is not ;)
"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: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Error message: "input is NaN"

Postby dg-505 » Mon Nov 13, 2017 7:18 pm

Okay, I think I've got one step further!

Seems that fdm/jsbsim/propulsion/engine[0]/itt-c gets calculated wrongly:
Image



Strangely, for the engine[1] there is a number.
Can anyone give me a hint how itt-c gets calculated?

Thanks
Jonathan
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Re: Error message: "input is NaN"  

Postby dg-505 » Mon Nov 13, 2017 8:29 pm

Yay, seems that I got it!

In the engine definition file "itt_delay" MUST NOT be 0.0
That seems to cause the NaN error

Thanks for all your help! :D
Jonathan
A mile of road will take you a mile, but a mile of runway will take you everywhere.

DHC-6 Twin Otter development
User avatar
dg-505
 
Posts: 677
Joined: Mon Jun 02, 2014 3:36 pm
Location: Bonn, Germany
Callsign: dg-505
Version: next
OS: Ubuntu 20.04.4 LTS

Next

Return to Flying

Who is online

Users browsing this forum: No registered users and 2 guests