Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement VATSIM Velocity compatible "interpolator" #241

Open
6 tasks
ltoenning opened this issue Dec 14, 2023 · 1 comment
Open
6 tasks

Implement VATSIM Velocity compatible "interpolator" #241

ltoenning opened this issue Dec 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request simplify Reduce application complexity velocity Vatsim Velocity 5Hz position updates feature
Milestone

Comments

@ltoenning
Copy link
Contributor

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:

  • Spline
  • Linear

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

// not used
// situation.setVelocity(CAircraftVelocity(
// dataUpdate.m_xVelocity, dataUpdate.m_yVelocity, dataUpdate.m_zVelocity, CSpeedUnit::m_s(),
// dataUpdate.m_pitchRadPerSec, dataUpdate.m_bankRadPerSec, dataUpdate.m_headingRadPerSec, CAngleUnit::rad(), CTimeUnit::s()));

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:

  • the faster update rate
  • that the new VisualPilotDataUpdate and VisualPilotDataPeriodic but also PilotDataUpdate packets are used in the interpolator (which could somehow overlap)
  • something entirely different that makes the current interpolation methods unstable

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:

  • Testing seems to be somewhat complicated. Some easy (standardized?) testing environment should be used.
  • The base class for interpolators (CInterpolator) is quite large and may contain some functionality that is not required for the proposed extrapolation method. Perhaps this could be simplified and cleaned up.
  • The old interpolation methods must continue to work for non-VATSIM networks without Velocity.
  • The new method must also work for aircraft not in the fastpos range, as these aircraft may still be displayed on TCAS.
  • IIRC there were some inconsistencies between different pilotclients about which packets are (initially?) sent when the aircraft is not moving. This caused some issues in my first implementation.
  • Perhaps we should find a new name for "Interpolator" as the new method isn't doing interpolation only.
@ltoenning ltoenning added bug Something isn't working enhancement New feature or request simplify Reduce application complexity velocity Vatsim Velocity 5Hz position updates feature labels Dec 14, 2023
@ltoenning ltoenning added this to the Next Release (0.14.X) milestone Dec 14, 2023
@ltoenning ltoenning self-assigned this Dec 14, 2023
@ltoenning ltoenning changed the title Implement VATSIM Velocity compatible interpolator Implement VATSIM Velocity compatible "interpolator" Dec 14, 2023
@ltoenning
Copy link
Contributor Author

As the main issue with "zooming" aircraft was solved with 0.14.142 (see #256 (comment)) , this issue isn't as urgent anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request simplify Reduce application complexity velocity Vatsim Velocity 5Hz position updates feature
Projects
None yet
Development

No branches or pull requests

1 participant