Re: [Flightgear-devel] working ridge lift !!

2009-06-02 Thread Maik Justus
Hi Mathias,

I have many of  these
> CullVisitor::apply(Geode&) detected NaN,
> depth=1.#QNAN, center=(7.62939e-006 2.32357 -311.612),
> matrix={
> -1.#IND -1.#IND -1.#IND -1.#IND
> -1.#IND -1.#IND -1.#IND -1.#IND
> -1.#IND -1.#IND -1.#IND -1.#IND
> -1.#IND -1.#IND -1.#IND -1.#IND
> }
messages (started long ago (before ridge lift). I just updated to OSG 
2.8.1 and set
OSG_NOTIFY_LEVEL=ALWAYS
and hoped to see the name of the scenegraph node. But he result was, 
that the messages disappeared totally by setting OSG_NOTIFY_LEVEL=ALWAYS.
By setting OSG_NOTIFY_LEVEL=NEVER the messages appeared again.

I am using the release version of OSG only.

Best regards,
Maik



Mathias Fröhlich schrieb am 25.04.2009 09:27:
> Hi Curt,
>
> On Thursday 23 April 2009 01:06:08 Curtis Olson wrote:
>   
>> I'm seeing a ton of these nan's when I start at KHAF ... it's just one or
>> two or three per frame, but that ends up spewing an awful lot of extra text
>> to my console.
>> 
>
> If you use todays OpenSceneGraph trunk, then, since friday there is an 
> extended error message when the CullVisitor steps on a NaN, then with the 
> environment vairable OSG_NOTIFY_LEVEL=ALWAYS you should get also the names of 
> the scnenegraph nodes that are taken to get to this NaN. So the chances are 
> better to get an idea where this problem originates.
>
> Greetings
>
> Mathaas
>
> --
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensign option that enables unlimited
> royalty-free distribution of the report engine for externally facing 
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
>   


--
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-25 Thread Mathias Fröhlich

Hi Curt,

On Thursday 23 April 2009 01:06:08 Curtis Olson wrote:
> I'm seeing a ton of these nan's when I start at KHAF ... it's just one or
> two or three per frame, but that ends up spewing an awful lot of extra text
> to my console.

If you use todays OpenSceneGraph trunk, then, since friday there is an 
extended error message when the CullVisitor steps on a NaN, then with the 
environment vairable OSG_NOTIFY_LEVEL=ALWAYS you should get also the names of 
the scnenegraph nodes that are taken to get to this NaN. So the chances are 
better to get an idea where this problem originates.

Greetings

Mathaas

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-24 Thread syd adams
Just updated and recompiled  looks good here , no more warnings
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-24 Thread Patrice Poly
> > > I just commited this patch with some changes:
> > >
> > > The properties probe_elev_m[0..4] were uninitialized and used in the
> > > Run() method before being initialized by a scan of the ground
> > > elevations. The first scan was performed after one second, so for the
> > > first second the probe_elev_m were used in an uninitialized state.
> > >
> > > I changed the timer behaviour to run the scan before the probe_elev_m
> > > values are used.
> > >
> > > To check, if this solves (and not hides) the nan issue, i commented out
> > > the line containing the isnan() check.
> > >
> > > Please report, if this works.
> > >
> > > Torsten
> > > I have just commited another change with a major code cleanup. It saves 
> > >a few 
> > >cpu cycles to gain some micro-frames-per-second.

This is very nice Torsten, I was quite lost. I really didn't find what where 
happening wrong, and I don't have such an understanding of the c++  to manage 
this.
Thats makes a good lesson to read you code .

My side, this behaves very good, without errors. The ridge lift lives as 
expected.

Congratulations, and many thanks for the big cleanup !

Patrice

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-24 Thread Torsten Dreyer
> Torsten Dreyer a écrit :
> > I just commited this patch with some changes:
> >
> > The properties probe_elev_m[0..4] were uninitialized and used in the
> > Run() method before being initialized by a scan of the ground elevations.
> > The first scan was performed after one second, so for the first second
> > the probe_elev_m were used in an uninitialized state.
> >
> > I changed the timer behaviour to run the scan before the probe_elev_m
> > values are used.
> >
> > To check, if this solves (and not hides) the nan issue, i commented out
> > the line containing the isnan() check.
> >
> > Please report, if this works.
> >
> > Torsten
>
> that works here, no more nan, and now time to cross the alps in glider :).
Great - thanks for testing!
I have just commited another change with a major code cleanup. It saves a few 
cpu cycles to gain some micro-frames-per-second.
If I broke anything, please announce.

>
> btw is there a particular reason why an unitialized state variable is
> more often "nan" than on other OS and platform?
> or is my ram more subject to cosmic ray attack?
I have no idea. But using uninitialized variables in C is like being in open 
sea in a small vessel: you are in gods hand ;-)

Torsten

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-24 Thread jean pellotier
Torsten Dreyer a écrit :
> I just commited this patch with some changes:
>
> The properties probe_elev_m[0..4] were uninitialized and used in the Run() 
> method before being initialized by a scan of the ground elevations.
> The first scan was performed after one second, so for the first second the 
> probe_elev_m were used in an uninitialized state.
>
> I changed the timer behaviour to run the scan before the probe_elev_m values 
> are used.
>
> To check, if this solves (and not hides) the nan issue, i commented out the 
> line containing the isnan() check.
>
> Please report, if this works.
>
> Torsten
>
>   
that works here, no more nan, and now time to cross the alps in glider :).

btw is there a particular reason why an unitialized state variable is 
more often "nan" than on other OS and platform?
or is my ram more subject to cosmic ray attack?
(here with debian SID 32bits on athlon XP 2800+ single core at 1.8GHz, 
2.5 G ram and nvidia 6200, gcc 4.3.3-5, kernel 2.6.26-1-686, SG, OSG 
Plib and FG all cvs or svn).
here's a screen where i got unitialised probe-elev-m, where 
probe-elev-m[4] is the killer, all the nan in other fields just 
propagated along the calculs to  freeze FG, starting by 
environment/ridge-lift-fps.

