Showing posts with label Flight Simulator. Show all posts
Showing posts with label Flight Simulator. Show all posts

Thursday, August 03, 2006

Moog screenshot

Here is the screenshot you were promised yesterday:

Some more changes were done today..its getting better everyday..hmm..The stop server button is not aligned properly...grr..

Wednesday, August 02, 2006

Modularize Modularize Modularize

Four years of software engineering and years of getting that word hammered into my brain and I still failed to follow that concept at work which got me in trouble later as I have been modularizing my work for the past three days..If I did it from the start I would not have had this happen. The problem is that everything was together and I had no easy way of modifying the interface. Modifying anything on it required creating a new interface file, then copy the generated code and replace the old code in that one file I had. So I got sick of that, plus it would not be a good idea to hand that source to my prof as it was not organized at all. Now all the functionalities of the interface are in one file, and the look of it is in another that gets produced automatically by Fluid which comes with FLTK. (If you remember what I was talking about a month or so ago).

Heres a screenshot taken today:

..great...my blog does not want to upload a photo..I shall put it up later.

Thursday, July 06, 2006

Linux virtual keyboard

Since it doesnt make any sense to have a physical keyboard inside the flight simulator it makes a lot of sense to get a virtual keyboard such as xvkbd. Like any other open source project, it comes with the source so that you can modify it to your own needs. After playing around with it yesterday to figure out what needs to be done to tailor this for FlightGear and Vdrift I got a draft of what this virtual keyboard might just look like at th end. Ofcourse theres a few more keys that need to be added. You can also have several of them running so for example I get the FlightGear keyboard running, and then another default keyboard to allow for regular input into the machine. Heres a screenshot after setting up the necessary options:

So at the top is the default keyboard if needed. Below it to the left is a numberpad to allow enterring coordinates and other autopilot options in FlightGear. Finally, the FlightGear keyboard is on the right. I split them this way because I thought it would be good for the user to just have whatever keyboards they need and minimize the rest. Ofcourse this script should be put on the desktop to easily start these up using the touchscreen.




Like I promised, World Cup updates will be over when its done and only if Italy wins, otherwise Ill be ranting about that for a while (jk, even I can get bored from Italy and its soccer) The final is on Sunday, and against the Frenchies. For those who recall the Euro Cup two years ago, theres some unfinnished business between the French and the Italians when the Italians unfortunately lost a game they were winning until the last two minutes (break a leg Wiltord!) On the other hand, the Italians have a better squad today which works like one machine so I doubt the French have a chance of even scoring. Note that the Italian goal did not "lose its virginity yet" except for that own goal. (Now that sentence sounds a little bit dirty...too dirty) Don't you come and tell me "but they beat Brazil", since when does Brazil have no shots on goal, I don't get it but I am glad that team is out.

Now on to a topic a lot of you love to joke about - " Nael's Deportation Adventures". Although I was accepted into grad school by Computing and Software, I still need a final approval from the School of Graduate studies and that is what I am currently working on. My cumulative gpa doesnt satisfy their requirements, but thats just because of first year, and that had nothing to do with what I am doing now so my professor sent a letter along with my application. Hopefully that works out and I get my letter so that I can renew my permit and NOT get deported. I am still playing on both fields though and applying for jobs just incase something goes wrong (aha..deportation contingency plans), so I have an interview tomorrow with a startup in Toronto. Let us see what that brings us. Until now, I am still more interested in what I will be doing in grad school althought it might not pay anything but at the end I believe I shall be better off.

..and ofcourse Forza Italia!

Friday, June 23, 2006

Vdrift - Racing Simulator

After getting the FlightGear working right using DTK, I was asked to get Vdrift doing the same. Vdrift doesnt come with many command line arguments and built in programs like FlightGear so a lot of the stuff had to be done from scratch.
First I had to modify the Vdrift source to record accelerations in all 6 dimensions. This was easy enough to do. This had to be done in the same format defined in the xml file written for FlightGear. After re-compiling the source, and running the game, the car was bouncing like a bunny all over my screen! After a quick check on the Vdrift forum I found out it that it requires an older compiler than what Fedora 4 or 5 come with. I got hold on some Slackware 10.2 CDs after MvM suggested that I use that instead since most of the packages we need have a slackware version which should avoid problems. Anyway after doing that, the vdrift source compiled fine and I got all the required drivers (joystick & Nvidia) and software/libraries (Fltk, DTK) installed properly.

