Saturday, August 1, 2009

Blog moved

This blog has moved to live.com:

Please go to http://anjdreas.spaces.live.com/ .

Thank you!

Friday, July 31, 2009

Sunlight shading and air friction (drag)

Here are a few video clips of flight by joystick through the generated terrain. The helicopter is now also rendered with the same sunlight shader as the terrain, so you'll see how nicely it turns a black silhouette when chasing it towards the sun.







The second video clip shows flight in higher velocities to demonstrate the air resistance in the physics model. I'm currently using the drag equation for objects in high velocities. I could probably have used the Stokes' drag model which is simply a linear increase of drag over velocity, but one of the goals for this project is to achieve a high level of accuracy on the physics model.





To decide what drag model to use for the air friction vs. the fuselage (ignoring rotors for now), we must calculate the Reynolds number for air that passes around the fuselage at given speeds.

The Reynolds number is defined as:



If we assume the top speed is 15 m/s (54 km/h) we get an estimate for our Reynolds number.

ϱ = 1.204 kg/m³ (air density at 20℃)
V = 15 m/s (velocity)
L = 0.5 m (fuselage length)
μ = 1.84E−5 kg/(m·s) (air dynamic viscosity at 20℃)

Re = 490761

which indicates a turbulent flow and a good fit for the high velocity drag equation when flying at high speeds!

I'm definitely getting closer to a decently working physics model for air friction, but there are many improvements yet to implement. For instance the rotors will generate more lift as the velocity increases and wind will exert torque forces on the fuselage forcing the nose in the direction it's moving - and that's just the start! Still, I'm excited to have the basics implemented already and I can definitely see the benefits of adding more advanced physics later.

- Anj

Wednesday, July 22, 2009

Terrain and sky shaders


I eventually found time to fiddle with this project again. But once I get to sit down with it I usually find my self fiddling with stuff that ain't even remotely relevant to my thesis.

But hey, as long as I'm a happy puppy..!

In the screenshot you'll see the graphics are coming along pretty nicely since last update. I'm just getting into shaders and XNA, and have picked up some neat tricks from blogs and articles all over.

I really like how the terrain and the skydome blends neatly together with the atmospheric fog effect! The helicopter is still using its own basic shading until I find a way to easily apply the sunlight to all my game objects. Oh wait, I mean simulator objects..

Nothing new on the autopilot yet. I'm still working on a framework for using sensor feedback to estimate the state of the helicopter, but there's some distance to go yet. Besides it would be boring to do all the work now and have nothing to do when the thesis starts in September.

If my spare time continues to be awesome this summer I'll expect to get a few more updates out here soon enough. 

Tuesday, June 2, 2009

10 helicopters in circle formation

After organizing the code a little I am now able to render multiple helicopters and use the same control logic on each. Since they already know how to navigate towards a goal, I thought it would be cool to see how they work in a formation. I do this simply by setting their goal to a relative offset from the target helicopter (the one I am navigating with my joystick).


As you can see in the vid they will try their best to hold the circle formation, but if I move too quickly they fall behind because the PID values are not aggressive enough as they are coded for smooth movements.

No sensors yet though, that's up next!

Saturday, May 16, 2009

Project blog created


Alright, first words of my blog for the Autonomous Aerial Drone Simulator project.

The project is part of my Masters thesis in computer technology, which starts this fall and ends next spring. The simulator will feature a simplified physics environment for aerial vehicles, in particular a model for small radiocontroller helicopters will be implemented. Using the simulator it is possible to see how control logic performs in an approximation to reality, and adjust accordingly. It is so much cheaper to crash in virtual life. :-)

Eager to start I have already implemented some initial code for simple physics and helicopter behavior. It works pretty well even without considering air physics, and the helicopter can be controlled using a regular R/C helicopter joystick with a PC cable that ships with most helicopter models. This actually turned out to be a decent R/C simulator to practice flying those things in.

I have also implemented some initial control logic for navigating to a waypoint. Using PID loops (the I is not very much used yet) adjusted to the environment, and using perfect knowledge of position, velocity, forces and orientation of the helicopter the autopilot is by now able to:

- Hover
- Navigate to a waypoint with nose pointing in arbitrary direction
- Come to a halt at a waypoint
- Navigate with intermediate waypoints by passing through them

Although it can't land yet, it has infinitely amounts of fuel so it shouldn't be a problem in the near future.

In the  screenshot above you can see the visual presentation so far. Although the graphics is not a focus in the project, I gotta admit it is hard to give a crap too. I will probably add quite more details as the project progresses and I tire of coding control logic and AI.