jano



--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-24 Thread Torsten Dreyer
I just commited this patch with some changes:

The properties probe_elev_m[0..4] were uninitialized and used in the Run() 
method before being initialized by a scan of the ground elevations.
The first scan was performed after one second, so for the first second the 
probe_elev_m were used in an uninitialized state.

I changed the timer behaviour to run the scan before the probe_elev_m values 
are used.

To check, if this solves (and not hides) the nan issue, i commented out the 
line containing the isnan() check.

Please report, if this works.

Torsten

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread syd adams
Just a note :
I applied the last patch posted here and success !
No more warnings so far ,with the 777-200, at least.
I'll try more.
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread syd adams
On Thu, Apr 23, 2009 at 12:29 PM, Alex Romosan wrote:

> syd adams  writes:
>
> > I tried this but no luck here  Im still getting this message
> > about every second:
> >
> > Warning: invalid line segment passed to
> IntersectVisitor::addLineSegment(..)
> >  nan nan 3.87514e+06 nan nan 3.85687e+06 segment ignored.
>
> i think this depends on the version of osg you are using. this
> particular warning comes from src/osgUtil/IntersectVisitor.cpp. can
> you try using a different version of osg? i use the latest from cvs and
> don't have any problems.
>
> --alex--
>

This is a completely fresh install of FG and OSG (svn)  from yesterday 
OSG version is 2.9.4 ...
I was getting this message before , and seemed to start when I tried the
first ridgelift patch ... but can't verify that for certain...
on an AMD Athalon 2800+ Nvidia Geforce 6200  ...
It doesn't appear to slow things down here , just make it hard to watch for
my own error messages .
I'll try out these new patches and see what happens
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly
udpated the patch again, with another Nan killer from jano.
That seems to have worked for him, at least

http://www.bentha.net/fgfs/ridge-lift/Environment.diff.bz2

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly
so here comes another attempt to reduce these error to silence :

line 238 :

if ( alt > 0.1 ) { probe_elev_m[i] =  alt; } else { probe_elev_m[i] = 0.1 ;};

lines 319-321 for desperate cases :

strength = lift_mps * SG_METER_TO_FEET ;
if(isnan(strength)) strength=0; 
_ridge_lift_fps_node->setDoubleValue( strength );

the diff is on :

http://www.bentha.net/fgfs/ridge-lift/Environment.diff.bz2 (updated)


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Alex Romosan
syd adams  writes:

> I tried this but no luck here  Im still getting this message
> about every second:
>
> Warning: invalid line segment passed to IntersectVisitor::addLineSegment(..)
>  nan nan 3.87514e+06 nan nan 3.85687e+06 segment ignored.

i think this depends on the version of osg you are using. this
particular warning comes from src/osgUtil/IntersectVisitor.cpp. can
you try using a different version of osg? i use the latest from cvs and
don't have any problems.

--alex--


-- 
| I believe the moment is at hand when, by a paranoiac and active |
|  advance of the mind, it will be possible (simultaneously with  |
|  automatism and other passive states) to systematize confusion  |
|  and thus to help to discredit completely the world of reality. |

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread syd adams
I tried this but no luck here  Im still getting this message about every
second:

Warning: invalid line segment passed to IntersectVisitor::addLineSegment(..)
 nan nan 3.87514e+06 nan nan 3.85687e+06 segment ignored.



> i tested :
> > _ridge_lift_fps_node->setDoubleValue( 0 );
> >
> > and no more nan, all the properties in ridge-lift are now valid.
> >
> > jano
>
--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Detlef Faber
Am Donnerstag, den 23.04.2009, 17:43 +0200 schrieb jean pellotier:
> Patrice Poly a écrit :
> > the fix, as a patch
> >
> > http://www.bentha.net/fgfs/ridge-lift/Environment.diff.bz2
> >
> > hope this works...
> >
> >   
> nope, same behaviour!!
> 
> i think that on my "slow" PC, your ridge lift is sometimes initialised a 
> little to early (while position is 0,0,0 maybe), resulting in some nan 
> in the result of terrain scan, wich lead to a "nan" in 
> /environment/ridge-lift-fps.
> 
> and as it's used to compute the next aircraft position, nan go all along 
> the calculs...
> 
> i tested :
> _ridge_lift_fps_node->setDoubleValue( 0 );
> 
> and no more nan, all the properties in ridge-lift are now valid.
> 
> jano
> 
> 
what is your OSG Version?

I've had tons of nans at startup of the bf109 and fw190. They stopped
once the Aircraft gained some speed and the rest of the flight was fine.
This started approximately at the time of the ambient update. My other
machine ran both Aircraft fine so I didn't bother much. Todays I updated
to 2.9.3 and all the startup nans were gone. 

> 
> --
> Stay on top of everything new and different, both inside and 
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today. 
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
-- 
Detlef Faber

http://www.sol2500.net/flightgear