All that was left is to get the UDP listener I wrote for FlightGear listening to the same port vdrift is writing to. I added two new command lines to vdrift to control the frequency of writing to the UDP and the host it should write to.

I produced this screenshot while running everything together on localhost.

The scope at the bottom comes built in with the DTK-Diverse program. The blue lin in the middle is supposed to be the force of gravity (in the Z-axis) but for some reason it comes out very close to 0 from vdrift, so it never moves. This can't be right as it should move at least when I am driving over mountains or down a hill. Anyway I will figure this out later, the physics engine for Vdrift is buggy anyway and nowhere as good as the one that comes with FlightGear.

Thursday, June 22, 2006

Flight Simulator updates

Plenty of progress over the past few weeks in this project. The re-construction of the room in ITB is almost over and we have access to the flight simulator now. There still seems to be some communication error over the serial connection but theres progress in that everyday. Hopefully we will have the communication working right soon. Meanwhile I have been working on the user application. So far its working ok communicating with the game. It allows the user to turn the simulator on and off and provide access to the filters that are used for the motion cueing. Also some basic feedback messages are outputted to the screen.

Here are some screenshots of how it is laid out:




I will be taking pictures of the simulator soon, from the inside and out. The onboard LCD is really clear -but there are two tiny scratches on one side of the screen, wasnt me! I think it was the construction workers...or maybe the people who installed it. Who knows.

I did not take lunch today so I am going to head out shortly. I am starting a new working out schedule today so I am very pumped!

Thursday, May 25, 2006

Concorde at 1000mph, FlightGear, DTK - FUN, fun, fun

After a couple of days working at it, I finally got one of the software components of the project working. The people who made Flight Gear are really smart and gave users a way to read and write values into the game simulation. This is smart because it means reading the accelerations from the game can be done, which then can be mapped into translations for the Moog Motion Base (the actual Flight Simulator) and together this gives the user the 'flying experience'. With a little motion and watching the screen, the brain can be tricked and the person is immersed in a virtual flying experience - this is also known as motion queuing. The same can be applied to race car simulators, boat simulators, etc. etc.

Now some fun stuff! On the FlightGear website you can download more scenery and planes. I chose to download a Souther Ontario map, a U.A.E. map and a Concorde plane. Installing them was easy - just unpack into the correct directories and you are ready to fly. The Hamilton, Abu Dhabi and Dubai maps were really boring. Dubai was not as bad as Abu Dhabi which was all desert and a one runway airport - but still boring. So I ran the simulator with the Concorde model and took some screenshots. The one below was the best - flying at 100mph! (woops..I turned off the speedometer without realizing it so you cannot see that - tough luck)


For those who are interested in knowing the details...
FlightGear
So for those who are interested in knowing how this works - continue reading. Like I said FlightGear gives the user a lot of control in the simulation. You can read the simulation parameters from a browser, write to serial ports, send TCP or UDP packets and whole suite of other protocols. UDP packets are easy to deal with, just reading and writing to the UDP port - just like a file. Using an XML document you can tell FlightGear which values you are interested in. In my case these were the accelerations in all six dimensions - x,y,z, roll, pitch and yaw (look those up to know what axis they are). Now what is left is to write a little UDP listener that will listen to the port you specify and read the packets as they arrive. Because it will arrive as a string of numbers, the easiest way to read each parameter is through defining the format yourself in the XML file. I used a '*' to separate them and broke the string that way when it arrived.

DIVERSE - Device Independent Virtual Environments - Reconfigurable, Scalable, Extendable (DTK)
The next step involves this library which can be found here. DTK is the 'glue' that 'glues' everything together. A whole collection of C++ client, server and utility programs that manage the shared memory and allow other applications on other computers on the network to read and write from it. Since the graphics will be running on its own on one machine and another machine will run the physics engine for FlightGear this makes communication easy. After reading the UDP packet it can be written to the shared memory using DTK and then these values can be read by any remote computer that is connected to this shared memory. All you have to learn is how to read and write from it, and that is covered by the beginner's tutorial on the website. You might be asking yourself why can't we just run everything on one computer like any other game? The answer is simply quality. One machine might start lagging if it has to take care of user input from the joystick, filtering it and then passing it to the FlightGear engine and produce graphics on the screen. Having one high-end computer do the graphics can make the simulation much smoother and more realistic which is really the whole point of having a simulator.

