Skip to content

Commit

Permalink
Gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Xierumeng committed Feb 24, 2024
1 parent 0f3e6db commit aa23575
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ __pycache__/
venv/

# Logging
*log*
logs/
8 changes: 5 additions & 3 deletions path_2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
CAMERA = 0
ALTITUDE = 40
CONNECTION_ADDRESS = "tcp:localhost:14550"
KML_FILE_PARENT_DIRECTORY = pathlib.Path("waypoints")
KML_FILE_PREFIX = "waypoints_log"
LOG_DIRECTORY_PATH = pathlib.Path("logs")
KML_FILE_PREFIX = "waypoints"
DELAY = 0.1 # seconds


Expand All @@ -34,6 +34,8 @@ def main() -> int:
"""
Main function.
"""
pathlib.Path(LOG_DIRECTORY_PATH).mkdir(exist_ok=True)

# Wait ready is false as the drone may be on the ground
drone = dronekit.connect(CONNECTION_ADDRESS, wait_ready=False)

Expand All @@ -56,7 +58,7 @@ def main() -> int:
result, _ = ground_locations_to_kml.ground_locations_to_kml(
waypoints_list,
KML_FILE_PREFIX,
KML_FILE_PARENT_DIRECTORY,
LOG_DIRECTORY_PATH,
)
if not result:
print("ERROR: Unable to generate KML file")
Expand Down
8 changes: 5 additions & 3 deletions path_2024.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
WAYPOINT_FILE_PATH = pathlib.Path("2024", "waypoints", "wrestrc.csv")
ALTITUDE = 40
CONNECTION_ADDRESS = "tcp:localhost:14550"
KML_FILE_PARENT_DIRECTORY = pathlib.Path("waypoints")
KML_FILE_PREFIX = "waypoints_log"
LOG_DIRECTORY_PATH = pathlib.Path("logs")
KML_FILE_PREFIX = "waypoints"
DELAY = 0.1 # seconds


def main() -> int:
"""
Main function.
"""
pathlib.Path(LOG_DIRECTORY_PATH).mkdir(exist_ok=True)

# Wait ready is false as the drone may be on the ground
drone = dronekit.connect(CONNECTION_ADDRESS, wait_ready=False)

Expand All @@ -52,7 +54,7 @@ def main() -> int:
result, _ = ground_locations_to_kml.ground_locations_to_kml(
waypoints_list,
KML_FILE_PREFIX,
KML_FILE_PARENT_DIRECTORY,
LOG_DIRECTORY_PATH,
)
if not result:
print("ERROR: Unable to generate KML file")
Expand Down

0 comments on commit aa23575

Please sign in to comment.