--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Ron Jensen
On Thu, 2009-04-23 at 10:56 -0600, Ron Jensen wrote:
> On Thu, 2009-04-23 at 11:56 -0400, Patrice Poly wrote:
> > > nope, same behaviour!!
> > >
> > > i think that on my "slow" PC, your ridge lift is sometimes initialised a
> > > little to early (while position is 0,0,0 maybe), resulting in some nan
> > > in the result of terrain scan, wich lead to a "nan" in
> > > /environment/ridge-lift-fps.
> > >
> > > and as it's used to compute the next aircraft position, nan go all along
> > > the calculs...
> > >
> > > i tested :
> > > _ridge_lift_fps_node->setDoubleValue( 0 );
> > >
> > > and no more nan, all the properties in ridge-lift are now valid.
> > >
> > > jano
> > 
> > Jano, may I ask you to do a little experiment ?
> > 
> > As you have a machine which triggers the error, maybe you could try this:
> > 
> > comment out all the formulas, and replace them by a nice constant, all over 
> > the file.
> > Then, from bottom to top, and one by one, put the original calculations 
> > back.
> > 
> > Maybe that could help focus on the one that produces the bad thing ?
> > 
> > 
> > Then, you could also try the following ?
> > 
> > line 231 :  if (timer >= 1.0 ) {
> > 
> > this waits 1 second before doing a scan, maybe
> > * this could be raised to a longer time ?
> > * this could be replaced by something that tells us for sure the scenery is 
> > here,the plane is placed,  and that get_elevation_m is ready to work ?
> > 
> > I'm blind here for these experiments...
> 
> Adding a test for NaN will prevent (or at least mask) the problem:
> 
>   strength = lift_mps * SG_METER_TO_FEET ;
>   if(isnan(strength)) strength=0; 
>   _ridge_lift_fps_node->setDoubleValue( strength );
> 
> 
> We could add some debug printing, too perhaps:


if(isnan(strength)){
   SG_LOG( SG_EVENT, SG_ALERT, "Ridge lift strength is NaN = " << strength 
);
   strength=0;
}
_ridge_lift_fps_node->setDoubleValue( strength );


SG_LOG is preferred over cout...

Ron



--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Ron Jensen
On Thu, 2009-04-23 at 11:56 -0400, Patrice Poly wrote:
> > nope, same behaviour!!
> >
> > i think that on my "slow" PC, your ridge lift is sometimes initialised a
> > little to early (while position is 0,0,0 maybe), resulting in some nan
> > in the result of terrain scan, wich lead to a "nan" in
> > /environment/ridge-lift-fps.
> >
> > and as it's used to compute the next aircraft position, nan go all along
> > the calculs...
> >
> > i tested :
> > _ridge_lift_fps_node->setDoubleValue( 0 );
> >
> > and no more nan, all the properties in ridge-lift are now valid.
> >
> > jano
> 
> Jano, may I ask you to do a little experiment ?
> 
> As you have a machine which triggers the error, maybe you could try this:
> 
> comment out all the formulas, and replace them by a nice constant, all over 
> the file.
> Then, from bottom to top, and one by one, put the original calculations back.
> 
> Maybe that could help focus on the one that produces the bad thing ?
> 
> 
> Then, you could also try the following ?
> 
> line 231 :if (timer >= 1.0 ) {
> 
> this waits 1 second before doing a scan, maybe
> * this could be raised to a longer time ?
> * this could be replaced by something that tells us for sure the scenery is 
> here,the plane is placed,  and that get_elevation_m is ready to work ?
> 
> I'm blind here for these experiments...

Adding a test for NaN will prevent (or at least mask) the problem:

  strength = lift_mps * SG_METER_TO_FEET ;
  if(isnan(strength)) strength=0; 
  _ridge_lift_fps_node->setDoubleValue( strength );


We could add some debug printing, too perhaps:

  strength = lift_mps * SG_METER_TO_FEET ;
  if(isnan(strength)){
 strength=0; 
 cout << /* whatever variables we need */ << endl;
  } 
  _ridge_lift_fps_node->setDoubleValue( strength );

Ron




--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly
> nope, same behaviour!!
>
> i think that on my "slow" PC, your ridge lift is sometimes initialised a
> little to early (while position is 0,0,0 maybe), resulting in some nan
> in the result of terrain scan, wich lead to a "nan" in
> /environment/ridge-lift-fps.
>
> and as it's used to compute the next aircraft position, nan go all along
> the calculs...
>
> i tested :
> _ridge_lift_fps_node->setDoubleValue( 0 );
>
> and no more nan, all the properties in ridge-lift are now valid.
>
> jano

Jano, may I ask you to do a little experiment ?

As you have a machine which triggers the error, maybe you could try this:

comment out all the formulas, and replace them by a nice constant, all over 
the file.
Then, from bottom to top, and one by one, put the original calculations back.

Maybe that could help focus on the one that produces the bad thing ?


Then, you could also try the following ?

line 231 :  if (timer >= 1.0 ) {

this waits 1 second before doing a scan, maybe
* this could be raised to a longer time ?
* this could be replaced by something that tells us for sure the scenery is 
here,the plane is placed,  and that get_elevation_m is ready to work ?

I'm blind here for these experiments...

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread jean pellotier
Patrice Poly a écrit :
> the fix, as a patch
>
> http://www.bentha.net/fgfs/ridge-lift/Environment.diff.bz2
>
> hope this works...
>
>   
nope, same behaviour!!

i think that on my "slow" PC, your ridge lift is sometimes initialised a 
little to early (while position is 0,0,0 maybe), resulting in some nan 
in the result of terrain scan, wich lead to a "nan" in 
/environment/ridge-lift-fps.

and as it's used to compute the next aircraft position, nan go all along 
the calculs...

i tested :
_ridge_lift_fps_node->setDoubleValue( 0 );

and no more nan, all the properties in ridge-lift are now valid.

jano



--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly

> Can you please send a diff to current cvs?

its in the previous post I made. Sorry, I messed up a bit with mail this 
morning...

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Torsten Dreyer
> I posted the correct version  to
> www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip
Can you please send a diff to current cvs?

Torsten

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly
so, a possible fix :

line 218-220 should be : 

probe_lon_rad[i] = 
fmod((deg2rad*user_longitude_deg+asin(sin(ground_wind_from_rad)

*sin(dist_probe_m[i]/earth_rad_m)/cos(probe_lat_rad[i]))+PI)
,(2.0*PI))-PI;

( the"  last probe_lat_rad[i] "  was written  wrong as " probe_lon_rad[i] "... 
which doesn't surprise me too much if sending weird things, as this is what 
we are calculating here... ty Jentron for pointing it out )

and line 205-206 :

double ground_wind_from_rad = PI*( ground_wind_from_deg/180.0);

( no need anymore for checking if lon is >0, this was due to the previous 
error )

I even wonder how this worked my side without errors, and even behaved good...

I posted the correct version  to 
www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip

Hopefully this was the culpript, and there is no other...

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly
the fix, as a patch

http://www.bentha.net/fgfs/ridge-lift/Environment.diff.bz2

hope this works...

This includes the correction for the lee side, according to Ian's advice based 
on real fly.

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Patrice Poly
so, a possible fix :

line 218-220 should be : 

probe_lon_rad[i] = 
fmod((deg2rad*user_longitude_deg+asin(sin(ground_wind_from_rad)

*sin(dist_probe_m[i]/earth_rad_m)/cos(probe_lat_rad[i]))+PI)
,(2.0*PI))-PI;

( the"  last probe_lat_rad[i] "  was written  wrong as " probe_lon_rad[i] "... 
which doesn't surprise me too much if sending weird things, as this is what 
we are calculating here... ty Jentron for pointing it out )

and line 205-206 :

double ground_wind_from_rad = PI*( ground_wind_from_deg/180.0);

( no need anymore for checking if lon is >0, this was due to the previous 
error )

I even wonder how this worked my side without errors, and even behaved good...

I posted the correct version  to 
www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip

Hopefully this was the culpript, and there is no other...

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Erik Hofman


gerard robin wrote:
> Yes it is difficult to trap these nan  which are coming ( + or - 
> randomly ? ? ? , though,  getting trouble with carrier) ), and when we get it 
> the system is closed to be frozen , with black screen, and command line  
> overflowed with messages.
> And when i tried with GDB i did not got any  NAN  "?"

You might want to try to comment out line 66 of src/Main/bootstrap.cxx 
in such case. It'll then throw an exception and a core dump which could 
be analysed:

static void
initFPE ()
{
 fpu_control_t fpe_flags = 0;
 _FPU_GETCW(fpe_flags);
fpe_flags &= ~_FPU_MASK_IM;  // invalid operation
// fpe_flags &= ~_FPU_MASK_DM;  // denormalized operand
// fpe_flags &= ~_FPU_MASK_ZM;  // zero-divide
// fpe_flags &= ~_FPU_MASK_OM;  // overflow
// fpe_flags &= ~_FPU_MASK_UM;  // underflow
// fpe_flags &= ~_FPU_MASK_PM;  // precision (inexact result)
 _FPU_SETCW(fpe_flags);
 signal(SIGFPE, handleFPE);
}

Erik

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread gerard robin
On jeudi 23 avril 2009, Martin Spott wrote:
> Stuart Buchanan wrote:
> > I've been seeing this every time I load on Ubuntu Hardy. I'm 90% sure
> > that the ridge-lift enhancement is the root cause - it's the only
> > source change that went in when I rebuilt last.
>
> We've occasionally seen lots of NaN's before addition of the ridge-lift
> as well and they had never been adresses substantially. I don't mean to
> blame anyone, instead I'd like to revive the idea that the ridge-lift
> is probably just triggering a long-standing 'feature'   not that I
> claim to have the slightest clue which one it would be,
>
>   Martin.

Just built CVS, tested around KHAF, nothing wrong.

Yes it is difficult to trap these nan  which are coming ( + or - 
randomly ? ? ? , though,  getting trouble with carrier) ), and when we get it 
the system is closed to be frozen , with black screen, and command line  
overflowed with messages.
And when i tried with GDB i did not got any  NAN  "?"

I did/do build FG with OSG 2.8 ( stable).
I do use now  the following linux system/configuration:
OpenSuse 11.1 (last stable) , ATHLON 64bits  dual core  2X3200  
4 GB mem 
NVIDIA 9600 GT  

-- 
Gérard
http://pagesperso-orange.fr/GRTux/

J'ai décidé d'être heureux parce que c'est bon pour la santé. 
Voltaire


--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Martin Spott
Stuart Buchanan wrote:

> I've been seeing this every time I load on Ubuntu Hardy. I'm 90% sure
> that the ridge-lift enhancement is the root cause - it's the only
> source change that went in when I rebuilt last.

We've occasionally seen lots of NaN's before addition of the ridge-lift
as well and they had never been adresses substantially. I don't mean to
blame anyone, instead I'd like to revive the idea that the ridge-lift
is probably just triggering a long-standing 'feature'   not that I
claim to have the slightest clue which one it would be,

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-23 Thread Stuart Buchanan

Patrice Poly wrote:

> 
> I'm a bit at lost for now, as I really don't see any NaN anymore here, and 
> don't have another platform to test on.
> 
> I would be interested to see on which platforms / configuration this happens, 
> maybe when more feedback comes in ??

I've been seeing this every time I load on Ubuntu Hardy. I'm 90% sure that the 
ridge-lift enhancement is the root cause - it's the only source change that 
went in when I rebuilt last.

I think they are generated by OpenSceneGraph, and later versions may suppress 
the messages.

I'm away from my FG machine right now, but from memory I'm currently using OSG 
2.7.X. I'm in the process of rebuilding to 2.8.1rc2 to see if that hides the 
messages.

However, even if the messages are being hidden, I think it would be worth 
tracking down the root cause.

-Stuart



  

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread jean pellotier

> I would be interested to see on which platforms / configuration this happens, 
> maybe when more feedback comes in ??
>   
I've got a 32 bits debian SID system, and my athlon xp 2800+ is a single 
core, i usually got nearly 20 fps near KSFO.

jano


--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Ron Jensen
On Wed, 2009-04-22 at 19:57 -0400, Patrice Poly wrote:
> Le Wednesday 22 April 2009 19:20:54 Martin Spott, vous avez écrit :
> > Curtis Olson wrote:
> > > I'm seeing a ton of these nan's when I start at KHAF ... it's just one or
> > > two or three per frame, but that ends up spewing an awful lot of extra
> > > text to my console.
> >
> > That's weird, at least using the ASK 21 I don't see a single one - on
> > Linux/AMD64 with GCC-4.3.2,
> >
> > Martin.
> 
> Here on  OpenSuse 11.0, 64 bits , core2quad, and GCC 4.3.1, I don't have a 
> single one, with any plane, anywhere.

I don't have nans here, either.  Debian stable, GCC 4.2.3 (Debian
4.2.3-5).  Only tried a couple of airplanes (c172p and DA20) and a
couple of airports (KHAF, KHIF)


