Delen via


Windows CE, .NET & Remote Control Planes

I actually have a hobby that doesn't involve computers...at least that's what I thought. First off, I'm still categorized as an R/C beginner. My first plane was a quick RTF (ready to fly) plane. I then went on to e-bay and bought an electric helicopter but it was poorly designed and if I broke any parts on it, they had to be shipped from some place far away (Korea I think). That was last summer. Now that the weather has improved recently (which is pretty strange here in the Northwest to have sunny days in February and now March), I went on bought another helicopter. It was a total impulse buy since I was planning on buying a 3D plane. So how does Windows CE and .NET figure into this equation? In 2 different and unrelated ways, so I'll start with Windows CE first.

When you fly a remote control airplane, you use a transmitter (duh). Transmitters have quite a big price delta from the really cheap (e.g. $40) to the really expensive ($2200). The expensive one I am talking about is the latest transmitter from Futaba (for what it's worth, I own a Futaba 7c and really like it). What makes this transmitter so special is that it's powered by, you guessed it, Windows CE. First off, let's take a look at the screen:

Compared to all the other boring monochrome transmitters on the market, this is quite a step up. You'll notice there's a picture of a plane on the screen. The Futaba 14mz transmitter has a compact flash slot. For each model you set up on the transmitter (you can store up to 100) you can have a custom picture for it. The screen itself is a touch screen (not sure if there's an attached stylus) and is backlit which makes sense since you'll more than likely be flying on a sunny day. What's even more remarkable is the transmitter actually uses dual processors. One processor handles the communication between the transmitter and the plane while the other is used for Windows CE and the input system. For more info on this awesome transmitter, go to https://www.14mz.com/index.html.

Now for the 2nd part of my post, .NET and R/C planes. In order to hone up my flying skills (or lack thereof) without worrying about crashing, I purchased a R/C flying simulator that is truly top notch, Aerofly Professional Deluxe. It was really a toss up between that one and another called Reflex XTR. Both of them have photo-realistic graphics (as you can see in the screenshot below). I chose Aerofly Professional Deluxe over Reflex since I had heard from others that used both that Aerofly's physics with regards to 3D planes was more realistic (Reflex XTR's strongpoint is heli's). First off, a screenshot and then the .NET tie in.

 

After playing around with the sceneries included in the software, I really wanted to figure out how to either make my own and/or import other user made sceneries into it. I only found a couple for the sim which was a little disheartening. However, a command line tool was released that would allow you, get this, to take a panoramic image file and import it into the sim. The Reflex sim just so happens to use panoramic images for the sceneries instead of some proprietary format. Even with this tool however, you still had to perform quite a few manual steps. Some of the steps included resizing the panoramic image to the size needed by Aerofly (the Reflex scenes were sized differently), making sure you don't stretch the image when you resize it, using the tool to convert the jpg to a cpg (which I assume means compressed jpg), running the tool again to create the scene tiles, creating a geo file which tells Aerofly how to read certain information, create 256x256 and 64x64 bmp's for thumbnail images, placing all this in a certain directory structure and probably a couple more things that have fallen out of my brain. Well, being the software geek that I am, I fire up Visual Studio .NET 2003 and begin coding a small utility that will automate everything possible.

So, to make a long story short, it took me about 2 hours to complete. While I was coding I made sure that I kept 2 principles in mind:

  1. K.I.S.S. - You should know what that means. The tool itself with its UI, albeit ugly, is extremely easy to use. Simply fire it up, click a Browse button, browse to the scenery you want to convert and hit the Convert button. A status window keeps you up to date on what's going on (a Reflex conversion actually takes a couple of minutes). Keeping it this simple made a chore that could take upwards of 15-20 minutes down to 5 minutes or less.
  2. Control the garbage in: When people create new scenes for others to do, no one follows the same methodology with regards to directory structure, file formats, naming conventions, etc... I created the tool to fully inspect the files (recursively inspecting all subdirectories) to allow it to work with whatever you throw at it.

The tool has become quite the hit with users of the software. Furthermore, not only did I create it to convert Reflex XTR scenes, you can also throw it a regular Aerofly Professional Deluxe scene (a lot easier to do manually, but still requires a few steps) and even the older version of the software Aerofly Professional (a little more difficult since you manually had to convert 10-15 jpg's into bmp's, which my tool obviously makes much simpler).

There you have it. A hobby that I took up in order to pull myself away from the computer has backfired (but in a good way I think). The Futaba 14mz is a rc'ers dream (at least for me it is) with the cool looking Windows CE based UI. Writing the tool for Aerofly Professional Deluxe in .NET proved to be really quick (would have taken me a little longer to do in C++) and is quite handy to have around.

Comments