The track module is responsible for defining the track on which a trajectory can be created and optimised.
This includes the Track class, as well as the CoordinateArray, Event and Gate classes used to generate and define the track.
CoordinateArray ClassArray of coordinates and its derived attributes.
Used for track generation to store the coordinates defining the track limits and track mesh.
xyzCoords: Coordinates in order of increasing distance along the coordinate array, where each coordinate is in the form [x, y, z]. 2D array of floats.xyLine: Line formed by the coordinates in the 2D plane [x, y]. Shapely LineString.sCoords: Cumulative distance along the coordinates, assuming straight lines between coordinates. Starts from 0 if this is the "full" coordinate array, but can start at any value if this is a "reduced" coordinate array. 1D array of floats.AHeadings: Unwrapped heading angle along the coordinates, in radians, increasing clockwise with 0 corresponding to positive y (north). 1D array of floats.AHeadingsFilt: Low-pass filtered AHeadings, with cutoff frequency LP_FILT_SPATIAL_FREQ and filter order LP_FILT_ORDER. 1D array of floats.__init__()Initialises the coordinate array and calculates all of its attributes.
Makes sure that the coordinates are closed if the track is closed, removes consecutive duplicate coordinates, calculates the cumulative distance along the coordinates, then calculates the raw and filtered unwrapped heading angle along the coordinates. If all attributes are provided, uses those (without doing any validation).
Note that the initial unfiltered heading angle will be between -pi and pi. This should be checked and corrected if necessary with the method rotateHeadings().
Arguments:
xyzCoords: Array of coordinates in order of increasing distance along the track, where each coordinate is in the form [x, y, z].BClosedTrack: Whether the coordinate array should be treated as closed. A closed coordinate array means that the last coordinate is equal to the first coordinate.sCoords: If all of sCoords, AHeadings and AHeadingsFilt are provided, overrides the automatically calculated attribute sCoords.