> I suspect the Nans to have the following probable origins:
> 
> **get_elevation_m doesn't hit the ground at all, ( but then its said to 
> return 
> the sea level )
> 
> **a division by zero occurs somewhere here: 

The calls to asin() look pretty scary to me.  Could we move all the math
outside the call and make sure the math never adds up to more than +/-1?

asin returns NaN if the input isn't in the valid range for a sine.

We could also check for a NaN out of the asin calls and do something
creative if it returns NaN...

>   for (int i = 0; i <= 4; i++)
>   {
>   probe_lat_rad[i] = 
> asin(sin(deg2rad*user_latitude_deg)*cos(dist_probe_m[i]/earth_rad_m)
> +cos(deg2rad*user_latitude_deg)*sin(dist_probe_m[i]/earth_rad_m)*cos(ground_wind_from_rad));

The formula above, I believe, is theoretically capable of only reaching
+/- 1.0. So it is probably safe.


>   if (probe_lat_rad[i] == 0.0) {
>   probe_lon_rad[i] = (deg2rad*user_latitude_deg);  // 
> probe on a pole 
>   }
>   else {
>   probe_lon_rad[i] = 
> fmod((deg2rad*user_longitude_deg+asin(sin(ground_wind_from_rad)
>   
> *sin(dist_probe_m[i]/earth_rad_m)/cos(probe_lon_rad[i]))+PI)
>   ,(2.0*PI))-PI;

Anytime sin(ground_wind_from_rad)*sin(dist_probe_m[i]/earth_rad_m) is
greater than cos(probe_lon_rad[i]) the line above will return a NaN.
Can this condition happen?

>   }
>   probe_lat_deg[i]= rad2deg*probe_lat_rad[i];
>   probe_lon_deg[i]= rad2deg*probe_lon_rad[i];
>   }
> 
>  but I thought checking for poles would prevent this ?
> 
> ** divisions by zero here ?
> 
>   slope[0] = (probe_elev_m[0] - probe_elev_m[1]) / dist_probe_m[1];
>   slope[1] = (probe_elev_m[1] - probe_elev_m[2]) / dist_probe_m[2];
>   slope[2] = (probe_elev_m[2] - probe_elev_m[3]) / dist_probe_m[3];
>   slope[3] = (probe_elev_m[4] - probe_elev_m[0]) / -dist_probe_m[4];
> 
>   unlikely, as these are initialized with good, positive values
> 
> **  division by zero again ?
> 
> else
>   {
>   agl_factor =  exp(-(2 + 2 * probe_elev_m[0] / 4000) * 
>   (user_altitude_agl_m - BOUNDARY2_m) / 
> max(probe_elev_m[0],200.0));
>   }
> 
> I'm a bit at lost for now, as I really don't see any NaN anymore here, and 
> don't have another platform to test on.
> 
> I would be interested to see on which platforms / configuration this happens, 
> maybe when more feedback comes in ??