Friday, May 19, 2006

FlightGear 747-300 over Golden Gate Bridge

Today was a very productive day. I was able to get the joystick to work over the network and watch its behavior on one computer from another. This is required because the computer that will produce the graphics in the flight simulator is separate from the one which will read the user input through the keyboard and joystick and thus both have to communicate for FlightGear to produce the right graphics and all. I took several screenshots of FlightGear in action while flying a huge Boeing 747-300. The shots are even better than the previous shots I posted.

747-300 flying over the Golden Gate Bridge
Zooming in on the 747-300
Woops..yeah the plane crashed after I did that

Have a good long weekend everyone! I still do not have any plans so give me a shout if you are doing anything fun, like flying a 747 for example..or something..

Wednesday, May 17, 2006

FlightGear on Fedora Core 5

After two days of mucking around on this computer at work I finally got FlightGear to install. It was a long battle yesterday and I finally got it to work this morning. Yesterday I had problems getting the nvidia graphics card to work on FC5. Thanks to Stanton Finley for his thorough Fedora Core 5 installation notes.
So after installing that, I learned that I had to use the FlightGear package compiled with SDL otherwise it will not work on Fedora Core 5. God I wish I knew that yesterday! The other package will NOT work on FC5. Also for some reason it will crash if you do not run it as root...

So why am I playing with a flight simulator when I am supposed to be working? This is what I am supposed to be doing. After figuring out how to manipulate the FlightGear simulator I will have to make it work with the actual flight simulator (which I still did not take pictures of as I do not have access to the room yet). The graphics are real nice with this nvidia graphics card. I also got a joystick I can use, but still did not figure out how to fly. Heres a snapshot:

Anyway, thats my update, now I need to learn how to fly!! I was able to move the plane a little bit..but wont fly! Maybe I should go over the tutorial...

Monday, May 15, 2006

First Day

After a whole month of bumming around, I started doing something productive with my time. Yeah yeah some will say 1 month break after graduating is too short, but given my circumstances with Immigration Canada and the fact I would get deported by September if I do not find something to do, I do not have the privelege most graduates have of taking the summer or anytime off.
So today was my first day at work in ITB. I am working on the flight simulator project and have to get it setup and working. The job requires some knowledge about control systems which I have learned about in 4th and 5th year, but that is not required until a little bit later. Today I just had to setup a small 4 computer network and get Linux running on them. That was almsot done today except for one which for some reason never detected the keyboard. I had to wait until around 4pm when I got a USB keyboard which might work. I decided to leave the test until tomorrow as there was not enough time.
Now back to the computer problem I was having, after opening it up it was definitely a problem with the connector which I cannot fix, so I took it to a computer store and I was told labor is going to cost $120 to fix it + pieces..coming to a grand total of $180!!! I was worried about that because when I opened the laptop, the connector piece on the motherboard was covered with a plastic cover that cannot be removed. I have no idea how they will do it. I am going to call HP tomorrow to find out how much it will cost to fix it there...but $200 is rediculous..given that on eBay the selling price is around $550 for my laptop now..I might as well just sell it..hmm maybe I can find out if the store would buy it...
Anyway, I dont have access to the flight sim room yet, as it is still being rebuilt because they had to break the walls to get in...remember? I will post pics as soon as I take them!

Tuesday, May 09, 2006

Flight Simulator?

A few days ago I got this email from the professor I hoped to work with in grad school. He showed me around the robotics lab and it was really cool..lots of neat stuff. Anyway, this email was about if I was interested in helping him program the flight simulator. At first I had no clue what on earth hes talking about but today after I went to meet him...all I could say was "WOW!!"

The department purchased this $250,000 flight simulator with a cockpit that fits 6 and a flat screen tv inside..just like the ones you see at Canada's Wonderland or CN Tower. He wants to setup some joysticks inside and have people control the plane and experience the flight. This cockpit is huge!!, its too big to fit in the room they wanted to put it in, so they had to knock down the wall! Its as wide a a minivan and around 3m high! I am really excited about this, I think I start next week.

I also met with a professor from the Mech. Eng department and they have might sponsor me, which is good because the professor I wanted to work cannot fund me which means I would have to pay for myself. So if the Mech Eng prof accepts, I can work with him on his project, have that as my masters project, have my software prof co-supervise, and I get funding from mech eng. All in all, I hope this works out as well!