Track#

class Track#

Represents a track

track#

List of all waypoints that comprise a track

Type

list[Waypoint]

name#

An optional name for the tracl

Type

Optional[str]

description#

An optional description for the track

Type

Optional[str]

set(track)#

Set the track

Parameters

track (list[Waypoint]) – The track to set

reset()#

Reset the track

add_waypoint(waypoint)#

Add a waypoint to the end of the track

Parameters

waypoint (Waypoint) – The waypoint to add

remove_waypoint(waypoint)#

Remove a waypoint from the track and return it

Parameters

waypoint (Waypoint) – The waypoint to remove

Returns

The removed waypoint

Return type

Waypoint

get_edges()#

Get the edges between each waypoint

Returns

A list of the edges connecting the waypoints in the track

Return type

List[Tuple[Waypoint, Waypoint]]

edge_distances_m()#

Get the distance between each point in a track

Returns

A list of the distances between each waypoint in a track in metres

Return type

List[float]

track_distance_m()#

Get the distance of the track in metres

Returns

The overall distance of the track in metres

Return type

float

distance_to_end_m(waypoint)#

Get the distance to the end of the track in metres

Parameters

waypoint (Waypoint) – The waypoint to compare

Returns

The distance to the end of the track in metres

Return type

float