--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Marcin Koziol
> I'm a bit at lost for now, as I really don't see any NaN anymore here, and
> don't have another platform to test on.
>
> I would be interested to see on which platforms / configuration this happens,
> maybe when more feedback comes in ??

Hi!

I'm new here. I have checked out CVS version of FG about 3 days ago,
and I have the same info message on the console quite often. This
happened on KHAF, but also at several other airports. I came to a
point where I could start fgfs with default c172p, set few parameters
to "start in the air", like 3000 ft above the ground and got the
messages instantly. In my case it almost often hangs up and I'm unable
to run FG any more.

I use Lenovo SL500 with Gentoo, gcc 4.1.2, 3GB memory and Intel(R)
Core(TM)2 Duo CPU T5870  @ 2.00GHz as /proc/cpuinfo says.

I can try to reproduce it or give you more specific situations when it occurs.

Liq

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Curtis Olson
With floating point numbers you usually don't want to check for zero.
Usually you want to check if fabs( number ) < epsilon (where epsilon is some
really small number.)  This is more stable since inside the computer, a
floating point number is just an approximation ... 1/10 for instance becomes
a repeating decimal in it's IEEE binary floating point representation and
thus get's clipped off.  So you can't actually represent 0.1 exactly as a
floating point, but you do get something that's *very* close.

Also notice that you need to use fabs() to return the absolute value of a
floating point number.  abs() is an integer function and returns and integer
result ... common mistake ... and has caused me more than a little head
scratching on a couple occasions.

Regards,

Curt.


On Wed, Apr 22, 2009 at 6:57 PM, Patrice Poly  wrote:

