1
0
Fork 0
Commit graph

15354 commits

Author SHA1 Message Date
Julian Smith
7753ce229d Fixed uneven replay of user vs multiplayer aircraft.
FGReplay was using time t, AIMultiplayer was using t+dt. The fix is to make
FGReplay also use t+dt.

scripts/python/recordreplay.py
    Make --test-motion-mp test for this problem - we check that user and mp
    aircraft are a constant distance apart when replaying.

src/AIModel/AIMultiplayer.cxx
    Create properties showing distance moved since start by user and mp
    aircraft, which can then be tested by recordreplay.py.

src/Aircraft/replay.cxx
    Increment current_time by dt before calling replay(current_time), to
    ensure that replay() sees the time as is later used by AIMultiplayer (via
    /sim/replay/time).
2021-04-18 12:12:50 +01:00
Julian Smith
99bcc3ba24 scripts/python/FlightGear.py: ls() now returns typed values. 2021-04-18 12:12:50 +01:00
Julian Smith
3e57ba3332 src/Aircraft/replay.cxx: fixed potential segv when moving packest between medium/long term store. 2021-04-18 12:12:50 +01:00
Julian Smith
967cff2b6f src/Model/acmodel.cxx: Fixed broken aircraft sound after change to ordering of subsystems.
Moved creation of FGFX() from FGAircraftModel constructor into
FGAircraftModel::init().

Thanks to Colin Geniet for bug report and suggested fix.
2021-04-17 19:24:05 +01:00
Richard Harrison
d92da2cb17 Restore shared pointer in checkCarrierSceneryLoaded
I'd removed this as part of testing and this restores it back to how it should be.
2021-04-17 09:32:30 +02:00
James Turner
4096f354df Fix compile error when sentry is enabled 2021-04-16 23:14:14 +01:00
Richard Harrison
522d7e8450 Finish 2021-carriers-and-ai-part-1-towers
Carrier improvements

- Calculate lineup deviation (degrees left/right)
- Position for touchdown added (for more accurate lineup and glideslope deviation checks)
- LSO position and Tower position added (for views)
- Better logic for controlling the FLOLS
- Added ability to start on a specific course (works better
  with the launcher if the carrier starts on a recovery course
  when positioning in air for recovery (approach)
- Support for normal, tower, LSO views (via controls/view-index)
- Aircraft can define offset for FLOLS in sim/model/reference-offset-{xyz}

Added the ability to find the nearest carrier to use as a tower

Rework of the tower position so that it updates frequently to support moving towers.

TODO: Need to review how to better implement/integrate 'sub-views' i.e. ai/models/carrier[]/controls/view-index which is actually a sub index for the tower view.
2021-04-16 22:02:11 +02:00
Erik Hofman
303e518e87 Aparently MSVC doesn't like it this way. 2021-04-16 14:44:03 +02:00
Erik Hofman
deab07d527 Do not include dds_props.hxx if CycloneDDS was not found 2021-04-16 13:22:06 +02:00
Erik Hofman
5118009d44 Add a new network protocol: dds-props which for now only operates in the output mode: request a propery value using de FG_DDS_prop scheme and provide either it's path or property index id. UsageL fgfs --dds-props=dds,out,<hz>. Testing is possible with src/Network/DDS/fg_dds_prop to request a propery path/id or src/Network/DDS/fg_dds_log to log all propery samples passed over the DDS layer. 2021-04-16 11:26:21 +02:00
Julian Smith
1aeef58ded src/Time/TimeManager.cxx: include <algorithm> for std::max.
Hopefully will fix windows build failure.
2021-04-15 22:24:15 +01:00
Julian Smith
edc6d88993 src/AIModel/AIMultiplayer.*: Improve behaviour if simple-time enabled.
Moved interpolation code into new method
FGAIMultiplayer::FGAIMultiplayerInterpolate().

FGAIMultiplayer::update():
    If simple-time is enabled, always use getMPProtocolClockSec() (or
    /sim/replay/time if replaying) as current time, so that multiple instances
    of Flightgear all using simple-time will all show user and MP aircraft
    in the same relative positions.

    When interpolating, don't special-case single iterator, instead pass the
    single iterator as both args to FGAIMultiplayerInterpolate().

    Fixed removal of outdated frames using mMotionInfo.erase() - previously
    this was not done if we had done extrapolation, and with interpolation we
    left one too many frames in place.

FGAIMultiplayer::addMotionInfo():
    If simple-time is enabled, apply compensation to MP aircraft's .time fields
    if incoming packets' .time field differs significantly from our local UTC
    time.

    This allows simple-time to work with non-simple-time MP aircraft, or with
    simple-time MP aircraft whose UTC clocks differ from local UTC clock. But
    without the guarantee of consistent rendering across Flightgear instances.

    We don't calculate lag when compensating in this way.

With these changes, scripts/python/recordreplay.py --test-motion-mp passes (the
test sets /sim/replay/simple-time").
2021-04-15 17:23:58 +01:00
Julian Smith
10be9a1b60 src/AIModel/AIMultiplayer.cxx: FGAIMultiplayer::update(): re-indented.
Old indentation was messed up, making it very difficult to work on the code.
2021-04-15 17:23:58 +01:00
Julian Smith
34955d820b scripts/python/recordreplay.py: use simple-time system.
test_motion() now sets /sim/time/simple-time/enabled=true.

Also show any description items - these are generate by related changes to
src/AIModel/AIMultiplayer.cxx.
2021-04-15 17:23:58 +01:00
Julian Smith
70647ffd35 src/Aircraft/replay.*: use getMPProtocolClockSec if /sim/time/simple-time/enabled is set.
Also, when moving MP packets around, medium_term buffer can become empty. Have
added checks for empty short, medium and long term buffers when moving packets.
2021-04-15 17:23:58 +01:00
Julian Smith
745273ab26 src/Aircraft/flightrecorder.cxx: Improved logging of raw speed values. 2021-04-15 17:23:58 +01:00
Julian Smith
cb00971dcb src/Time/TimeManager.*: added simple-time mode.
Simple-time mode is enabled by /sim/time/simple-time/enabled.

Simple-time is implemented by new TimeManager::computeTimeDeltasSimple()
method. This uses a plain UTC clock (e.g. with CLOCK_REALTIME /
gettimeofday()) for basic timing, and sets _mpProtocolClock (as returned by
getMPProtocolClockSec()) to the calculated FDM time.

We use our own fns to get UTC time and for sleeping, because
TimeManager doesn't work for us, e.g. SGTimeStamp::SGTimeStamp() uses
_POSIX_MONOTONIC_CLOCK if available so doesn't return UTC.

So getMPProtocolClockSec() now serves as a consistent time for both the
user aircraft and MP aircraft, avoiding problems where different Flightgear
instances could show aircraft in different relative positions.

For example it can be put into outgoing MP packets (which are about
the time/position of the user aircraft), and used as the target
time when calculating the position of multiplayer aircraft using
interpolation/extrapolation of incoming MP packets.

And getMPProtocolClockSec() can also be written into recordings, ensuring
that multiplayer replay will also show all aircraft with the correct relative
positions, regardless of varying frame rates at record or replay time. This is
tested by 'scripts/python/recordreplay.py --test-motion-mp'.
2021-04-15 17:23:58 +01:00
Julian Smith
ebe4f43abc src/Main/fg_init.cxx: put FGReplay after FGMultiplayMgr and before FGAIManager.
This will improve record and replay of MP packets - we will always see the most
recently-avialbale packets.
2021-04-15 17:23:58 +01:00
Julian Smith
ae9d8ce088 src/Main/fg_init.cxx: fgCreateSubsystems(): group registrations by GroupType.
This is just for code clarity.

It changes the order of construction/registration of subsystems to match the
order in which subsystem groups are called when Flightgear is running.
2021-04-15 17:23:58 +01:00
Julian Smith
d7d87479a9 In subsystem initialisation, don't default to SGSubsystemMgr::GENERAL.
Updated subsystem registrations to specify SGSubsystemMgr::GENERAL explicitly,
which makes things a little clearer.
2021-04-15 17:23:58 +01:00
Julian Smith
1789002417 src/Main/fg_init.cxx: fgCreateSubsystems(): removed unnecessary comments.
The comments in this function were redundant and took up a lot of vertical
space which affected readability.
2021-04-15 17:23:58 +01:00
Julian Smith
1d4e2a2a69 src/MultiPlayer/multiplaymgr.cxx: decreased a diagnostic. 2021-04-15 17:23:58 +01:00
Julian Smith
6aa0e4a5cb scripts/python/FlightGear.py: fixed handling of large outputs.
Telnet.expect() can return short result, so _getresp() needs to call it in a
loop.
2021-04-15 17:23:58 +01:00
Erik Hofman
f196c8418d Update the props sample description: remove an unnecessary type specifier (the union already holds it), add a sample version number and a mode to indicate reading from, or writing to, a property. The option to set a property value is reserved for future use and not yet implemented. 2021-04-15 10:11:42 +02:00
Julian Smith
04e664bb33 src/Viewer/FGEventHandler.*: fixed mouse events in non-main window without CompositeViewer.
Need to only test for sview window if /sim/rendering/composite-viewer-enabled
is true.
2021-04-11 16:40:27 +01:00
Julian Smith
f08076c391 scripts/python/recordreplay.py: fixed when fgfs not run via wrapper script. 2021-04-11 10:06:13 +01:00
Julian Smith
29dc9ea93a scripts/python/recordreplay.py: fixed use when fgfs is run via wrapper script.
Various tweaks to motion tests.
2021-04-10 10:39:18 +01:00
Erik Hofman
4f28e2dfff Add a proprety requester test utility 2021-04-09 14:44:33 +02:00
Erik Hofman
c88c47e1b5 No need to keep two maps: it's enough the have one PropertyList (vector) and a map 2021-04-09 14:43:20 +02:00
Erik Hofman
162f5f317d Switch to always add the GUID. Setting a string to null doesn't work for DDS samples and leads to a segmentation fault. 2021-04-09 14:42:38 +02:00
Richard Harrison
3274925cf3 Win32: reworked console opening
This is mainly for standalone FGCOM - because the error message is always shown because it is a console app and --console isn't required.
2021-04-08 21:58:52 +02:00
Richard Harrison
58d8b7faa0 minor improvement in comments in Multiplay mgr 2021-04-08 21:58:52 +02:00
James Turner
766b1f6c54 Tweak how error reports are passed to Sentry 2021-04-08 11:34:40 +01:00
James Turner
28f562d0ec Sentry: correct breadcrumbs for menu item activates. 2021-04-08 07:16:13 +01:00
Erik Hofman
c951f3fcf4 Also log propery samples over DDS 2021-04-07 11:53:22 +02:00
Erik Hofman
202c69ad77 Implement the start of a property server using DDS. 2021-04-06 14:52:37 +02:00
Erik Hofman
e203336546 Udpate the logged name 2021-04-06 14:51:50 +02:00
James Turner
0a1f6d406c Launcher: missed import/style fixes 2021-04-06 09:13:50 +01:00
James Turner
1f24f1b2bb Traffic: work around crash with bad trafficRef
Don’t crash when the arrival airport is null.

Sentry-Id: FLIGHTGEAR-893
2021-04-06 09:13:32 +01:00
James Turner
4b9f903f8f Launcher: fix include of FlightGear module files 2021-04-04 16:53:45 +01:00
James Turner
977dd6fd15 Add sentry breadcrumb for FGCom
Trying to understand FLIGHTGEAR-66 crashes where the IAXClient thread
is still running after FGCom::shutdown has (presumably?) been called
2021-04-04 16:35:40 +01:00
James Turner
019d6cc53a Launcher: tweak how Qt Fatal log messages are handled 2021-04-04 16:34:46 +01:00
James Turner
dd475e1934 Implement saving of graphics presets to XML 2021-04-04 16:10:38 +01:00
Julian Smith
9d8a10f8b7 scripts/python/recordreplay.py: cope if --tape-dir is already configured.
We now always specify our own --tape-dir.

Documented --test-motion-mp option.

Also patched up cleanup of recordings.
2021-04-04 11:59:28 +01:00
James Turner
ff65689eb6 Launcher: fix some missing hard-coded styles 2021-04-02 14:57:01 +01:00
James Turner
361bea19aa Graphics presets: tolerate watching tie()-ed props
Check if the actual value is changing, since tied properties see
an automatic setStringValue when initialized.
2021-04-02 12:07:01 +01:00
James Turner
664652ae39 Error-reporting: capture some properties to report
In the full error report, capture various property values to
aid debugging / investigation.
2021-04-02 10:48:39 +01:00
James Turner
5dae2d129e Launcher: fix compatability with older Qt
QQmlEngine::singletonInstance is >= 5.12. Work-around using a little
component+instance to achieve the same result.
2021-04-02 10:13:56 +01:00
Fernando García Liñán
2913b72f43 Remove unused properties and cmd options 2021-04-02 04:31:36 +02:00
Fernando García Liñán
a5443b77e0 Graphics presets: Add order-num parameter to allow more intuitive ordering 2021-04-02 03:11:42 +02:00