1
votes

I would like to write a program for plotting an animated 3D ribbon image in python. The ribbon follows the flight path as provided by a log containing the following information:

Timestamp, pitch, roll, altitude, latitude, longitude, heading, turn rate.

The final figure should look something like this (without the aircraft figure).Aircraft manoeuvres

Please let me know how this can be done.

Thank you

1
Heading is the angle between the flight and north direction. It is a scalar quantity. Turn rate is rate of change of heading. Assuming that the initial longitudinal flight direction as positive X axis, we can say viewer is perpendicular to the flight path. Pitch and roll are rotations resulting in up/down and rolling over motions respectively - spacestar
Time: 801.475 alt (ft): 12599.88668 lat(deg): 63.94230675 lon(deg): -22.72656178 pitch(deg): 39.60080719 roll(deg): 40.49394608 heading(deg): 344.7094606 turnspeed: 8.104816363 - spacestar
You have to put that data on the question, not on the comments. Also, have to indicate the sign of the angles, for example, from the viewpoint of the pilot, or a person looking to the north. - Colim

1 Answers

0
votes

This is not a complete answer.

First, you need to convert your data to x,y,z coordinates. let's say that you use feet, then you have to convert latitude and longitude to x,y. It will not work if the plane moved a long distance, because the earth is not flat.

Your pitch, roll and heading data serves to calculate the (x,y,z) coordinates of the tips of the wings (or the border of the ribbon) relative to the (x,y,z) of the center of the plane. You need quaternions or geometric algebra to do that. You can also do it with basic trigonometry, but you risk gimbal lock bugs.

Then you need to interpolate your data, for the timestep you choose.

With your interpolated data, you get 2 arrays of (x,y,z) for each ribbon border, which you can plot as lines in 3D. To do the plot you need to choose a position of the viewer, and a direction to which he is looking at.

If you want to do an animation, you use the same data, but google how to do animations after you managed to do the interpolations.