> Le Wednesday 22 April 2009 19:20:54 Martin Spott, vous avez écrit :
> > Curtis Olson wrote:
> > > I'm seeing a ton of these nan's when I start at KHAF ... it's just one
> or
> > > two or three per frame, but that ends up spewing an awful lot of extra
> > > text to my console.
> >
> > That's weird, at least using the ASK 21 I don't see a single one - on
> > Linux/AMD64 with GCC-4.3.2,
> >
> >   Martin.
>
> Here on  OpenSuse 11.0, 64 bits , core2quad, and GCC 4.3.1, I don't have a
> single one, with any plane, anywhere.
>
> I suspect the Nans to have the following probable origins:
>
> **get_elevation_m doesn't hit the ground at all, ( but then its said to
> return
> the sea level )
>
> **a division by zero occurs somewhere here:
>
>for (int i = 0; i <= 4; i++)
>{
>probe_lat_rad[i] =
> asin(sin(deg2rad*user_latitude_deg)*cos(dist_probe_m[i]/earth_rad_m)
>
>
> +cos(deg2rad*user_latitude_deg)*sin(dist_probe_m[i]/earth_rad_m)*cos(ground_wind_from_rad));
>
>if (probe_lat_rad[i] == 0.0) {
>probe_lon_rad[i] = (deg2rad*user_latitude_deg);
>  // probe on a pole
>}
>else {
>probe_lon_rad[i] =
> fmod((deg2rad*user_longitude_deg+asin(sin(ground_wind_from_rad)
>
>  *sin(dist_probe_m[i]/earth_rad_m)/cos(probe_lon_rad[i]))+PI)
>,(2.0*PI))-PI;
>}
>probe_lat_deg[i]= rad2deg*probe_lat_rad[i];
>probe_lon_deg[i]= rad2deg*probe_lon_rad[i];
>}
>
> but I thought checking for poles would prevent this ?
>
> ** divisions by zero here ?
>
>slope[0] = (probe_elev_m[0] - probe_elev_m[1]) / dist_probe_m[1];
>slope[1] = (probe_elev_m[1] - probe_elev_m[2]) / dist_probe_m[2];
>slope[2] = (probe_elev_m[2] - probe_elev_m[3]) / dist_probe_m[3];
>slope[3] = (probe_elev_m[4] - probe_elev_m[0]) / -dist_probe_m[4];
>
>unlikely, as these are initialized with good, positive
> values
>
> **  division by zero again ?
>
> else
>{
>agl_factor =  exp(-(2 + 2 * probe_elev_m[0] / 4000) *
>(user_altitude_agl_m - BOUNDARY2_m) /
> max(probe_elev_m[0],200.0));
>}
>
> I'm a bit at lost for now, as I really don't see any NaN anymore here, and
> don't have another platform to test on.
>
> I would be interested to see on which platforms / configuration this
> happens,
> maybe when more feedback comes in ??
>
>
> --
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Patrice Poly
Le Wednesday 22 April 2009 19:20:54 Martin Spott, vous avez écrit :
> Curtis Olson wrote:
> > I'm seeing a ton of these nan's when I start at KHAF ... it's just one or
> > two or three per frame, but that ends up spewing an awful lot of extra
> > text to my console.
>
> That's weird, at least using the ASK 21 I don't see a single one - on
> Linux/AMD64 with GCC-4.3.2,
>
>   Martin.

Here on  OpenSuse 11.0, 64 bits , core2quad, and GCC 4.3.1, I don't have a 
single one, with any plane, anywhere.

I suspect the Nans to have the following probable origins:

**get_elevation_m doesn't hit the ground at all, ( but then its said to return 
the sea level )

**a division by zero occurs somewhere here: 

for (int i = 0; i <= 4; i++)
{
probe_lat_rad[i] = 
asin(sin(deg2rad*user_latitude_deg)*cos(dist_probe_m[i]/earth_rad_m)

+cos(deg2rad*user_latitude_deg)*sin(dist_probe_m[i]/earth_rad_m)*cos(ground_wind_from_rad));

if (probe_lat_rad[i] == 0.0) {
probe_lon_rad[i] = (deg2rad*user_latitude_deg);  // 
probe on a pole 
}
else {
probe_lon_rad[i] = 
fmod((deg2rad*user_longitude_deg+asin(sin(ground_wind_from_rad)

*sin(dist_probe_m[i]/earth_rad_m)/cos(probe_lon_rad[i]))+PI)
,(2.0*PI))-PI;
}
probe_lat_deg[i]= rad2deg*probe_lat_rad[i];
probe_lon_deg[i]= rad2deg*probe_lon_rad[i];
}

 but I thought checking for poles would prevent this ?

** divisions by zero here ?

slope[0] = (probe_elev_m[0] - probe_elev_m[1]) / dist_probe_m[1];
slope[1] = (probe_elev_m[1] - probe_elev_m[2]) / dist_probe_m[2];
slope[2] = (probe_elev_m[2] - probe_elev_m[3]) / dist_probe_m[3];
slope[3] = (probe_elev_m[4] - probe_elev_m[0]) / -dist_probe_m[4];

unlikely, as these are initialized with good, positive values

**  division by zero again ?

else
{
agl_factor =  exp(-(2 + 2 * probe_elev_m[0] / 4000) * 
(user_altitude_agl_m - BOUNDARY2_m) / 
max(probe_elev_m[0],200.0));
}

I'm a bit at lost for now, as I really don't see any NaN anymore here, and 
don't have another platform to test on.

I would be interested to see on which platforms / configuration this happens, 
maybe when more feedback comes in ??

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Martin Spott
Curtis Olson wrote:

> I'm seeing a ton of these nan's when I start at KHAF ... it's just one or
> two or three per frame, but that ends up spewing an awful lot of extra text
> to my console.

That's weird, at least using the ASK 21 I don't see a single one - on
Linux/AMD64 with GCC-4.3.2,

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Curtis Olson
I'm seeing a ton of these nan's when I start at KHAF ... it's just one or
two or three per frame, but that ends up spewing an awful lot of extra text
to my console.

Regards,

Curt.


On Wed, Apr 22, 2009 at 5:32 PM, Patrice Poly wrote:

>
> > for me FG is quite impossible to use with the ridge drift, on startup it
> > start having full of nan nan nan, cull visitor and so on, with 1 fps,
> > nearly 90% of my try to start are bad.
> >
> > i commented some lines in ridge_lift.cxx (from 210 to 307, and change
> > 309 to:
> > _ridge_lift_fps_node->setDoubleValue( 0);
> >
> > and i don't have anymore working ridge lift, and no more nan nan nan.
> >
> > having looked inthe properties /environment/ridge-lift, some values were
> > nan when i had the cull visitor, like some probe-lon-deg, probe-elev-m.
> >
> > my test were in LFKE, LFHE and some others, with the bocian and ask21.
> >
> > if that's related to system or hardware:
> >
> > amd athlonXP 2800+, 2.5G ram, nvidia geforce 6200, and debian sid...
> >
> > jano
>
> Weird, I wonder where these come from.
>
> Did you use the CVS version of these files ? Some previous versions of
> ridge_lift did produce a lot of NaNs, but I thought I had got rid of these.
>
> Patrice
>
>
> --
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Patrice Poly

> for me FG is quite impossible to use with the ridge drift, on startup it
> start having full of nan nan nan, cull visitor and so on, with 1 fps,
> nearly 90% of my try to start are bad.
>
> i commented some lines in ridge_lift.cxx (from 210 to 307, and change
> 309 to:
> _ridge_lift_fps_node->setDoubleValue( 0);
>
> and i don't have anymore working ridge lift, and no more nan nan nan.
>
> having looked inthe properties /environment/ridge-lift, some values were
> nan when i had the cull visitor, like some probe-lon-deg, probe-elev-m.
>
> my test were in LFKE, LFHE and some others, with the bocian and ask21.
>
> if that's related to system or hardware:
>
> amd athlonXP 2800+, 2.5G ram, nvidia geforce 6200, and debian sid...
>
> jano

Weird, I wonder where these come from.

Did you use the CVS version of these files ? Some previous versions of 
ridge_lift did produce a lot of NaNs, but I thought I had got rid of these.

Patrice

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread Martin Spott
Patrice Poly wrote:

> I have just received a mail from Ian Forster-Lewis , the author of the 
> original ridge lift ground sampling algorithm, in which he agrees for 
> inclusion of his work into FG, provided that his name and link is included in 
> the code.

Great addition, marvellous !

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-22 Thread jean pellotier
hi
> And ty Torsten for committing ! I hope it doesn't trigger too much bugs. My 
> side I don't see weird things.
>   
for me FG is quite impossible to use with the ridge drift, on startup it 
start having full of nan nan nan, cull visitor and so on, with 1 fps, 
nearly 90% of my try to start are bad.

i commented some lines in ridge_lift.cxx (from 210 to 307, and change 
309 to:
_ridge_lift_fps_node->setDoubleValue( 0);

and i don't have anymore working ridge lift, and no more nan nan nan.

having looked inthe properties /environment/ridge-lift, some values were 
nan when i had the cull visitor, like some probe-lon-deg, probe-elev-m.

my test were in LFKE, LFHE and some others, with the bocian and ask21.

if that's related to system or hardware:

amd athlonXP 2800+, 2.5G ram, nvidia geforce 6200, and debian sid...

jano

 



--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread Patrice Poly

> Hi Torsten/Patrice,
>
> What steps would a person need to perform to test out this code.  Is it on
> by default?  Can I see the effect in any aircraft?
>
> Thanks,
>
> Curt.

Hello Curt, 

I'm very happy to see this found some interest !

you don't need to set anything, its on by default, just monitor it 
with '/environment/wind-from-down-fps', this works with any aircraft. Of 
course, its way more funny with a glider than a 777 :)

And ty Torsten for committing ! I hope it doesn't trigger too much bugs. My 
side I don't see weird things.

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread AJ MacLeod
On Monday 20 April 2009 13:12:27 Ian Lewis wrote:
> I'll see if I can help a bit with the FG ridgelift implementation.
Fantastic!  This is something that we've been missing for a long time in FG.

> Which glider has the best flight model and instruments? Ridgelift only
> really pays off when you have a decent glider.

As the author of the Bocian I can safely say its flight model is not terribly 
accurate :-)  I'd be delighted to provide any assistance I could to anyone 
wanting to improve it though; likewise with the instrumentation.

Cheers,

AJ

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread Torsten Dreyer
> On Mon, Apr 20, 2009 at 9:24 AM, Torsten Dreyer  wrote:
> > Patrice,
> >
> > I had some nice ridge flights with your work and really enjoyed it! That
> > is a
> > great improvement not only for sail planes.
> > Everything compiled nicely here on linux and I hope it does so on the
> > other supported platformes, too.
> >
> > I have just committed your files, let's wait for the bugs to show up ,-)
>
> Hi Torsten/Patrice,
>
> What steps would a person need to perform to test out this code.  Is it on
> by default?  Can I see the effect in any aircraft?
>
> Thanks,
>
> Curt.
Just hop into any aircraft you like - well, probably not at jet but 
preferrably a glider and go to an airfield next to a ridge. KHAF will work.
For KHAF set up some westerly winds. 15 knots is a good start. Fly your glider 
close to a west facing ridge and check the 
property /environment/ridge-lift-fps and observe the vertical speed 
indicator. You will definitely climb there. But be aware, you will experience 
some serious downwash on the opposite side of the ridge.
The feature is on by default.

Torsten



--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread Curtis Olson
On Mon, Apr 20, 2009 at 9:24 AM, Torsten Dreyer  wrote:

> Patrice,
>
> I had some nice ridge flights with your work and really enjoyed it! That is
> a
> great improvement not only for sail planes.
> Everything compiled nicely here on linux and I hope it does so on the other
> supported platformes, too.
>
> I have just committed your files, let's wait for the bugs to show up ,-)


Hi Torsten/Patrice,

What steps would a person need to perform to test out this code.  Is it on
by default?  Can I see the effect in any aircraft?

Thanks,

Curt.
-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread Torsten Dreyer
Patrice,

I had some nice ridge flights with your work and really enjoyed it! That is a 
great improvement not only for sail planes.
Everything compiled nicely here on linux and I hope it does so on the other 
supported platformes, too.

I have just committed your files, let's wait for the bugs to show up ,-)

Torsten


--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread Ian Lewis
I'll see if I can help a bit with the FG ridgelift implementation.

Which glider has the best flight model and instruments? Ridgelift only really 
pays off when you have a decent glider.

I've expanded the wiki stub 
http://wiki.flightgear.org/index.php/Improving_Glider_Realism to at least 
create a section for each area 
that needs a decent solution to have a competitive soaring capability in 
FlightGear.

The bits I worked on for FSX were ridgelift, the TE and netto variometers, the 
IGC logger, and the flight model to upgrade the stock 
glider (DG808S). The default capabilities of FSX for soaring were very poor 
(unrealistic glider flight model, no ridge lift, only an 
uncompensated rate-of-climb vario). Peter Luerkens programmed CumulusX! which 
provides the thermals.

Cheers,
B21 / Ian Forster-Lewis

p.s. can you link directly to external images in the wiki, or do you have to 
upload all images to the actual wiki server?

AJ MacLeod wrote:
> On Sunday 19 April 2009 17:51:13 Patrice Poly wrote:
>> I have just received a mail from Ian Forster-Lewis , the author of the
>> original ridge lift ground sampling algorithm, in which he agrees for
>> inclusion of his work into FG, provided that his name and link is included
>> in the code.
>> You can look at all this in:
>> www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip
>> Hoping it finds some interest,
> 
> This is great news, it's a feature that many people have been interested in 
> having in FG for quite a few years now.  I don't have much time for messing 
> with FG at the moment, but I hope to give your changes a try sometime soon.
> 
> In the meantime, thank you very much for your work on this (and the original 
> author for giving his permission for inclusion)!
> 
> Cheers,
> 
> AJ
> 
> --
> Stay on top of everything new and different, both inside and 
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today. 
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-20 Thread AJ MacLeod
On Sunday 19 April 2009 17:51:13 Patrice Poly wrote:
> I have just received a mail from Ian Forster-Lewis , the author of the
> original ridge lift ground sampling algorithm, in which he agrees for
> inclusion of his work into FG, provided that his name and link is included
> in the code.
> You can look at all this in:
> www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip
> Hoping it finds some interest,

This is great news, it's a feature that many people have been interested in 
having in FG for quite a few years now.  I don't have much time for messing 
with FG at the moment, but I hope to give your changes a try sometime soon.

In the meantime, thank you very much for your work on this (and the original 
author for giving his permission for inclusion)!

Cheers,

AJ

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-19 Thread Patrice Poly
I have just received a mail from Ian Forster-Lewis , the author of the 
original ridge lift ground sampling algorithm, in which he agrees for 
inclusion of his work into FG, provided that his name and link is included in 
the code.

He also proposes a refinement of the way sink is calculated on the lee side, I 
will try to work it out with him.

So I have updated the files with proper GPL licensing, and tried to make some 
code corrections so that it fits better with the FG code style and habits.
Corrected an error which made lift work at reverse on negative longitudes. 
Ridge lift is now correctly handled by environment, and doesn't rely on AI 
anymore. 
( I had to modify slightly the way thermals send their strength to 
environment, I included this in the zip )
I can use it without errors my side, but it would be interesting to have more 
input on this. 

You can look at all this in:

www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip

Hoping it finds some interest,

regards,
Patrice

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-15 Thread Patrice Poly
I have it working now in environment.

It leaves room for thermals, and mixes good with them.

I also refined the thermal model,  so that it behaves more like a real 
thermal.

I am still waiting for an answer from the guy who wrote the algorithm for 
ridge lift, regarding licensing. I'm almost sure there is no problem with 
this, but , maybe its better to wait for his answer before putting this into 
FG ?

You can try it with these files :
http://www.bentha.net/fgfs/ridge-lift/ridge-lift-in-environment.zip

regards,
Patrice

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-13 Thread Vadym Kukhtin
2009/4/11 Patrice Poly :

> I made a working ridge lift in a AI object.
>
> It WORKS, and , even, it works GOOD !

Great!!
I'm wait for this feature already for a couple of years...
Please keep to develop it!



-- 
---
WBR, Vadym.

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-12 Thread Patrice Poly
>>This looks really neat.  I'm not sure why you put it into the AI
>>subsystem, though.  It makes more sense to me to have it in
>>Environment/environment.cxx with the other basic wind calculations?

I have been looking into environment.cxx

I am not sure I understand how this works.
environment.cxx seems to be used to make windspeeds coherent if someone or 
something touches one of the entries ? I don't get how it could be related to 
the user position.
I don't understand when this is called, either.

I'm fairly new to the fg internals, so I took what seemed to be the easiest 
available way to play with wind_from_down_fps.

But indeed, this value shouldn't rely on an AI thing.
What would happen to the thermals then, though ? they are also writing to this 
value. Maybe they would have to add their updraft component to the one from 
environment ?

I'm  a bit at lost...


--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] working ridge lift !!

