swift-project / pilotclient

Cross-platform cross-simulator pilot client for virtual air traffic networks
https://swift-project.org
GNU General Public License v3.0
89 stars 26 forks source link

Implement VATSIM Velocity compatible "interpolator" #241

Open ltoenning opened 6 months ago

ltoenning commented 6 months ago

VATSIM Velocity introduced new network packets (i.a. VisualPilotDataUpdate and VisualPilotDataPeriodic) that also contain the aircraft velocity in cartesian direction, as well as the pitch, roll and yaw velocities and a nose gear angle. Further, these new packets are published much more frequent (5 Hz) by aircraft in the vicinity.

Currently swift supports two interpolation modes:

Both of them are not using the new velocity information yet:

https://github.com/swift-project/pilotclient/blob/46e6eaba7f761a4e1fc3d29c9d5813f0829bb0d0/src/blackcore/fsd/fsdclient.cpp#L1293-L1296

But also without velocity information, there seem to be issues with the interpolators after the Velocity upgrade (aircraft warping mostly into the moving direction, especially when starting to move).

This may be caused by:

My proposal would be to add a new "interpolator" which uses the velocity information. This can be done by extrapolating the aircraft position and rotation, using the velocity information. The extrapolation error could be smoothly reduced with the next incoming update by adding the position/rotation error vector to the new velocities for some time.

I began implementing this some time ago (see feature/extrapolator) but encountered several difficulties and tasks that must be addressed:

ltoenning commented 2 months ago

As the main issue with "zooming" aircraft was solved with 0.14.142 (see https://github.com/swift-project/pilotclient/pull/256#issuecomment-1942721827) , this issue isn't as urgent anymore.