|
|
Posted :
7/2/2008 7:28:00 AM
by Matthieu Laban
Category :
.NET
Tonight I played a but with an open source silverlight project called DeepEarth. It's basically a Silverlight implementation of Microsoft Virtual Earth. It has smooth scrolling and panning and blending between different layers.
They have a live demo up here.
Of course, having tons of flight tracks handy, I thought I would add the functionnality to show them. The project doesn't currently support dynamic objects besides simple pins. But the code is clear enough, adding new features was extremely easy...
I added a simple line drawer with an open dialog to import a track file coming from my GPS Tracker.
Here's the result for a touch a go practice at Oakland last year. :)

I have some ideas about what to do with this... we'll see how it goes ;-)
|
|
|
Posted :
6/17/2008 8:35:00 AM
by Matthieu Laban
Category :
Flight Simulator Project
Don't ask me why... but I got this urge last week to change Infinite Runway's physics engine... It's a pretty stupid move as the physics engine is the most important part of a flight simulator... Anyhow, I made the necessary backups and started to play with the NVIDIA PhysX SDK.
I chose PhysX over Havok for obvious reasons ;-) But I did look into Havok... They have a pretty extensive support for vehicles, and their SDK is so much cleaner than PhysX's... However, the feature set I need in IR (Infinite Runway) is pretty limited, and PhysX's Api is much simpler to use for this.
The few required things for IR are: - A good vehicle model and behavior (for take off and landing roll, as well as general ground handling) - A good suspension/spring modelling (for the landing part) - The ability to directly place an object in 3D - The ability to apply forces at specific points on a rigid body.
ODE (the previous physics engine) featured all of these... but I wanted to move a bit further by defining shapes for the wings, breakable constraints...
One big advantage that PhysX and Havok have over ODE is that they have remote visualizers. PhysX's visualizer and code setup is very much easier than Havok's though. These visualizers come in handy when trying to figure out exactly what the shapes look like inside the physics engine. Without them, you are pretty much guessing, what the shapes actually look like in the eyes of the physics engine. I might sound dumb saying this, but when you have to deal with cross Up Axis stuff, not having a remote debugger can be pretty nightmare-ish...
I spent the entire week end (except for a little break to go spin an Aeronca ;-)) trying to adapt IR to PhysX.
If I count the numbers of hair I pulled over the course of the port, I'd say it went like this: - 80% trying to deal with Up Axis bullshit... Thanks ColladaMax for not doing the conversion yourself! and Max for being ZUP... - 10% was spent trying to make the suspensions look realistic... - 10% was spent tweaking the physics up to where it is right now.
I encountered a lot of fluttering during the last part where I tweaked the flight aerodynamics... It was simply due to a misunderstanding of the several layers of Actors/Body/Shapes each of which have their own mass or density... After reading the doc, things got clearer although I'm still missing some parts about how to set the inertia tensor based on the shapes of the airplane...
Here's an early video of status for tonight... The ratios and lift/drag scales definitely need more tweaking but it's getting there...
The funny thing is that the actual aerodynamics part didn't change by a single bit. Its only input is a transformation matrix, and a velocity at specific points on the airplane. And since this is still the same with PhysX, only the values will have to be tweaked :) Hopefully, this won't take long!
About the ZUP issues... The problem was that the assets I'm importing are all oriented as if the Z axis was pointing upwards. And unfortunately, IR is Y UP... And so is the physics engine, as it it setup... The trick is to inject a simple node at the root level of the aircraft that contains a slightly modified identity matrix. The children all carry this conversion when they are recursively updated. The physics engine and the rest of the game only deal with the converter node, and are then shielded from the UP Axis madness...
Below is a gallery of the latest screenshots taken this past weeks. I made some progress on the scenery modelling...
|
Posted :
5/28/2008 4:35:00 PM
by Matthieu Laban
Category :
Flight Simulator Project
The citabria is almost done... The moving parts, cockpit, wheels, painting are all done and the flight model is close to the real thing now, thanks to a new feature of FSP called Remote Aircraft Flight Model Configuration System. Tweaking a flight model in FSP involves two things:
- Flying the airplane and figure out what's wrong with the flight model
- Changing values to fix what's wrong
There are 2 types of values to edit in the form of straight floating point values (wing area, various coefficients...) or curves (lift and drag profiles). Doing these editions while flying can be very painful because the game has to be paused to allow value editing without crashing. This laps makes you lose the feeling you had just before the value was edited... and when you know you are very close to the ideal value, it's frustrating to go back and forth between the game and the tweaking window... There was an idea that had been in the back of my head for quite some time. Making this a team work. Obviously, doing it on a single computer is possible, but focus still has to be taken away from the main application, making keyboard shortcuts unusable. The solution is to allow remote configuration, over some sort of connection. After showing the Citabria video (see below) to Bruno, he told me he had to come and check it out!
Aerobatics in a Citabria! from Matt on Vimeo.
I thought, what a good opportunity to finally make the remote thingy work! It took roughly 4 hours to make everything functional, with quite a bit of wandering around, exploring several techniques. The approach I took was to use .NET Remoting. Remoting is great as it keeps me from having to mess with connection settings, sending data... A few lines of code can do all that setup work for you. The initial idea was to expose the AircraftParams instance that contains all the aircraft flight model values, retrieve it on the other side of the connection, and display the proxy object in the property grid... Unfortunately, this didn't quite work out the way I thought it would... The property grid was not happy about the proxy object and unable to traverse it with reflection :-( Since I was certainly not going to copy every field manually to another instance, or even display properties in text boxes a la MFC, I needed another idea... I eventually settled on something simple. Having a wrapper class what would be exposed through remoting, with a property returning a string containing the xml-serialized objects of the aircraft params. I didn't serialize the entire object as I couldn't really replace it when the values were updated since it was referenced by others objects in the app. I could however replace the instances containing the flight model parameters, which are only used locally and have no events. I added little helper to serialize/deserialize on both sides and voila! Bruno and I gave it a test ride and he could fly the aircraft while I was tweaking the values on another machine! Pretty sweet! Here are some pics of the tweaking flight... (Disregard the mess on the desk, it is temporary... ;)
|
Posted :
5/25/2008 4:01:00 PM
by Matthieu Laban
Category :
My Life
I don't know about you, but when I read an article in the mainstream media (CNN, CBS, or any of those...) that is about any of the topics I have some knowledge in, there is always a WTF in it... The one that appears the most is in aviation articles... like this one [cnn.com] "The aircraft cracked in two after it crashed at the end of runway 220" There is no runway 220... not even a 22... but a 20... Another example [dailymail.co.uk] : "He said air traffic control had come on the radio and said 'climb, climb, climb 10,000ft, you are going to hit a plane" Air traffic control would never say that, and they probably meant climb to 10'000 feet (from an altitude below that...)... You don't need a 10'000 feet avoidance maneuver to avoid another plane... And the news guys reports that, and make this complete BS the headline! Seriously... On a side node, I find it also very shocking is that the guy reporting this horrible incident gave them his picture and told them he was the CEO of a website which was mentioned in the article... WTF is that about! So I realize when I read those... what are all the stupid things that they write in the medical, finance, space stories that are completely wrong and misleading?? I wouldn't know, I'm no expert at those... but by extrapolating, I can guess that these articles are as full of BS from dumb reporters as the aviation and computer related articles...
|
Posted :
5/23/2008 7:40:00 AM
by Matthieu Laban
Category :
Flight Simulator Project
I mentioned here a few months ago that I had found a name for the simulator... I'm not quite ready to reveal it yet... but I'm working on the website... I've got two versions... one fully in Silverlight 2.0 and one in boring old html+css... I'm not sure which one to use... On the coding side, not much has changed... Lots of things have kept me away from VS2008 these past few weeks... but I'm glad to say they are sorting out... at least I hope... I'm currently working on modeling a Citabria 7ECA in FSP. This will be the second tail dragger in the simulator, the first one being a Piper J3 with an extremely lousy flight model... Having real flight experience in a 7ECA will certainly help... at least for the non aerobatic part... I'll leave the +60 degree of bank and +30 degree of pitch flight envelope for Bruno to tweak ;-) The 3D model is not complete yet, but the basic shape + initial texturing is done and it looks pretty nice already. I haven't modeled the interior yet, but that'll come last as it's my least favorite part of aircraft modeling... In other news, I now have a twitter account... for those who want to follow, here is where you need to go: http://www.twitter.com/mlaban Time for a bit of GTA IV before going to bed...
|
|
|
Posted :
4/6/2008 3:32:00 PM
by Matthieu Laban
Category :
Aviation
Yesterday, I flew with two friends from my school who live in the area. We went for an extended bay tour, departing from Palo Alto, overflying SFO Airport, San Francisco, Alcatraz, the Golden Gate Bridge... then we continued north to Petaluma for a quick touch and go... and finally straight to Point Reyes before coming back to PAO via the shore line.
Flying the G1000 is just fantastic, traffic awareness, moving map, integrated radios, in flight weather (metars, cloud coverage...), and even XM Satellite Radio :)
Petaluma was really crowded... I was expecting an empty traffic pattern, but there were lots of airplanes all over the place... That was probably because there was almost no wind and no turbulences, which is not a frequent occurence at Petaluma. On our way home, I was monitoring Norcal, and we kept hearing airplanes asking for flight following to Petaluma... At some point, we heard something like:
Airplane: "Cessna 123K, request flight following to Petaluma" Norcal: "Who isn't today?" :)
Another thing I like about the 172SP is the autopilot. It comes really handy when transitioning through SF Class Bravo to leave time for traffic spotting and listening to the controllers... and also, when used in NAV mode, you are sure to go directly to a point, and not wander around your desired track :)
Unfortunately, I couldn't keep the track for this flight... My 96C was in the back, over my flight gear, and couldn't even get a fix from there... (because of the high wings I suppose...)Too bad it doesn't have a better GPS receiver in there... my $50 bluetooth receiver works much better...
|
Posted :
3/7/2008 9:12:00 AM
by Matthieu Laban
Category :
.NET
Silverlight 2.0 Beta 1 was released on Wednesday and I've had some time to play with it. I coded two application, one that connects to my website and retreive all the comments posted by my fellow readers, and another more amusing one, a small minigame...

Click on the image to get to the game page! (Silverlight Beta1 can be installed from the game page, it's a really compact download and quick install)
I've included the source code. It might not be super optimized, super smart, super kewl... but somebody might find it useful...
Click here to download the source code
If you are a silverlight guru and know a better silverlighty way of doing things better that how I did, let me know! :)
|
Posted :
3/3/2008 8:35:00 AM
by Matthieu Laban
Category :
Flight Simulator Project
Two quick videos before going to bed...
I worked on the Autopilot today... trying to get rid of the shimmering/stuttering effect in the yoke whenever the autopilot was in control. I solved this problem by fixing a long time bug which had the animations of the control surfaces and moving parts tied to the joystick rather than the actual physical damped values set by the flight model.
The way the controls are moved in a different manner for each airplane is done via a simple delayed response with non linear interpolation from the joystick inputs multiplied by a scalar on the input value. The delay is independant for each control surface, so the longer the delay, the slower the aircraft will respond to a user input from the joystick. An aircraft with a fast response would be an aerobatic airplane, and an airplane with a slower response could be a Cessna, Piper, or even slower for an airliner...
But the jitteriness was not only due to that animation bug, there was another problem with the PID controllers... linked again to the chaining of two pid... the first pid had issues when calculating the derivative for small corrections, which made it output spikes, which in turn caused even more disturbance in the following PID...
I also made some changes to the wind/turbulence system, and the following video shows the Autopilot in action in severe turbulences. I could watch this video for hours... I love how the controls move on their own to counter the wind forces :-) The second video shows the failure of the autopilot, I had set it to a low speed, with heavy turbulences... it shows how a turbulence that was a tiny bit too strong knocked the plane over and threw it in a spin... It's funny to see how the autopilot is still trying to recover hopelessly during the spin :-)
Just one note though, the airplane doesn't have an spin-out system, I just disconnected the autopilot and got out of it before it was too late!
Autopilot fighting... from Matt on Vimeo.
Severe Turbulences with Autopilot from Matt on Vimeo.
|
Posted :
3/1/2008 5:53:00 PM
by Matthieu Laban
Category :
.NET
Silverlight 2 is coming... this is my dream come true... create desktop like experience in my favorite managed language, but on the web! (and cross platform!)
Beta 1 will be released next week during Mix08 in Las Vegas!
Scott Guthrie has a list of tutorials to demonstrate how to create a simple silverlight widget that connects to the Digg.com webservice.
I'm really impatient to try this new beta! I played with 1.0 and 1.1 but it was too javascipty for me and there was pretty much no support for built in controls. Silverlight 2 will come with a list of controls like buttons, lists, progress bars, images, video controls and even a datagrid (!), which is just what I need! (Hello Linq Queries!!)
This will be the opportunity to re-do the FSP's website draft which lead to the rant post about html last month... let's hope Silverlight helps me out with this!
|
Posted :
3/1/2008 5:33:00 PM
by Matthieu Laban
Category :
Aviation
I finally had time to fly with an instructor at West Valley to complete my G1000 checkout and BFR. We flew for about an hour, played around with the G1000 (but looked outside 90% of the time ;)) did some stalls, slow flight, touch and goes, landings in different configurations, go around and used the autopilot a bit...
The 172SP G1000 is a very cool machine, it flies so much faster than the planes I usually fly in, and it is incredibly easy to control!
So two days ago, while I was watching Max Trescott's G1000 CD section about the KAP 140 (autopilot), I realized that the designers of the autopilot must have had the same problems as me... I mentionned in an earlier post that I had difficulties tweaking the autopilot PID's at low/high speeds... But here are the autopilot limitations:
Cessna 172R/S Autopilot Limitations (Reference the appropriate PIM for the complete list of limitations) Maximum Airspeed ........................................................... 140 KIAS Minimum Airspeed .............................................................. 70 KIAS Minimum Approach Speed.................................................. 80 KIAS Maximum Flap Extension...................................................... 10 deg
How interesting! And thinking I was trying to make the AP work at 65kts or less with full flaps!! I should have come up with such limitations as well! And I will ;-)
So Bruno, when are you coming with me so I can teach you how to use the G1000 ? :)
|
Posted :
2/25/2008 6:38:00 AM
by Matthieu Laban
Category :
Flight Simulator Project
Ever since I started flying on the G1000, I've wanted to find a way to add G1000 support in FSP, or at least something that looked like it. I had tried simulating the Cirrus Glass cockpit in the past, but the heavy graphics made the whole thing render super slow... The gauges are setup super simply inside 3DS max by entering the gauge C# class name to use for each 3D object desired to be "gaugified". For example, the G1000 gauge is just a 2D plane in front of to the panel that has his user properties specifying that this plane should be treated as a gauge, and that the gauge class to use is "G1000Gauge". When reading the aircraft model, FSP will detect that this geometry is supposed to be a gauge and will automatically apply a new texture made of the output coming from the G1000 class. This texture will be updated by the gauge class... This goes the same for all gauges in FSP. Now, the issue is how do I update the texture? There are two approaches I see to this problem:
- Render to System Memory using GDI+ and then copy the bitmap to the device texture.
Pros: GDI+ makes it very easy to do awesome things, so no crazy framework to develop, built in support for text drawing, shapes, transformations, alpha... Cons: Can be extremely slow. The part that renders the GDI+ stuff is actually pretty fast and renders at several hundred frames per second depending on the level of optimization. The big downside is the copy from system memory to video memory... This is an extremely costly task and there are no ways around it, as far as I know...
- Render directly to a Render Target used as a texture later applied to the 3D object in the scene.
Pros: This is all done on the GPU, except the part that builds the vertices. So no copy from system to video memory. Cons: Making things look cool takes a significant amount of work. There is limited support for string drawing, no built in support for painting shapes, this all has to be done by hand. (I'm lazy, remember?).
I started with the first one, as it was definitely the easiest... then moved on to the GPU approach... realizing that coding avionics like the Garmin G1000 for a Technologically Advanced Aircraft (TAA) would be extremely difficult. I have coded support for rendering rectangular shapes, ellipses, textured quads... but to get to the same l In the end, I think I'll have a mix of both. Standard steam gagues will be rendered using the GPU path as they don't need GDI+ stuff and the support for rendered quads is already there. TAA Gauges will be rendered via GDI+ and copied to the video memory, but that work will be done in a different thread. The GDI+ Rendering and memory copy a task that I originally tried to perform in the main thread. This was fine until I added the second G1000 screen. Copying these two 1024x768 textures literally killed performance. I already have some sort of basic scheduling to only render gauges at a user defined frequency, but this is all done in the main thread, which is fine for fast rendered gauges that only have one background and a needle, but for the G1000 gauge, that work simply cannot be done in the main loop. To fix this problem, I moved the G1000 rendering to its own thread. The gauges double buffer the textures so that when the engine is rendering a texture, the thread is preparing the next one. I can achieve reasonable frame rate (60fps) when the drawing thread has a low priority. I used a similar technique for my terrain tile rendering, only this time, the thread does the computation of the tiles and prepares packets that the main thread will render to textures tile by tile after the scene is rendered. That way, even if the work is heavy, it's spread across many frames, so the overall frame rate drop is not noticeable. Doing all the work at once every two seconds for example will introduce a lag every two seconds, but doing a little bit of work every frame will produce less of a slow down.
Now, let's move on to some pics and videos :)
Click on the video titles to see the HD version...
Landing in FSP with Garmin G1000 Preview from Matt on Vimeo.
Take Off in FSP with Garmin G1000 Preview from Matt on Vimeo.
|
Posted :
2/25/2008 2:50:00 AM
by Matthieu Laban
Category :
Aviation
Two weeks ago, I flew in the evening with Cory, for my introductory flight in a 2006 Cessna 172S NavIII equipped with a Garmin G1000. The Garmin G1000 is the set of two LCD panels replacing traditional steam gauges.
Since I joined West Valley, I flew on PA-28's, Citabrias and Cessna 152's. I was fine flying the Archers/Warriors, but I wanted something new for a change. I flew on a G1000 aircraft with Ismael a while back, but never got around to try it from the left seat. So a G1000 transition was a perfect idea.
G1000 Cessnas are little more expensive to fly but much more fun.
We flew to Hayward in N1322K for a couple touch and goes and back to Palo Alto. Flight went without a hitch. The G1000 is a really impressive piece of equipment. All the information you need is there on these two screens. It can be a little overwhelming at times especially when you are busy with radios.
One note I have though... I've been a little disturbed by the fact that the airspeed indicator is a vertical bar where the current airspeed is written text. The good thing is that you know exactly what your airspeed is... on the other hand, you have to read the values... Steam gauges make it easier as I just remember where the needle should be, angle wise, so a quick glance can tell me if I'm above/below that angle that I set to myself...
I haven't flown since that time, all subsequent flights have been cancelled due to weather... Let's hope next week end will be better! I've been practicing on the simulator enough! And Max Trescott's G1000 CD-ROM gave me lots of tips I want to try for real!
|
Posted :
2/12/2008 9:22:00 AM
by Matthieu Laban
Category :
My Life
This is going to be a big rant at what I consider one of the biggest rip offs I've ever faced... Airline Companies are just thieves. I don't understand how they can get away with stealing money from people...
Here's the story...
Julie and I booked a flight with Air France, way ahead of time in November for this coming March. We thought we would get better fares since it's popular knowledge that early bookers get the best fares... Well, it seems that Airline companies are now taking advantage of this to rip people off and bump the prices up whenever it pleases them...
The fare we got via Air France at that time was a total of 2800+ dollars. 1400 per ticket... We didn't have a choice, we were under presure... what if we don't book now? It might get even more expensive or even worse, the flights could become unavailable if completely booked... So we booked... we wanted specific days, and the best fares were barely better, around a couple hundreds cheaper if we offset the trip by one or two days...
I kept monitoring the prices, and realized that one month and a half later, the fare had melted by a couple hundred dollars... which would have make us save around 400 dollars... not worth it, the cancellation fees would hit hard and we would barely make any money out of it...
So I continued monitoring... and finally figured out the trick to get the cheapest fare with Air France... The way they allow you to choose the fare you want is by first selecting the departing flight, and then the returning flight... The trick was to figure out that the departing price has a HUGE impact on the returning price...
Here's an example:
Departure March 21 March 22 March 23 March 24 Price 800 700 300 300
Select the March 21 Departing Flight, here are the available return flights... Return March 30 March 31 April 1 April 2 Price 700 700 800 600
Now select the first cheapest date, March 23rd, here are the available return flights...
Return March 30 March 31 April 1 April 2 Price 3200 3200 300 300
This brings me to say: WTF!!!!
Needless to say we changed the flight... which I thought would be easy... well, the part about booking the new flight is easy... of course, money goes their way...
Then, I needed to cancel the other one, which I unfortunately booked with Expedia... for an Air France flight... I called Expedia to cancel the flight. This took a few minutes.
One week later, Air France was starting to take their sweet time refunding the money they took from me in a second...
So I called Expedia again. They said, "blabla, we sent the refund request blablabla". I called Air France, they told me "blabla, we haven't received anything... blablabla... call us back... even then, it'll take a month to give you the refund... blablabla".
WTF is wrong with the world!? Why aren't the consumer organizations doing anything about this absolute rip off? We are talking about $2400 here! I can do lots of stuff with that money!
By the way, yes, I said 2400 hundred dollars... because there is a $200 cancelling fee I mean THEFT fee for cancelling a ticket whose price they purposely inflated in advance to push you to cancel it at a later time!
And there is absolutely nothing that I can do... it's so unfair... life sucks!
I would file a complaint... but why bother... These damn phone operators are trained to be heartless... And I'm not wise or old enough to make make them cry and transfer me to their supervisor...
So to sum it up:
- They had my money for 4 months - They took interest on MY money - They lowered the fares making feeling like a complete dumbass for not cancelling the first tickets - They STOLE $400 from me for NO REASON because I cancelled 2 months in advance on a flight that they will have NO PROBLEM filling anyway. Ass holes! - They NEVER gave me the interest they made on MY money - They took their sweet time to actually refund the money, taking advantage of every single second of interest they could get... - And, they have a 90% chance of being on strike for same random lazy-ass reason... ( they are french after all... learning how to strike is a 2nd grade class there )
Can anybody remind my why I chose Air France? I don't remember... Oh yeah... a direct flight... from San Francisco to rip-off town!
This story makes me remember something very insightful a friend of mine told me not so long ago: "The world will never go right as long as the main purpose of every single human is to screw the other ones over"
Next time I hear an airline crying about some BS or even better, filing for chapter eleven, I won't feel sorry for them, they only got what they deserve, and it's called Karma!
</rant>
|
|
|
|