2009-04-11 Thread Ron Jensen
On Sat, 2009-04-11 at 04:52 -0400, Patrice Poly wrote:
> Hello, thanks to the info by Hooray in the forum, and most of all thanks to 
> the awesome paper found by him here : 
> 
> http://carrier.csi.cam.ac.uk/forsterlewis/soaring/sim/fsx/dev/sim_probe/sim_probe_paper.html
> 
> I made a working ridge lift in a AI object.
> 
> It WORKS, and , even, it works GOOD !
> I am just taking a pause in a long flight in the valley at LOWI, getting a 
> nice +5 fps updraft with a 10 kts wind :)
> It behaves really nicely, the closer you are to the hill, the higher the 
> lift, 
> until some point when it drops because of friction, it reaches a maximum 
> above the hill top, then drops hard behind the edge. awesome :)
> 
> Now we really need to contact the author on the forum, about licensing.
> I wrote the code entirely, just used their adjustment formulas and the basic 
> sampling idea, so I presume it should be no harm ? I'll email them anyway.
> 
> Again, my code is probably not nice, if someone feels like giving it a look 
> and make corrections , improvements, it would be very nice.
> A possible issue is that it pretends to be a thermal, I made this because I 
> am 
> really not sure how to modify the AI manager and base so that it works, but I 
> needed to write to 'wind-from-down'.
> So for now, it cannot be mixed with thermals, which is a real shame.
> Maybe someone would take some time to do this better ?
> 
> Anyway, it works, very good , even in this draft state.
> I don't feel any performance drop with 5 ground scans / second. The ground 
> sampling idea is really neat.
> 
> As long as I have a contact with the author of the paper, and hopefully he 
> will accept that his idea goes into GPL, I will have to beg for it to be 
> included in CVS. Many people would enjoy this a lot, I am sure !
> 
> Here is a link to what I made : www.bentha.net/fgfs/ridge-lift/ridge-lift.zip.
> 
> This is without any licencing yet,but I thought that as I have only taken the 
> main idea from the paper, and some formulas, then wrote the code myself, I 
> could send this to the dev list without too much harm regarding the paper 
> author and FSX code.
> 
> Please  let me know if you find it of some interest !

This looks really neat.  I'm not sure why you put it into the AI
subsystem, though.  It makes more sense to me to have it in
Environment/environment.cxx with the other basic wind calculations?

Thanks,

Ron



--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel