I'm an intern for the Air Force Research Labs and am new to FlightGear. I'm working on using FG as a visualization tool and have been writing a python script that can create and send Multiplayer Protocol UDP packets to a FG instance.
I've formatted a custom packet based off of outgoing MP packets from a running FG instance and this wiki page (http://wiki.flightgear.org/Multiplayer_protocol). However, I still cannot get the plane to render where I want in a running FG instance. I'm reaching out with this post to try and find information on the time offset (titled 'lag' in the table for the first part of a positional message described by the wiki) bytes used the the packet.
So far I've tried a lag value of 0x0000000000000000 and 0x43cfdccccccccccd. The former as a dummy var and the latter was copied from the example packet I had. I got these DEBUG messages from my terminal running FG, respectively:
for 0x0000000000000000:
- Code: Select all
24.10 [DBUG]:ai Offset adjust system: time offset = 0.000734691, expected longitudinal position error due to current adjustment of the offset: 3.54107e-05
24.10 [DBUG]:ai Multiplayer vehicle extrapolation: extrapolation time = 0.00330108
24.10 [DBUG]:ai Multiplayer position and orientation: [ -2.07581, 0.624261, 969.361 ], [ 0.509965, -0.0750155, -0.847793, -0.124724 ]
24.10 [DBUG]:atc Currently at leg : 3
24.10 [DBUG]:atc name of previous waypoint : gear-up
24.10 [DBUG]:atc Currently under control of BIKF-tower
24.10 [DBUG]:network Found Fallback model index in message 516
24.10 [DBUG]:ai Offset adjust system: time offset = 0.000733975, expected longitudinal position error due to current adjustment of the offset: 9.20057e-06
24.10 [DBUG]:ai Multiplayer vehicle extrapolation: extrapolation time = 0.000857701
24.10 [DBUG]:ai Multiplayer position and orientation: [ -2.06108, 0.624261, 969.333 ], [ 0.50989, -0.0755177, -0.84767, -0.125559 ]
24.11 [DBUG]:atc Currently at leg : 3
24.11 [DBUG]:atc name of previous waypoint : gear-up
24.11 [DBUG]:atc Currently under control of BIKF-tower
24.11 [DBUG]:ai Offset adjust system: time offset = 0.000726316, expected longitudinal position error due to current adjustment of the offset: 9.85101e-05
24.11 [DBUG]:ai Multiplayer vehicle extrapolation: extrapolation time = 0.00918338
24.11 [DBUG]:ai Multiplayer position and orientation: [ -2.11127, 0.624261, 969.428 ], [ 0.510138, -0.0738327, -0.84808, -0.122757 ]
24.11 [DBUG]:atc Currently at leg : 3
24.11 [DBUG]:atc name of previous waypoint : gear-up
24.11 [DBUG]:atc Currently under control of BIKF-tower
24.11 [DBUG]:network Found Fallback model index in message 516
24.12 [DBUG]:terrain SGMaterialCache::~SGMaterialCache() size=308
24.12 [DBUG]:atc Currently at leg : 3
24.12 [DBUG]:atc name of previous waypoint : gear-up
24.12 [DBUG]:atc Currently under control of BIKF-tower
24.12 [DBUG]:network Found Fallback model index in message 516
24.12 [DBUG]:ai Offset adjust system: time offset = 0.000726385, expected longitudinal position error due to current adjustment of the offset: 8.90902e-07
24.12 [DBUG]:ai Multiplayer vehicle interpolation: [57972.6, 57972.6], intervalLen = 0.010808, interpolation parameter = 0.622759
24.12 [DBUG]:ai Multiplayer position and orientation: [ -2.05591, 0.624261, 969.323 ], [ 0.509864, -0.0756955, -0.847626, -0.125854 ]
24.13 [DBUG]:io Success reading data.
24.13 [DBUG]:io Success reading data.
24.13 [DBUG]:io Success reading data.
24.13 [DBUG]:atc Currently at leg : 3
24.13 [DBUG]:atc name of previous waypoint : gear-up
24.13 [DBUG]:atc Currently under control of BIKF-tower
24.13 [DBUG]:ai Offset adjust system: time offset = 0.000722838, expected longitudinal position error due to current adjustment of the offset: 4.56173e-05
24.13 [DBUG]:ai Multiplayer vehicle extrapolation: extrapolation time = 0.00425256
24.13 [DBUG]:ai Multiplayer position and orientation: [ -2.08154, 0.624261, 969.372 ], [ 0.509993, -0.0748217, -0.84784, -0.124402 ]
and 0x43cfdccccccccccd:
- Code: Select all
27.75 [DBUG]:ai Offset adjust system: time offset = -4.59187e+18, expected longitudinal position error due to current adjustment of the offset: 0
Major questions I have at the moment are:
a) how significant is the positional adjustment caused by time offset? Some of the offset values seem very small... could it be the bug preventing the plane form being rendered or should I focus elsewhere?
b) why does time offset seem to vary in the Debug output when I set lag = 0x0000000000000000?
c) what is extrapolation time? what is 'current adjustment of the offset'? And how are they calculated?
Tech Stack:
OS - Linux Mint 5.4.0-64
FG - 2020.3.1
Any help or advice would be greatly appreciated!
Regards,
John