Howto:Implement Towbar

From FlightGear wiki
Jump to navigation Jump to search
Towbar attached

Small GA planes usually are towed around by hand using a Towbar which can be connected to the front wheel. This could be implemented easily by adapting the basic principles laid out in Howto:Implement_pushback, but is even simpler.

The general idea is to have a towbar attaching to the nose wheel and that can be clicked on to drag the plane around by moving the mouse.

Handling

When the towbar is attached, you can click on it and by moving the mouse you can pull/push the plane around on the ground:

  • Most fun with the walker! Stay in front of the pane, oriented towards it.
  • Click the bar and hold the button.
  • Moving the mouse left/right adjusts direction.
  • Moving the mouse upwards (away from you) pushes the bar, downwards pulls.
  • Releasing the button will release the forces.

Especially when pulling/pushing, give the plane time to react. It is heavy and this is simulated.

If it wont move, check that securing like chocks and tiedowns are removed and make sure the parking brake is not set. Also, when on rough surface, you might not be strong enough to move the plane by hand.

JSBSim implementation

Samples are given here for the C182s:

The trick with this approach is that the pick animation bound to the towbar 3D-model is calculating the force applied to the external_force connection point. This yields an intuitive handling, and jsbsim is good at calculating the forces, so rolling (and respecting chocks/tiedowns!) comes "for free" from the aircraft development perspective.

Enhancement ideas

  • Ground handling over multiplayer
    • Because the forces are standardized by jsbsim, plane handling over multiplayer could be added easily by the same principles as aerotowing over MP, but adapted and needs some nasal magic.
    • The remote plane must locally calculate forces and directions for each target plane that is currently tried to be handled and publish that over multiplayer.
    • The local plane must listen to the remote mp-properties and apply forces to the local plane.
    • To avoid any other (malicious) client pushing your plane around without your consent, new active push requests could maybe make a popup show and ask for consent. Only actively approved clients may operate your plane. There should be a means to revoke that consent (maybe just make this operational for current going-on actions, and auto-revoke if no remote input was registered for, say, 5 seconds or so).

Related content