-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Created LocationGroundAndAltitude class * Fixed indentation issues * Fixed formatting issues * Created module to read CSV with altitude and added test cases * Fix format issues * Created overloaded dict to list function * Fixed formatting * Renamed function in waypoint_dict_to_list * Created waypoint to command function with LocationGroundAndAltitude * Fixed formatting issues * Added new modules to path_2024.py * Fixed formatting issues * Fixed formatting issues on CI * Fixed formatting issues on CI - Part 2 * Addressed nits * Fixed linter issues
- Loading branch information
Showing
11 changed files
with
305 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
name,latitude,longitude | ||
1,48.509661,-71.645100 | ||
2,48.509183,-71.643465 | ||
3,48.507690,-71.644438 | ||
4,48.507667,-71.646092 | ||
5,48.507642,-71.646416 | ||
6,48.507547,-71.646720 | ||
7,48.507413,-71.646954 | ||
8,48.507256,-71.647120 | ||
9,48.507103,-71.647212 | ||
10,48.506962,-71.647268 | ||
name,latitude,longitude,altitude | ||
1,48.509661,-71.645100,106.68 | ||
2,48.509183,-71.643465,106.68 | ||
3,48.509183,-71.643465,76.2 | ||
4,48.507690,-71.644438,76.2 | ||
5,48.507690,-71.644438,60.96 | ||
6,48.507667,-71.646092,60.96 | ||
7,48.507642,-71.646416,60.96 | ||
8,48.507547,-71.646720,60.96 | ||
9,48.507413,-71.646954,60.96 | ||
10,48.507256,-71.647120,60.96 | ||
11,48.507103,-71.647212,60.96 | ||
12,48.506962,-71.647268,30.48 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
name,latitude,longitude | ||
1,43.4338974,-80.5773193 | ||
2,43.433985,-80.577853 | ||
3,43.4341087,-80.5783774 | ||
4,43.4342606,-80.5791324 | ||
5,43.4343726,-80.5796206 | ||
6,43.434322,-80.5797641 | ||
7,43.4339802,-80.5799559 | ||
8,43.4338399,-80.5799478 | ||
9,43.4334163,-80.579115 | ||
10,43.4332634,-80.5782366 | ||
11,43.433314,-80.5780595 | ||
12,43.4337425,-80.5778342 | ||
13,43.4337805,-80.5776612 | ||
14,43.4337367,-80.5773863 | ||
name,latitude,longitude,altitude | ||
1,43.4338974,-80.5773193,50 | ||
2,43.433985,-80.577853,50 | ||
3,43.4341087,-80.5783774,50 | ||
4,43.4342606,-80.5791324,50 | ||
5,43.4343726,-80.5796206,50 | ||
6,43.434322,-80.5797641,50 | ||
7,43.4339802,-80.5799559,50 | ||
8,43.4338399,-80.5799478,50 | ||
9,43.4334163,-80.579115,50 | ||
10,43.4332634,-80.5782366,50 | ||
11,43.433314,-80.5780595,50 | ||
12,43.4337425,-80.5778342,50 | ||
13,43.4337805,-80.5776612,50 | ||
14,43.4337367,-80.5773863,50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Class to store LocationGround and corresponding altitude. | ||
""" | ||
|
||
from .common.kml.modules import location_ground | ||
|
||
|
||
class Waypoint: | ||
""" | ||
LocationGroundAndAltitude represents a geographical ground location and an altitude | ||
with a name, latitude, longitude, and altitude. | ||
Attributes: | ||
name (str): The name or label for the location. | ||
latitude (float): The latitude coordinate in decimal degrees. | ||
longitude (float): The longitude coordinate in decimal degrees. | ||
altitude (float): The altitude coordinate in metres. | ||
Methods: | ||
__init__(name, latitude, longitude, altitude): Initializes a LocationGroundAndAltitude object. | ||
__eq__(other): Checks if two LocationGroundAndAltitude objects are equal. | ||
__repr__(): Returns a string representation of the LocationGroundAndAltitude object. | ||
""" | ||
|
||
def __init__(self, name: str, latitude: float, longitude: float, altitude: float) -> None: | ||
""" | ||
Constructor for the LocationGroundAndAltitude object. | ||
Args: | ||
name (str): The name or label for the location. | ||
latitude (float): The latitude coordinate in decimal degrees. | ||
longitude (float): The longitude coordinate in decimal degrees. | ||
altitude (float): The altitude of the coordinate in metres. | ||
""" | ||
self.location_ground = location_ground.LocationGround(name, latitude, longitude) | ||
self.altitude = altitude | ||
|
||
def __eq__(self, other: "Waypoint") -> bool: | ||
""" | ||
Checks if two LocationGroundAndAltitude objects are equal. | ||
Args: | ||
other (LocationGroundAndAltitude): The other LocationGroundAndAltitude object to compare to. | ||
""" | ||
if not isinstance(other, Waypoint): | ||
return False | ||
|
||
return self.location_ground == other.location_ground and self.altitude == other.altitude | ||
|
||
def __repr__(self) -> str: | ||
""" | ||
String representation | ||
""" | ||
return f"LocationGroundAndAltitude: {repr(self.location_ground)}, altitude: {self.altitude}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name,latitude,longitude,altitude | ||
WARG,43.47323264522664,-80.54011639872981,10.0 | ||
University of Waterloo Station for 301 ION,43.4735247614021,-80.54144667502672,10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.