I've included the latest fixes to the Traffic Manager/AI flightplan generation
code. Most of the code changes are in AIFllightplan.cxx. This is the code
that runs without depending on predefined FlightPlans in
#FG_ROOT/Data/AI/Flightplans.i
As suggested by Dave, I've also added a new property in
preferences.xml: /sim/traffic-manager/enabled, which is used to control
whether or not the traffic manager is active.
I'm still working on a few more 737 traffic patterns, those are going to take
a little longer, so I didn't want to wait sending in this code.
Finally, I haven't put much effort into ensuring "aeronautical correctness" in
this version yet. The code works on my system, but what the AI plane do may
actaully be quite rediculous. But I'd like to leave that for the next
version.
Stub in hooks for Propeller feathering controls and the turbo prop "condition"
lever.
I added a line in FGFDM.cpp to force control properties to exist if they
don't already. This way you can specify anything you want and find them
in the property browser, otherwise no one else may create them and you are
stuck.
In PropEngine::solve() the code original sets _running = true at the
beginning and then sets running = false at the end. I changed this to
save the current value at the start, set to true, solve(), and then
restore the original value at the end. That way if we start off with
_running = true, we don't have to hack up the calc() routine which wasn't
using the value anyway.
Finally I added some very initial support to shut down a turbine engine
(_running = false) when the condition lever goes to zero.
Ed Sirett submitted a patch to consider antenna orientation when searching
for localizers. I further hacked this to support GS and DME transmitters
(although Robin's DME transmitter data doesn't convey orientation
unfortunately.)
david [Thu, 24 Jun 2004 02:08:38 +0000 (02:08 +0000)]
On a reinit() subsystem event, reconfigure the joystick and other
inputs. This makes it possible to hot-plug a new joystick while
FlightGear is running (as long as the user explicitly reinits the
input subsystem).
curt [Mon, 14 Jun 2004 21:36:10 +0000 (21:36 +0000)]
Alternator should still put out some output when RPM < 800. (Yes I know this
is hard coded for the C172, but so far no one has asked to do this more
generically.)
curt [Mon, 14 Jun 2004 18:46:58 +0000 (18:46 +0000)]
- Track a saved mouse pointer location from the previous frame so we can detect
motion.
- Track a timeout value so we can optionally hide the mouse pointer after
some user specified timeout period.
- in doMouseMotion() always update m.x and m.y even if we return early because
pui wanted the event. Without this, we can't reliably detect motion vs.
inactivity.
- in _update_mouse() add a dt parameter so we can decriment the timeout value
in "real" time.
- in _update_mouse() optionally hide the mouse pointer if m.timeout goes to
zero. Restore the pointer (and the timeout counter) if the mouse is moved.
ehofman [Fri, 11 Jun 2004 13:49:07 +0000 (13:49 +0000)]
Move the radar update code to the AIBase class. There seems to be a problem where all targets disappear whenever one of them disappears, but that was present in the previous update also.
curt [Wed, 9 Jun 2004 20:21:18 +0000 (20:21 +0000)]
DME units report a distance based on the assumption that the ground station
will delay it's reply by 50ms. The ground station can change it's reply delay
to trick the airborn dme unit into reporting a distance that is offset from
the true distance by some constant value. In FG we model this by subtracting
a fixed distance from the actual distance.
It is thus possible in our implimentation for the displayed distance to become
negative. This patch clamp DME distance to a minimum value of 0.00 so it can
never go negative.
curt [Wed, 9 Jun 2004 03:13:13 +0000 (03:13 +0000)]
Often, the elevation of an ILS component is not listed in our nav database.
A good elevation is critical for proper glide slope modeling. This patch
assigns the average field elevation to any ILS component that doesn't have
a valid elevation.
Also, for an ILS approach, use the GS transmitter elevation for glide slope
calculations rather than the localizer elevation, in some cases this can
make a big difference.
ehofman [Tue, 8 Jun 2004 15:32:09 +0000 (15:32 +0000)]
Melchior FRANZ:
Wouldn't it be better to prepare the whole list of paths (or two
separate ones for Terrain/Objects if necessary) in FGGlobals::set_fg_scenery,
and to pass the vector<string>s to FGTileEntry::load? It doesn't seem to make
a lot of sense to split the path up, modify it, mount it together to one string
again, and then let FGTileEntry::load split it up again.
Here we go:
Main/globals.cxx
================
As fg_scenery is now a string_list, we don't need initialization. Furthermore,
this list is cleared with every set_fg_scenery() call.
ctor: create default dir from fg_root if necessary. Otherwise check all paths
of --fg-scenery/FG_SCENERY: If the path doesn't exist, ignore it. If it contains
a dir Terrain and/or Objects, then only add that to the list. If it contains
neither, then use the path as is.
Scenery/tileentry.cxx
=====================
Trivial: don't split a "base path", but use the given path_list as is.
(I considered a variable name "path_list" better suited than "search".)
Scenery/FGTileLoader.cxx
========================
No more fiddling with sub-paths. This has to be delivered by get_fg_scenery
already.
ehofman [Mon, 7 Jun 2004 09:52:11 +0000 (09:52 +0000)]
Make use of the new SGPath::add() function and automatically append 'Terren' and 'Objects' the the scenery path when one or both of those subdirectories exsist.
ehofman [Sun, 6 Jun 2004 08:50:17 +0000 (08:50 +0000)]
David Culp:
Here's some additions to AI that allow refueling from an AI tanker (the actual
onload of fuel must be handled by the user's FDM of course, this just lets
the FDM know that the user is in position to refuel).
I've added a new class of AIAircraft called "tanker". It uses the same
performance struct as a jet transport. An AI tanker is just like an AI jet
transport, except it uses the already-existing radar data to control the
boolean property systems/refuel/contact. The code change was minimal.
This puts a tanker over KSFO at 3000 feet, in a left-hand orbit. When the
user gets within refueling range (contact position) then the property
systems/refuel/contact will be true. Otherwise it is false.
The dimensions of the refueling envelope are pretty rough right now, but still
usable. The user must be behind the tanker (ie. radar y_offset > 0). The
user must be at or below the tanker's altitude (ie. radar elevation > 0).
The user's lat/lon must be within 250 feet of the tanker's lat/lon (ie. radar
range_ft < 250). This last requirement is loose because the radar data is
only updated every 100 ms, which is accurate enough for radar use, but
which is sloppy for air refueling. This could be tightened up by increasing
the radar update rate to once every sim cycle.
I'm going to add a light to the T-38 instrument panel that will monitor the
property systems/refuel/contact. This will make it easier to explore the
boundaries of the refueling envelope.
ehofman [Sat, 29 May 2004 11:39:10 +0000 (11:39 +0000)]
David Culp:
Here's some new AI stuff.
1) AI objects must now be defined in a scenario file, not in preferences.xml
or a *-set file. (Of course this doesn't prevent objects from being created
dynamically, as with Durk's traffic manager).
2) A new demo_scenario file is attached. It creates 3 aircraft, a sailboat,
and a thunderstorm.
3) Objects without flightplans live forever.
4) FGAIShip::ProcessFlightplan() is not yet implemented.
5) preferences.xml should now define only <enabled> and <scenario>
curt [Fri, 28 May 2004 16:24:43 +0000 (16:24 +0000)]
Curt Olson:
These change add some code that at initialization time will snap all
localizers into perfect alignment with their runways. It's my experience
that the DAFIF/FAA data reports runway and localizer headings to a level
of precision that is great for making charts, or adjusting your OBS, etc.
But the level of precision of this data can be far enough off to make you
visibly *un*aligned with the runway when the CDI needle is centered.
There are probably cases where the localizer isn't really perfectly
aligned with the runway, or intentionally misaligned to avoid obstacles
or terrain. So I have made this configurable for those that trust the
data more than I do. Just set "/sim/navdb/auto-align-localizers" to
true/false in the preferences file to turn this feature on or off in the
code.
curt [Fri, 28 May 2004 05:24:54 +0000 (05:24 +0000)]
This set of changes impliments the following:
- FG now directly supports Robin's native nav database file format.
- His latest data now separates out dme, gs, loc, and marker beacon
transmitters rather than lumping them all into a single "ILS" record.
- These new data structure changes prompted me to do some code restructuring
so that internally these different types of navaids are all kept as
separate lists and searched and handled separately.
- This structural change had a cascading affect on any code that
references or uses the nav databases. I've gone and "touched" a lot of
nav related code in a lot of places.
- As an added bonus, the new data (and code) adds DME bias so these will
all now read as they do in real life.
- Added Navaids/navdb.cxx and Navaids/navdb.hxx which provide a front
end loaders for the nav data.
- Added Navaids/navrecord.hxx which is a new "generic" nav data record.
- Removed Navaids/ils.hxx, Navaids/ilslist.cxx, Navaids/ilslist.hxx,
Navaids/mkrbeacons.cxx, and Navaids/mkrbeacons.hxx which are all now
depricated.
ehofman [Fri, 21 May 2004 16:50:19 +0000 (16:50 +0000)]
David Culp:
1. Removed aircraft roll on ground.
2. Decreased descent pitch angle.
3. Updated flightplans to include <on-ground>
4. Fixed property indexing, so all AI aircraft have their own property branch
The default value of <on-ground> is false, so you only need to specify it when
on the ground. For takeoff you need to specify <on-ground>true</on-ground>
for the first waypoint, and for the acceleration waypoint. For landing you
need to specify it for the touchdown point and any taxi points.
One problem. WARNING **** There is a bug in the way the property system
works, which causes a segfault, but I don't know if the problem is in the
property code, or in how I'm using it. After an AI object terminates, if you
access the property tree through the property browser the sim will segfault.
andy [Tue, 18 May 2004 01:46:36 +0000 (01:46 +0000)]
Fix a bug with propeller gearing. The torque computations weren't
properly correcting for the gear ratio. This is the source of the
problems Vivian and Jim were having with the Spitfire and Mustang.
ehofman [Mon, 17 May 2004 08:45:33 +0000 (08:45 +0000)]
David Culp:
First, preferences.xml will define the scenario filename.
For now, the other way of defining ai objects still works, so the sailboat
stays in preferences.xml. Later, I'll move the sailboat into the demo
scenario. If no scenario filename is given, then no scenario will be
processed.
I changed the demo scenario to create two 737's, one takes off on runway 01L,
and the other takes off on runway 01R. This will make a good demo for the ai
system. One problem, if you takeoff on 28L/R right away, you might run into
the taking-off 737's, or be scared.
ehofman [Sat, 15 May 2004 09:07:55 +0000 (09:07 +0000)]
David Culp:
Here's the newest AI stuff.
The AIManager at init() creates a new scenario. Right now the
default_scenario is hard coded in, but eventually the AIManager should get
the scenario filename from preferences.xml.
The scenario defines which AI objects will be created. Right now it only
creates AIAircraft, but this is easily extended. The scenario also defines
which flightplan will be assigned to the airplane. Scenario config files go
in data/Data/AI.
The Airplane gets a pointer to a FlightPlan object. Each airplane should get
its own flightplan object, even if two airplanes have the same flight plan.
This is because the flightplan maintains the iterator pointing to the
current waypoint, and two airplanes might be at different locations (for
instance if they were created at different times). The flight plan files go
in data/Data/AI/FlightPlans.
When the airplane gets to the waypoint named "END" it vanishes. The
AIAircraft destructor deletes its flight plan (if it has one).
The last waypoint is a place holder only. I called mine
<WPT><NAME>"EOF"</NAME></WPT>.
andy [Fri, 14 May 2004 17:16:35 +0000 (17:16 +0000)]
Fix the slider to request a non-zero length, and make its width a
little larger.
The text widget can now be meaningfully associated with a property; in
PUI, it's "value" isn't the same thing as its label, but we can hack
things to treat them symmetrically.
Commit an experimental "live" property that can be set on widgets to
cause them to update their values every frame. This works great for
text widgets, as above. Note that this synchronization is input-only:
no support is provided (or needed -- the GUI only changes when the
user does something) for writing those properties out every frame.
curt [Fri, 14 May 2004 15:49:10 +0000 (15:49 +0000)]
Code at this level shouldn't care if the sound manager is paused or not.
Just forge ahead as if sound is playing, let the sound manger worry about
the details.
andy [Wed, 12 May 2004 15:36:07 +0000 (15:36 +0000)]
GUI layout management and a few visual/eye-candy modifications. See
DOCS/README.layout in the base package for details, along with the
modified dialog files.
andy [Thu, 6 May 2004 16:28:08 +0000 (16:28 +0000)]
Fix from Melchior: It replaces the ridiculous 5 seconds by
the 30 seconds that Maik had originally intended, according to the comment.
This is important for the pending sound and rotor disc changes (and of course
for realism).