Re: [Flightgear-devel] weather conditions and winds aloft notworking correctly..

2010-07-24 Thread Scott Hamilton
On Fri, 2010-07-23 at 12:01 -0400, Jacob Burbach wrote:

 Thanks for the quick work on this Torsten...with the exception of dew
 point and altimeter settings everything else appears to be working
 properly now. Currently I don't think dew point and altimeter are a
 big deal for what I'm doing personally, but they are/were seemingly
 intended to work so should probably be addressed as well.
 
 Thanks again, cheers!
 --Jacob



I'm not sure if it is related to this change, but since I did a GIT pull
of simgear, flightgear, fgdata of 24 July and rebuild of simgear and
flightgear, the ground elevation seems to become incorrect after flying
at high altitude.

Scenario:
I assume the inner (left) altitude of the standard HUD is AGL, the outer
(right) altitude is the ASL
* The ground elevation as reported on the standard HUD starts out
correct (25ft AGL 398ft ASL) at EDDF with QNH 1022
* climb to cruise of FL330 and set Std settting on barometer (29.92
to /instrumentation/altimeter/setting-inhg)
* start my descent into EGLL
* flying over the sea between France and UK I notice that the ground
elevation report by the HUD is out by 800ft compared to the ASL (this is
probably at around FL280) 
* at 18000ft I set the barometer
(/instrumentation/altimeter/setting-inhg) 1021 QNH as reported by METAR,
which is converted to inHg
* on approach to EGLL the AGL is out by around 1600ft at around 8000ft
ASL
* on final approach to EGLL the AGL is now around 2100ft out compared to
the ASL 
* the terrain is rendered and looks like it is around 2000ft below,
however the GWPS starts warning of terrain
* and then I crash into the invisible ground while appearing to be more
than 2000ft in the air

The command line for the above scenario was;

bin/fgfs --log-level=error --enable-sound --enable-hud
--enable-real-weather-fetch --airport=EDDF --aircraft=A380
--atlas=socket --multiplay=out,... --multiplay=in,... --callsign=..
--prop:/sim/ai-traffic/enabled=false
--prop:/sim/traffic-manager/enabled=false --prop:/sim/atc/enabled=false
--parkpos=A22


Now I'm fairly sure London isn't 2000ft ASL. Is there some properties I
can watch to see what is going wrong here?


S.

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] weather conditions and winds aloft notworking correctly..

2010-07-23 Thread Vivian Meazza
Curt,

 

Using the same comparison here between the submodel wind and the particle
wind, there is still an error. The particle contrail is still at an angle to
the aircraft axis.

 

I will investigate some more.

 

Vivian 

 

-Original Message-
From: Curtis Olson [mailto:curtol...@gmail.com] 
Sent: 22 July 2010 16:28
To: FlightGear developers discussions
Subject: Re: [Flightgear-devel] weather conditions and winds aloft
notworking correctly..

 

Replying to my own message ... I see a couple simple code cleanups in my
first patch so don't worry too much about that.  I've been flying tight
level circles in a variety of wind conditions (up to 70 kts) with smoke
turned on and when I come around and start the circle again, I've been
flying into the tail of my own smoke now no matter what the wind is doing.
So I think that's how it's supposed to work.  It looks *much* better.


Curt.

 

On Thu, Jul 22, 2010 at 9:55 AM, Curtis Olson wrote:

On the topic of the partical system and the wind vector not being correct.
I have a patch here that seems to be working, and it would be great if a few
other people could test/review it to see if it makes sense.  This is the
first time I've dove into the particle system code and the environment
manager has always been a bit of a beast.  There's probably a better way to
do this, but as I worked my way through the logic, this is what I ended up
with that made sense to me.

 

SIMGEAR PATCH:

 

diff --git a/simgear/scene/model/particles.cxx
b/simgear/scene/model/particles.cxx

index 0803790..acac7df 100644

--- a/simgear/scene/model/particles.cxx

+++ b/simgear/scene/model/particles.cxx

@@ -62,11 +62,13 @@ void GlobalParticleCallback::operator()(osg::Node* node,
osg::NodeVisitor* nv)

 osg::Matrix om(toOsg(q));

 osg::Vec3 v(0,0,9.81);

 gravity = om.preMult(v);

+// NOTE: THIS WIND COMPUTATION DOESN'T SEEM TO AFFECT PARTICLES

 const osg::Vec3 zUpWind = Particles::getWindVector();

-osg::Vec3 w(zUpWind.y(), zUpWind.x(), - zUpWind.z());

+osg::Vec3 w(zUpWind.y(), zUpWind.x(), -zUpWind.z());

 wind = om.preMult(w);

 

-//SG_LOG(SG_GENERAL, SG_ALERT, wind
vector:w[0],w[1],w[2]\n);

+// SG_LOG(SG_GENERAL, SG_ALERT,

+//wind vector:  w[0]  , w[1]  ,  w[2]);

 }

 

 

diff --git a/simgear/scene/model/particles.hxx
b/simgear/scene/model/particles.hxx

index 6dda343..3fd3ccb 100644

--- a/simgear/scene/model/particles.hxx

+++ b/simgear/scene/model/particles.hxx

@@ -257,6 +257,14 @@ public:

  * magnitude is the velocity in meters per second.

  */

 static void setWindVector(const osg::Vec3 wind) { _wind = wind; }

+static void setWindFrom(const double from_deg, const double speed_kt) {

+   double map_deg = 0.0 - from_deg;

+   double map_rad = map_deg * SG_DEGREES_TO_RADIANS;

+   double speed_mps = speed_kt * SG_KT_TO_MPS;

+   _wind[0] = cos(map_rad) * speed_mps;

+   _wind[1] = sin(map_rad) * speed_mps;

+   _wind[2] = 0.0;

+}

 static const osg::Vec3 getWindVector() { return _wind; }

 protected:

 float shooterExtraRange;

 

FLIGHTGEAR PATCH:

 

diff --git a/src/Environment/environment_mgr.cxx
b/src/Environment/environment_mgr.cxx

index 15268f9..17d1e36 100644

--- a/src/Environment/environment_mgr.cxx

+++ b/src/Environment/environment_mgr.cxx

@@ -295,7 +295,10 @@ FGEnvironmentMgr::update (double dt)

   osg::Vec3 windVec(-_environment-get_wind_from_north_fps(),

 -_environment-get_wind_from_east_fps(),

 _environment-get_wind_from_down_fps());

-  simgear::Particles::setWindVector(windVec * SG_FEET_TO_METER);

+  // simgear::Particles::setWindVector(windVec * SG_FEET_TO_METER);

+  double wind_true_deg = _environment-get_wind_from_heading_deg();

+  simgear::Particles::setWindFrom( wind_true_deg,

+  _environment-get_wind_speed_kt() );

 }

 

 FGEnvironment

 

Curt.

 

 

On Thu, Jul 22, 2010 at 4:25 AM, Stuart Buchanan wrote:

On Wed, Jul 21, 2010 at 5:00 PM, Torsten Dreyer wrote:
 I don't know if it's somehow related, but the 3d clouds don't seem to
drift
 with the wind, either. Flying with  crosswind with a magnitude as your
 airspeed let you fly toward the clouds at a 45 degree angle. My setup was:
 Wind from 1...@100, flying heading 270 with 100KTS. The clouds came in from
 45degrees out of the right hand side.

 Torsten

That's just a missing feature/bug in the 3d clouds, and I don't think
it's related
to the particles problem. I haven't managed to find the time to fix
it, and I'm unlikely
to in the near future (baby due end of August), so if anyone is
looking for some work...

-Stuart



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

Re: [Flightgear-devel] weather conditions and winds aloft notworking correctly..

2010-07-23 Thread Curtis Olson
Hi Vivian,

I setup the Rascal 110 model with the wing leveler active and full rudder,
then manipulated the throttle to hold level altitude.  This way I flew
pretty tight, consistent circles.  I ended up flying into the back of my own
smoke, and this worked no matter what velocity or direction I set the winds
to, so I think I have the particle wind vector dialed in pretty close now.

Curt.


On Fri, Jul 23, 2010 at 3:56 AM, Vivian Meazza wrote:

  Curt,



 Using the same comparison here between the submodel wind and the particle
 wind, there is still an error. The particle contrail is still at an angle to
 the aircraft axis.



 I will investigate some more.



 Vivian



 -Original Message-
 *From:* Curtis Olson [mailto:curtol...@gmail.com]
 *Sent:* 22 July 2010 16:28
 *To:* FlightGear developers discussions
 *Subject:* Re: [Flightgear-devel] weather conditions and winds aloft
 notworking correctly..



 Replying to my own message ... I see a couple simple code cleanups in my
 first patch so don't worry too much about that.  I've been flying tight
 level circles in a variety of wind conditions (up to 70 kts) with smoke
 turned on and when I come around and start the circle again, I've been
 flying into the tail of my own smoke now no matter what the wind is doing.
  So I think that's how it's supposed to work.  It looks *much* better.


 Curt.



 On Thu, Jul 22, 2010 at 9:55 AM, Curtis Olson wrote:

 On the topic of the partical system and the wind vector not being correct.
  I have a patch here that seems to be working, and it would be great if a
 few other people could test/review it to see if it makes sense.  This is the
 first time I've dove into the particle system code and the environment
 manager has always been a bit of a beast.  There's probably a better way to
 do this, but as I worked my way through the logic, this is what I ended up
 with that made sense to me.



 SIMGEAR PATCH:



 diff --git a/simgear/scene/model/particles.cxx
 b/simgear/scene/model/particles.cxx

 index 0803790..acac7df 100644

 --- a/simgear/scene/model/particles.cxx

 +++ b/simgear/scene/model/particles.cxx

 @@ -62,11 +62,13 @@ void GlobalParticleCallback::operator()(osg::Node*
 node, osg::NodeVisitor* nv)

  osg::Matrix om(toOsg(q));

  osg::Vec3 v(0,0,9.81);

  gravity = om.preMult(v);

 +// NOTE: THIS WIND COMPUTATION DOESN'T SEEM TO AFFECT PARTICLES

  const osg::Vec3 zUpWind = Particles::getWindVector();

 -osg::Vec3 w(zUpWind.y(), zUpWind.x(), - zUpWind.z());

 +osg::Vec3 w(zUpWind.y(), zUpWind.x(), -zUpWind.z());

  wind = om.preMult(w);



 -//SG_LOG(SG_GENERAL, SG_ALERT, wind
 vector:w[0],w[1],w[2]\n);

 +// SG_LOG(SG_GENERAL, SG_ALERT,

 +//wind vector:  w[0]  , w[1]  ,  w[2]);

  }





 diff --git a/simgear/scene/model/particles.hxx
 b/simgear/scene/model/particles.hxx

 index 6dda343..3fd3ccb 100644

 --- a/simgear/scene/model/particles.hxx

 +++ b/simgear/scene/model/particles.hxx

 @@ -257,6 +257,14 @@ public:

   * magnitude is the velocity in meters per second.

   */

  static void setWindVector(const osg::Vec3 wind) { _wind = wind; }

 +static void setWindFrom(const double from_deg, const double speed_kt)
 {

 +   double map_deg = 0.0 - from_deg;

 +   double map_rad = map_deg * SG_DEGREES_TO_RADIANS;

 +   double speed_mps = speed_kt * SG_KT_TO_MPS;

 +   _wind[0] = cos(map_rad) * speed_mps;

 +   _wind[1] = sin(map_rad) * speed_mps;

 +   _wind[2] = 0.0;

 +}

  static const osg::Vec3 getWindVector() { return _wind; }

  protected:

  float shooterExtraRange;



 FLIGHTGEAR PATCH:



 diff --git a/src/Environment/environment_mgr.cxx
 b/src/Environment/environment_mgr.cxx

 index 15268f9..17d1e36 100644

 --- a/src/Environment/environment_mgr.cxx

 +++ b/src/Environment/environment_mgr.cxx

 @@ -295,7 +295,10 @@ FGEnvironmentMgr::update (double dt)

osg::Vec3 windVec(-_environment-get_wind_from_north_fps(),

  -_environment-get_wind_from_east_fps(),

  _environment-get_wind_from_down_fps());

 -  simgear::Particles::setWindVector(windVec * SG_FEET_TO_METER);

 +  // simgear::Particles::setWindVector(windVec * SG_FEET_TO_METER);

 +  double wind_true_deg = _environment-get_wind_from_heading_deg();

 +  simgear::Particles::setWindFrom( wind_true_deg,

 +  _environment-get_wind_speed_kt() );

  }



  FGEnvironment



 Curt.





 On Thu, Jul 22, 2010 at 4:25 AM, Stuart Buchanan wrote:

 On Wed, Jul 21, 2010 at 5:00 PM, Torsten Dreyer wrote:
  I don't know if it's somehow related, but the 3d clouds don't seem to
 drift
  with the wind, either. Flying with  crosswind with a magnitude as your
  airspeed let you fly toward the clouds at a 45 degree angle. My setup
 was:
  Wind from 1...@100, flying heading 270 with 100KTS. The clouds came in
 from
  45degrees out of the right hand side.
 
  Torsten

 That's just

Re: [Flightgear-devel] weather conditions and winds aloft notworking correctly..

2010-07-23 Thread Jacob Burbach
Thanks for the quick work on this Torsten...with the exception of dew
point and altimeter settings everything else appears to be working
properly now. Currently I don't think dew point and altimeter are a
big deal for what I'm doing personally, but they are/were seemingly
intended to work so should probably be addressed as well.

Thanks again, cheers!
--Jacob

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel