Re: [Flightgear-devel] Yasim static friction?

2012-07-06 Thread Andy Ross
On 07/05/2012 02:41 PM, Viktor Radnai wrote:
 Thanks for that! So just to clarify -- this is a bug in Yasim code (or
 more like a missing feature) and I'm welcome to fix it?:)

I'm just an absentee hacker, so I can't say what is or isn't
acceptable any more.  But it seems like a sane enhancement to me.

But broadly yes: it's free software.  The whole point is to make it do
what you want.

Andy

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-06 Thread Viktor Radnai
Hi there,

The rest of this mail will just deal with the gear friction issue for now.

Having looked at Gear.cpp I think I can understand the issue a bit 
better. The method that calculates tire friction is Gear::calcFriction. 
It looks like this:

float Gear::calcFriction(float wgt, float v) //used on solid ground
{
 // How slow is stopped?  10 cm/second?
 const float STOP = 0.1f;
 const float iSTOP = 1.0f/STOP;
 v = Math::abs(v);
 if(v  STOP) return v*iSTOP * wgt * _sfric;
 else return wgt * _dfric;
}

Note the constant in there that marks the point where static friction 
starts to get used. Also note that the constant is multiplied by v, so 
at zero speed, there is zero friction. This is perfectly fine on water, 
but not on solid ground. It also explains what's happening -- the force 
of the wind pushing against the plane will meet with no resistance until 
it starts to equal v*iSTOP * wgt * _sfric and the plane will eventually 
roll with that constant speed.

The reality is that on solid ground the force caused by static friction 
will be equal to the force acting upon the wheel (the bearings 
actually), up to a threshold of Fmax, when the wheel/bearing assembly 
will unstick and start to rotate.

Right now it seems that to fix this, reality must be modelled in this 
respect. If I take Andy's suggestion and just try to clamp the static 
friction to an arbitary fixed value, then the force returned may or may 
not be larger than the force pushing against the wheel, and the result 
will be that the plane rocks with the (3 knot) wind while very slowly 
turning into the wind, while stopped on tarmac...

The question is, where do I get the force acting upon the wheel?
To try to figure that out, I had to look into Model.cpp where I ran into 
further difficulties:

 // The landing gear
 for(i=0; i_gears.size(); i++) {
 float force[3], contact[3];
 Gear* g = (Gear*)_gears.get(i);

 g-calcForce(_body, s, lv, lrot);
 g-getForce(force, contact);
 _body.addForce(contact, force);
 }

Here the forces created by fricion on all the gears are added up. So if 
I was to keep the model stationary without any jitter, the sum of the 
resistive forces from the gears must exactly equal the sum of the force 
acting upon the gears. This is out of scope of just modifying Gear.cpp 
and definitely out of my league for both the knowledge of C++ and the 
Flightgear codebase.

Could someone please help me with this? Thanks in advance!

Cheers,
Vik



On 07/05/2012 09:34 PM, Andy Ross wrote:
 (Happened to be browsing in time to see a question)

 On 07/05/2012 06:21 AM, Viktor Radnai wrote:
 I don't see any obvious properties to set to take the engine's
 resistance to turning over, or the friction of the wheels into account
 to stop these unrealistic things from happening. How should I go about
 fixing them?

 That sounds right to me.  Aircraft parked in gentle winds weren't really
 part of the original test regime. :)

 For the gear thing, see Gear.cpp:450 or so, and look at clamping the
 static friction coefficient to some minimum value (probably tunable).

 For the engine, you can likewise add some fixed negative torque value
 near PistonEngine.cpp:214 to model internal resistance (currently the
 code only models output power).

 Andy

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-06 Thread Viktor Radnai
Well, I am giving it a shot, but it seems it won't be that easy. See my 
other (long) mail sent on this topic :)

Cheers,
Vik

On 07/06/2012 05:48 PM, Andy Ross wrote:
 On 07/05/2012 02:41 PM, Viktor Radnai wrote:
 Thanks for that! So just to clarify -- this is a bug in Yasim code (or
 more like a missing feature) and I'm welcome to fix it?:)

 I'm just an absentee hacker, so I can't say what is or isn't
 acceptable any more.  But it seems like a sane enhancement to me.

 But broadly yes: it's free software.  The whole point is to make it do
 what you want.

 Andy

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-05 Thread Emilian Huminiuc
On Thursday 05 July 2012 15:21:24 Viktor Radnai wrote:
 1. When the aircraft is parked with no parking brake, it will usually
 start to roll slowly backwards -- pushed by the wind and maybe the
 runway slope. If I start the engine on idle, the thrust generated by the
 idle prop might stop this roll. On tarmac, even a 3 knot wind is enough
 to start pushing the plane back. On grass more is needed -- maybe 20 knots?
 
Hi,

In that case, even in real life, there's no other friction at play than the 
friction inside the wheel bearings, friction which is very low, almost 
ignorable.

Regards,
Emilian

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-05 Thread Viktor Radnai
Technically, you also have the compression of the wheels -- when the 
wheel turns, part of the tire in the front gets compressed while the 
back gets uncompressed. This is also a friction loss. Plus there is some 
friction between the rubber and the road.

But my point is that the amount of friction is wrong. The plane should 
not start rolling with a 3 knot wind, that's nonsense.

Static friction is greater than dynamic friction. If you stop your car 
on moderately flat terrain with no brakes, it will not start to roll 
easily, not even if it's windy. If the terrain is flat, it will stay 
put. If the slope is greater, it might start to roll very slowly with 
the bearings turning in stick/slip mode and then finally it will just 
roll and accelerate. So the plane should stay put until there's a 20-30 
knot wind blowing against it. Probably more on grass. On grass with the 
real plane you might need half throttle or more to get it moving. The 
funny thing is that this part seems to be modelled correctly in 
Flightgear, so no idea what's wrong with the effect of the wind :)

Same goes for the prop, the resistance the shut down engine offers is 
too small and so it's turned over way too easily. Turning the prop of 
the Falke at about 2/3 of its span requires about the same amount of 
force as lifting an object that weights 1-2 kg. This is a rough guess 
and the actual force varies during the compression cycle but you get the 
idea.

For the wheels, I can try to make sure that the brakes are always 
slightly set, but what do I do for the prop?

Cheers,
Vik

On 07/05/2012 03:30 PM, Emilian Huminiuc wrote:
 On Thursday 05 July 2012 15:21:24 Viktor Radnai wrote:
 1. When the aircraft is parked with no parking brake, it will usually
 start to roll slowly backwards -- pushed by the wind and maybe the
 runway slope. If I start the engine on idle, the thrust generated by the
 idle prop might stop this roll. On tarmac, even a 3 knot wind is enough
 to start pushing the plane back. On grass more is needed -- maybe 20 knots?

 Hi,

 In that case, even in real life, there's no other friction at play than the
 friction inside the wheel bearings, friction which is very low, almost
 ignorable.

 Regards,
 Emilian

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-05 Thread Hyde Yamakawa
Does this happen only left wind, right? Or happens on right wind too?

Hyde

(2012年07月05日 10:02), Viktor Radnai wrote:
 Technically, you also have the compression of the wheels -- when the
 wheel turns, part of the tire in the front gets compressed while the
 back gets uncompressed. This is also a friction loss. Plus there is some
 friction between the rubber and the road.

 But my point is that the amount of friction is wrong. The plane should
 not start rolling with a 3 knot wind, that's nonsense.

 Static friction is greater than dynamic friction. If you stop your car
 on moderately flat terrain with no brakes, it will not start to roll
 easily, not even if it's windy. If the terrain is flat, it will stay
 put. If the slope is greater, it might start to roll very slowly with
 the bearings turning in stick/slip mode and then finally it will just
 roll and accelerate. So the plane should stay put until there's a 20-30
 knot wind blowing against it. Probably more on grass. On grass with the
 real plane you might need half throttle or more to get it moving. The
 funny thing is that this part seems to be modelled correctly in
 Flightgear, so no idea what's wrong with the effect of the wind :)

 Same goes for the prop, the resistance the shut down engine offers is
 too small and so it's turned over way too easily. Turning the prop of
 the Falke at about 2/3 of its span requires about the same amount of
 force as lifting an object that weights 1-2 kg. This is a rough guess
 and the actual force varies during the compression cycle but you get the
 idea.

 For the wheels, I can try to make sure that the brakes are always
 slightly set, but what do I do for the prop?

 Cheers,
 Vik

 On 07/05/2012 03:30 PM, Emilian Huminiuc wrote:
 On Thursday 05 July 2012 15:21:24 Viktor Radnai wrote:
 1. When the aircraft is parked with no parking brake, it will usually
 start to roll slowly backwards -- pushed by the wind and maybe the
 runway slope. If I start the engine on idle, the thrust generated by the
 idle prop might stop this roll. On tarmac, even a 3 knot wind is enough
 to start pushing the plane back. On grass more is needed -- maybe 20 knots?

 Hi,

 In that case, even in real life, there's no other friction at play than the
 friction inside the wheel bearings, friction which is very low, almost
 ignorable.

 Regards,
 Emilian

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

-- 
**
Hyde Yamakawa
308 Brookewood Dr.
Peachtree City, GA 30269
Phone (770)632-6461
Cell  (404)353-8758
e-mail: h...@hyde-tech.com
http://www.hyde-tech.com/
**




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-05 Thread Viktor Radnai
You mean when the wind is blowing from the front-left of the plane?

Cheers,
Vik

On 07/05/2012 04:14 PM, Hyde Yamakawa wrote:
 Does this happen only left wind, right? Or happens on right wind too?

 Hyde

 (2012年07月05日 10:02), Viktor Radnai wrote:
 Technically, you also have the compression of the wheels -- when the
 wheel turns, part of the tire in the front gets compressed while the
 back gets uncompressed. This is also a friction loss. Plus there is some
 friction between the rubber and the road.

 But my point is that the amount of friction is wrong. The plane should
 not start rolling with a 3 knot wind, that's nonsense.

 Static friction is greater than dynamic friction. If you stop your car
 on moderately flat terrain with no brakes, it will not start to roll
 easily, not even if it's windy. If the terrain is flat, it will stay
 put. If the slope is greater, it might start to roll very slowly with
 the bearings turning in stick/slip mode and then finally it will just
 roll and accelerate. So the plane should stay put until there's a 20-30
 knot wind blowing against it. Probably more on grass. On grass with the
 real plane you might need half throttle or more to get it moving. The
 funny thing is that this part seems to be modelled correctly in
 Flightgear, so no idea what's wrong with the effect of the wind :)

 Same goes for the prop, the resistance the shut down engine offers is
 too small and so it's turned over way too easily. Turning the prop of
 the Falke at about 2/3 of its span requires about the same amount of
 force as lifting an object that weights 1-2 kg. This is a rough guess
 and the actual force varies during the compression cycle but you get the
 idea.

 For the wheels, I can try to make sure that the brakes are always
 slightly set, but what do I do for the prop?

 Cheers,
 Vik

 On 07/05/2012 03:30 PM, Emilian Huminiuc wrote:
 On Thursday 05 July 2012 15:21:24 Viktor Radnai wrote:
 1. When the aircraft is parked with no parking brake, it will usually
 start to roll slowly backwards -- pushed by the wind and maybe the
 runway slope. If I start the engine on idle, the thrust generated by the
 idle prop might stop this roll. On tarmac, even a 3 knot wind is enough
 to start pushing the plane back. On grass more is needed -- maybe 20 knots?

 Hi,

 In that case, even in real life, there's no other friction at play than the
 friction inside the wheel bearings, friction which is very low, almost
 ignorable.

 Regards,
 Emilian

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Yasim static friction?

2012-07-05 Thread Viktor Radnai
The plane gets pushed either forward or backwards by the wind, depending 
on the wind direction. The prop seems to only get turned in the 
direction of normal rotation, even in a tailwind, which seems wrong to me.

But really the main issue for me is that this amount of wind should not 
move the aircraft or the prop.

On 07/05/2012 04:14 PM, Hyde Yamakawa wrote:
 Does this happen only left wind, right? Or happens on right wind too?

 Hyde

 (2012年07月05日 10:02), Viktor Radnai wrote:
 Technically, you also have the compression of the wheels -- when the
 wheel turns, part of the tire in the front gets compressed while the
 back gets uncompressed. This is also a friction loss. Plus there is some
 friction between the rubber and the road.

 But my point is that the amount of friction is wrong. The plane should
 not start rolling with a 3 knot wind, that's nonsense.

 Static friction is greater than dynamic friction. If you stop your car
 on moderately flat terrain with no brakes, it will not start to roll
 easily, not even if it's windy. If the terrain is flat, it will stay
 put. If the slope is greater, it might start to roll very slowly with
 the bearings turning in stick/slip mode and then finally it will just
 roll and accelerate. So the plane should stay put until there's a 20-30
 knot wind blowing against it. Probably more on grass. On grass with the
 real plane you might need half throttle or more to get it moving. The
 funny thing is that this part seems to be modelled correctly in
 Flightgear, so no idea what's wrong with the effect of the wind :)

 Same goes for the prop, the resistance the shut down engine offers is
 too small and so it's turned over way too easily. Turning the prop of
 the Falke at about 2/3 of its span requires about the same amount of
 force as lifting an object that weights 1-2 kg. This is a rough guess
 and the actual force varies during the compression cycle but you get the
 idea.

 For the wheels, I can try to make sure that the brakes are always
 slightly set, but what do I do for the prop?

 Cheers,
 Vik

 On 07/05/2012 03:30 PM, Emilian Huminiuc wrote:
 On Thursday 05 July 2012 15:21:24 Viktor Radnai wrote:
 1. When the aircraft is parked with no parking brake, it will usually
 start to roll slowly backwards -- pushed by the wind and maybe the
 runway slope. If I start the engine on idle, the thrust generated by the
 idle prop might stop this roll. On tarmac, even a 3 knot wind is enough
 to start pushing the plane back. On grass more is needed -- maybe 20 knots?

 Hi,

 In that case, even in real life, there's no other friction at play than the
 friction inside the wheel bearings, friction which is very low, almost
 ignorable.

 Regards,
 Emilian

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-05-23 Thread Mathias Fröhlich

Hi,

On Friday 22 May 2009 16:55:38 d...@bighost.com.br wrote:
 Understood, using the simulation time in the groundcache makes it much
 easier to track. Now it is just a matter of accounting for the FDM and the
 integrator iteration delays in relation to the cache_time_offset. Hopefully
 with you patch and this explanation I will be able to finish it next week.
 Thank you again.
You are welcome.
Tell me when you need anything.

Greetings

Mathias

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-05-22 Thread Mathias Fröhlich

Hi Diego,

On Tuesday 19 May 2009 03:32:53 Diogo Kastrup wrote:
 I am sorry for the delay, finally I could get back to this. Besides
 moving to a new city/job, I have also bought a model airplane, so I feel
 like a child again with my new toy wasting all my free time playing.
Have fun :)

 I am changing the friction code to use the new API, but I am having some
 trouble. It looks like the velocities returned by the get_body method
 are always zero. Maybe the problem is in the
 void BodyFinder::apply(BVHMotionTransform transform)
 method as even when it finds the right ID it returns before the
 velocities are set.
I have not tested that part of the api. So testers and comments welcome.

Hmm, ok. I see.
Does the attached patch help?
With your code, you might have a better test bed than I have.

 Also I am having some trouble to synchronize the stuck point with the
 carrier movement again. I saw that there are some changes to the time
 offset passed to the Ground Callback in YASim.cxx. What should I
 expect to be already taken care by get_body? Is it compensating for the
 delay between the AI update and the FDM iterations? And what about the
 Integrator iterations? This was the hardest part of the friction patch
 so any tip would be very helpful.
*In* *theory* the groundcache expects times that corespond to the simulation 
time. FGInterface accounts for the difference between the start of the FDM 
instance and the simulation time (that is the cache_time_offset in 
FGInterface).
I believe that YASim did not track the simulation time itself, so I added 
that? True? Also, YASim internal integration steps do not know about the exact 
time they are for. You might need to take care of them.

There should be no delay between the FDM and AI iterations. The groundcache is 
valid for a specific time interval. And when you start integration, you should 
be at the start of that interval. Once you are ready for that timeslice, you 
should be no further than the end of the caches validity.
This is not checked.

You may enable the ground cache debug code be defining the GROUNDCACHE_DEBUG in 
groundcache.hxx. Then you can play with /fdm/groundcache-debug-level in the 
property tree and see what the groundcache contains. That helped me to 
understand the timeslicing in flightgear.

Greetings

Mathias
Index: groundcache.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/groundcache.cxx,v
retrieving revision 1.43
diff -u -r1.43 groundcache.cxx
--- groundcache.cxx	16 Mar 2009 09:48:18 -	1.43
+++ groundcache.cxx	22 May 2009 13:50:00 -
@@ -474,11 +474,10 @@
 
 if (_id == transform.getId()) {
 _foundId = true;
-return;
+} else {
+transform.traverse(*this);
 }
 
-transform.traverse(*this);
-
 if (_foundId) {
 SGMatrixd toWorld = transform.getToWorldTransform(_time);
 SGVec3d referencePoint = _bodyToWorld.xformPt(SGVec3d::zeros());
--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com ___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-05-22 Thread dk
Hi Mathias,

 I have not tested that part of the api. So testers and comments welcome.

 Hmm, ok. I see.
 Does the attached patch help?
 With your code, you might have a better test bed than I have.

Thank you for the patch, I will be out of town this weekend so I will try it 
next week.

 *In* *theory* the groundcache expects times that corespond to the simulation
 time. FGInterface accounts for the difference between the start of the FDM
 instance and the simulation time (that is the cache_time_offset in
 FGInterface).
 I believe that YASim did not track the simulation time itself, so I added
 that? True? Also, YASim internal integration steps do not know about the exact
 time they are for. You might need to take care of them.

 There should be no delay between the FDM and AI iterations. The groundcache is
 valid for a specific time interval. And when you start integration, you should
 be at the start of that interval. Once you are ready for that timeslice, you
 should be no further than the end of the caches validity.
 This is not checked.

Understood, using the simulation time in the groundcache makes it much easier 
to track.
Now it is just a matter of accounting for the FDM and the integrator iteration 
delays in
relation to the cache_time_offset. Hopefully with you patch and this 
explanation I will
be able to finish it next week. Thank you again.

Regards,

Diogo


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers  brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing,  
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA,  Big Spaceship. http://www.creativitycat.com 
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-05-19 Thread dk
 I'm sorry for the distraction, but since you brought it up, you have to tell
 us about your model airplane! :-)

Lol, of course, I should have imagined :)

 There is a small lake near my house I can walk to, so I have been having a
 blast on calm evenings with my Seawind park flyer:

 http://baron.flightgear.org/~curt/Models/Current/SeaWindEP/

 I also got my Shrike 40 flying recently ... that is a real kick ... bank and
 yank style flying, but it slows way up for pretty tame landings.  (It's
 about the world's simplest ARF so it only took me 5 months to assemble):

 http://baron.flightgear.org/~curt/Models/Current/Shrike40/

 I just ordered a Polaris park flyer kit ... usually takes me at least a year
 to put together an ARF and this is a kit, so no promises when this will be
 ready to fly, but it should be nice at the little lake near my house...

 http://www.rcgroups.com/forums/showthread.php?t=954314

 There are two HD (95Mb) movies you can download from the rcgroups thread
 that are probably worth the bandwidth if you enjoy cool airplanes.

Those are some really nice models. Mine is actually just simple trainer called 
Ready
Mk3. It is made of ABS plastic and theoretically it is very resistant to 
impacts (what
is important as it is my first model airplane). The place where I fly it has 
some lakes
and there is a floats kit for this plane, so I hope I will do some water 
landings
eventually. I have no pictures of it on the net yet, but you can see it on the
manufacturer's website:
http://www.thundertiger.com/product/4591-K.html

Regards,

Diogo


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing 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] YASim static friction

2009-05-18 Thread Diogo Kastrup
Mathias Fröhlich escreveu:
 Prototyped and checked in.
 I don't claim that it is bug free. So help chasing them :)
 
 Feel free to ask if something is too bad documented or does not work as 
 expected.

Hi Mathias,

I am sorry for the delay, finally I could get back to this. Besides
moving to a new city/job, I have also bought a model airplane, so I feel
like a child again with my new toy wasting all my free time playing.

I am changing the friction code to use the new API, but I am having some
trouble. It looks like the velocities returned by the get_body method
are always zero. Maybe the problem is in the
void BodyFinder::apply(BVHMotionTransform transform)
method as even when it finds the right ID it returns before the
velocities are set.

Also I am having some trouble to synchronize the stuck point with the
carrier movement again. I saw that there are some changes to the time
offset passed to the Ground Callback in YASim.cxx. What should I
expect to be already taken care by get_body? Is it compensating for the
delay between the AI update and the FDM iterations? And what about the
Integrator iterations? This was the hardest part of the friction patch
so any tip would be very helpful.

Regards,

Diogo


--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing 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] YASim static friction

2009-03-06 Thread Mathias Fröhlich

Hi,

On Thursday 05 March 2009 22:08:54 Diogo Kastrup wrote:
 That sounds great, I am looking forward to using this improved
 groundcache. I couldn't test it so far but I will try to update the
 friction code ASAP. Unfortunately I am going to stay away from fgfs a
 little longer than expected.

 What is the status of the the body fixed reference point API? I would be
 glad to help on you with that when I get back to it.

Prototyped and checked in.
I don't claim that it is bug free. So help chasing them :)

Feel free to ask if something is too bad documented or does not work as 
expected.

Greetings

Mathias

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-03-05 Thread Diogo Kastrup
Hello,

Mathias Fröhlich wrote:
 Ok, I am working on a major overhaul to speed up and generalize the ground 
 intersection stuff.
 So parts of what you code is already covered by that more general approach. 
 
 When I look at your patch, the only thing that is missing so far in the 
 ground 
 intersection api is the body fixed reference point of the body you are 
 rolling 
 on.
 I would suggest that we add this kind of reference point to the existing api 
 so that you can make use of that.
 
 As I told in an other mail, the way the surface velocities are computed and 
 provided to the FDM have subtle problems in the current implementation.
 May be this will already improve the way you stick on moving surfaces.

That sounds great, I am looking forward to using this improved
groundcache. I couldn't test it so far but I will try to update the
friction code ASAP. Unfortunately I am going to stay away from fgfs a
little longer than expected.

What is the status of the the body fixed reference point API? I would be
glad to help on you with that when I get back to it.

Regards,

Diogo


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-03-05 Thread Mathias Fröhlich

Hi Diego,

On Thursday 05 March 2009 22:08:54 Diogo Kastrup wrote:
 That sounds great, I am looking forward to using this improved
 groundcache. I couldn't test it so far but I will try to update the
 friction code ASAP. Unfortunately I am going to stay away from fgfs a
 little longer than expected.

 What is the status of the the body fixed reference point API? I would be
 glad to help on you with that when I get back to it.

Well, currently working on two problems. Still the memory stuff, which is, 
solved right, a tricky thing. And your interface as well as other useful 
interface additions.

What I can probably provide this weekend is something similar in the api to 
your current additions without the need to configure extra 'platforms'.

I am not sure if this is the right approach, but It will provide you with the 
information you need to have a reference position/orientation.

So, in principle:
Each get_agl call delivers additionally an opaque id of the body you have 
found in the agl computation. This id might be 0 which means you are standing 
on something earth fixed.
If you get a nonzero id value, you can with a new call 'get_body' get the 
transform matrix and velocity of that body with a given id and at a given 
time. This works as long as you have anything from this body in the 
groundcache which should be true for your implemented 5mm spring.

So the difference api wise is that you need to track the 'platform id' yourself 
instead of doing this in the groundcache/interface. Think of the case where 
the aircraft stands with the nose wheel on the carriers main deck and with the 
main wheels on an elevator. You will recieve the carriers's main id for the 
nose wheel and the elevator id for the main wheels. If you move the elevator 
down a bit, this still works.

Does this sound reasonable for you?

Additionally, there will be queries for 'nearest geometry in any direction 
closer than a given maximum distance'. Remember that the agl thing evaluates 
the nearest geometry looking downwards without distance limitation.
Usually this type of environment query is a little cheaper since the geometry 
what is queried is a small sphere instead of a large line, so less geometry is 
tested.
You will also get the body id here ...
This could be helpful for simple contact points. 

Greetings

Mathias

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-02-27 Thread Mathias Fröhlich

Hi,

On Monday 23 February 2009 03:41:17 Diogo Kastrup wrote:
 I finally got this working with the carrier, here is the patch. Please
 let me know what you guys think about it.

 Features:
 - No more sliding when should be stopped.
 - better behavior when cornering
 - better braking behavior *

 Problems:
 - More information about the brake system is needed to simulate the
 wheel locks better. This requires changes to the aircraft definition
 format. For now we may need to slow down the reaction to the brake
 button so we can stop planes easier without sliding. Brakes mapped to an
 axis should work much better.
 - More information about the tire in general could help improving the
 simulation.

 I may be a little busy and offline this week as I am moving to another
 city, but if you guys decide to commit this patch and some changes are
 required, just let me know and I will work on it ASAP.

Ok, I am working on a major overhaul to speed up and generalize the ground 
intersection stuff.
So parts of what you code is already covered by that more general approach. 

When I look at your patch, the only thing that is missing so far in the ground 
intersection api is the body fixed reference point of the body you are rolling 
on.
I would suggest that we add this kind of reference point to the existing api 
so that you can make use of that.

As I told in an other mail, the way the surface velocities are computed and 
provided to the FDM have subtle problems in the current implementation.
May be this will already improve the way you stick on moving surfaces.

Greetings

Mathias

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-02-23 Thread Diogo Kastrup
Csaba, thank you very much for testing. See my comments below.

Em Seg, 2009-02-23 às 04:59 +0100, Csaba Halász escreveu:
 I tested with the bo105 on solid ground first. It doesn't move an inch
 with engines shut down. During startup, it doesn't turn either. The
 s76c (which has wheels instead of skids) vibrates during startup (we
 can call that realistic ;))

That is weird, I will try to find out why. After a quick look, I am
concerned about the values of the spring and compression in the
definition file of the s76c. The static friction value is very high
also. I will do some tests...

(...)
 Apparently it happens because I have the carrier stationary. Setting
 it into motion, the bo105 starts up fine. With the s76c the carrier
 sails out from underneath even with the parking brake on (which is the
 default). With the v22, it only happens with the brakes off, which
 seems right. Setting the wind so that it cancels out the relative wind
 due to motion makes the v22 stay in place even with brakes off.
 Haven't tried maneuvering the Nimitz yet.
 
 The s76c problem might be an aircraft specific issue and the
 zero-speed carrier error sounds easy to fix. All in all it looks quite
 good so far.

How can I set the carrier speed to zero? :) I would like to reproduce it
here. Anyway, I think that moving the following lines to inside the if
(_slipping) loop around line 650 in Gear.cpp solves it:

// Get the direction of movement
float dir[3];
Math::unit3(cv, dir);

The carrier sailing out from underneath is strange, it looks like the
groundcache can't finding a intersection with the ground for these
aircrafts and it is using a fallback value. Can someone check if this
happens without my patch also? I will try to find out why this is
happening.

Regards,

Diogo


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] YASim static friction

2009-02-23 Thread Diogo Kastrup
Em Seg, 2009-02-23 às 17:58 -0300, Diogo Kastrup escreveu:
 The carrier sailing out from underneath is strange, it looks like the
 groundcache can't finding a intersection with the ground for these
 aircrafts and it is using a fallback value. Can someone check if this
 happens without my patch also? I will try to find out why this is
 happening.

Yep, the groundcache can't find a intersection. I think this problem
occurs without my patch also. To fix it just change groundcache.cxx
around line 312 from this:

if (d*d  reference_vehicle_radius*dot(n, n)) {

to this:

if (d*d  reference_vehicle_radius*reference_vehicle_radius*dot(n, n)) {

I am sending the diff again with the fix for this and the (untested) fix
for the zero-speed problem, just in case someone want to play with it.

I am still trying to figure out why the s76c is shaking. This happens
with other helicopters also, like the R22.

Regards,

Diogo
Index: src/FDM/flight.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/flight.cxx,v
retrieving revision 1.35
diff -u -r1.35 flight.cxx
--- src/FDM/flight.cxx	9 Nov 2007 05:39:13 -	1.35
+++ src/FDM/flight.cxx	23 Feb 2009 23:14:47 -
@@ -705,6 +705,15 @@
   return dist*SG_METER_TO_FEET;
 }
 
+void 
+FGInterface::get_platform(double t, double pos[3], float *orient)
+{
+  SGVec3d _pos;
+  ground_cache.get_platform(t, _pos, orient);
+  if (pos)
+assign(pos, _pos);
+}
+
 // Legacy interface just kept because of JSBSim
 bool
 FGInterface::get_agl_m(double t, const double pt[3],
Index: src/FDM/flight.hxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/flight.hxx,v
retrieving revision 1.18
diff -u -r1.18 flight.hxx
--- src/FDM/flight.hxx	27 Jul 2008 16:25:14 -	1.18
+++ src/FDM/flight.hxx	23 Feb 2009 23:14:48 -
@@ -629,6 +629,9 @@
  double end[2][3], double vel[2][3]);
 double get_cat_ft(double t, const double pt[3],
   double end[2][3], double vel[2][3]);
+
+// Return the position and orientation of the platform
+void get_platform(double t, double pos[3], float *orient);
   
 
 // Return the altitude above ground below the wgs84 point pt
@@ -642,8 +645,8 @@
int *type, double *loadCapacity,
double *frictionFactor, double *agl);
 bool get_agl_m(double t, const double pt[3],
-   double contact[3], double normal[3], double vel[3],
-   int *type, const SGMaterial **material,double *agl);
+   double contact[3], double normal[3], double vel[3],
+   int *type, const SGMaterial **material,double *agl);
 bool get_agl_ft(double t, const double pt[3],
 double contact[3], double normal[3], double vel[3],
 int *type, double *loadCapacity,
Index: src/FDM/groundcache.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/groundcache.cxx,v
retrieving revision 1.33
diff -u -r1.33 groundcache.cxx
--- src/FDM/groundcache.cxx	15 Feb 2009 00:56:22 -	1.33
+++ src/FDM/groundcache.cxx	23 Feb 2009 23:14:49 -
@@ -158,6 +158,7 @@
   _material(0),
   cache_ref_time(0.0),
   wire_id(0),
+  platform_id(0),
   reference_wgs84_point(SGVec3d(0, 0, 0)),
   reference_vehicle_radius(0.0),
   down(0.0, 0.0, 0.0),
@@ -198,6 +199,8 @@
 gp.vel = SGVec3d(0.0, 0.0, 0.0);
 gp.rot = SGVec3d(0.0, 0.0, 0.0);
 gp.pivot = SGVec3d(0.0, 0.0, 0.0);
+gp.platform_id = 0;
+gp.platform = NULL;
 gp.material = 0;
 backfaceCulling = false;
 // XXX state set might be higher up in scene graph
@@ -235,6 +238,8 @@
 break;
 default:
 gp.type = FGInterface::Solid;
+gp.platform_id = ud-carrier-getID();
+gp.platform = ud-carrier;
 break;
 }
 // Copy the velocity from the carrier class.
@@ -304,7 +309,7 @@
 // Only check if the triangle is in the cache sphere if the plane
 // containing the triangle is near enough
 double d = dot(n, v[0] - localCacheReference);
-if (d*d  reference_vehicle_radius*dot(n, n)) {
+if (d*d  reference_vehicle_radius*reference_vehicle_radius*dot(n, n)) {
 // Check if the sphere around the vehicle intersects the sphere
 // around that triangle. If so, put that triangle into the cache.
 double r2 = boundRadius + reference_vehicle_radius;
@@ -323,6 +328,10 @@
 t.sphere.setRadius(boundRadius);
 t.gp = gp;
 triangles.push_back(t);
+if (gp.platform_id
+ (platforms.empty() 
+|| dynamic_castclass FGAIBase*(platforms.back())-getID() != gp.platform_id))
+platforms.push_back(gp.platform);
 }