On Thursday 22 January 2004 22:54, Curtis L. Olson wrote: > Lee Elliott wrote: > > I've been giving quite a bit of thought to look-ahead algorithms for > > terrain following. The most straight forward way would be to take a > > number of look-ahead samples each frame, and simply take the highest > > point as the target alt. > > > > Taking a lot of samples each frame can't be a good idea though so I've > > been thinking more about single look-ahead sample alogorithms. These > > don't seem to be too tricky but they're pretty much limited to > > straight-line flight. It's possible that using several single-sample > > tracks might work for turns though. > > Let's say you were flying 240 meters/sec and generally in a straight line. > Let's also assume we are drawing 60 frames/sec. > > That means we travel about 4 meters every frame. > > Let's say we want to look ahead 10 seconds. That is 10 * 240m/s = 2400 > meters we would have to look ahead. Figuring a flat ground and the > aircraft's pitch angle, figure the appropriate angle to point your radar or > laser scaner. > > Now if you do one terrain intersection lookup each frame and do it 2400 > meters ahead of you. But, also keep the last 10 sec * 60 fps lookups in a > buffer, then assuming you are flying in a straight line, once your buffer > fills up, that gives you a set of elevation points in your path at 4 meter > increments looking 2400m ahead. > > If you turn, this blows the whole scheme so just don't turn. :-) > > Perhaps after sensing a turn, you could wipe the buffer and start filing it > in with one extra terrain intersection lookup per frame, and scan in a > binary partitioning pattern ... > > This would minimize computation cost and *might* work ... > > Curt.
I don't think you'd need to maintain the full 10 sec * 60fps buffer of samples - just holding the sequence of high points should be ok, and you fly from each one to the next. I don't think you really need to know about any lower elevations within the look-ahead distance. You may not even need to maintain the full series of high-points either - it might be possible to do it with just two or three high point values. Making sure you clear high ground is easy enough - just maintain a high value and compare each new sample with it - if the new sample is higher then that becomes the target and the new high value. Store the distance to the high point each frame and then on the next frame re-calc it to see if it's closer or further away - when the distance increases it's behind you. It's coming back down after a high point that's a bit trickier if you're trying to do it without a full series of high point data. Even so, I'm pretty sure it can be done with just two or three high point values. Dealing with turns is an interesting problem:) I think some degree of turn capability is achievable but trying to come up with something economical that'll stop you from pulling a hard turn into a cliff is probably not feasible - that would need a full 3d awareness system capable of handling tremendous amounts of data. Atm, I've been thinking in terms of a 'supplimental' off-axis scan that starts when a bank/change of direction is detected, and this would need a different scanning scheme to the simple line-ahead method used for straight & level fight. Heh! - I've always wanted a good excuse to try a 'Drunkards Walk' scanning algorithm :) LeeE _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
