Skip to content

Commit

Permalink
fix: waypoint generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Dec 9, 2024
1 parent d4e4034 commit a35a94f
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions drone_flightplan/waypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from shapely.affinity import rotate
from shapely.ops import transform
from shapely.geometry.base import BaseGeometry

# from drone_flightplan.calculate_parameters import calculate_parameters as cp

import calculate_parameters as cp
from drone_flightplan.calculate_parameters import calculate_parameters as cp


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -258,7 +255,7 @@ def create_waypoint(
generate_each_points: bool = False,
generate_3d: bool = False,
no_fly_zones: dict = None,
# take_off_point: list[float] = None,
take_off_point: list[float] = None,
) -> str:
"""
Create waypoints for a given project area based on specified parameters.
Expand Down Expand Up @@ -300,8 +297,7 @@ def create_waypoint(
}
"""
take_off_point = [-48.505691125287, -1.4614624905464808]
parameters = cp.calculate_parameters(forward_overlap, side_overlap, agl, gsd)
parameters = cp(forward_overlap, side_overlap, agl, gsd)
side_spacing = parameters["side_spacing"]
forward_spacing = parameters["forward_spacing"]

Expand Down Expand Up @@ -476,12 +472,12 @@ def main():
required=True,
help="The output GeoJSON file path for the waypoints.",
)
# parser.add_argument(
# "--take_off_point",
# required=True,
# type=validate_coordinates,
# help="Take off Point Coordinates in 'longitude,latitude' format (e.g., 82.52,28.29).",
# )
parser.add_argument(
"--take_off_point",
required=True,
type=validate_coordinates,
help="Take off Point Coordinates in 'longitude,latitude' format (e.g., 82.52,28.29).",
)
args = parser.parse_args()

with open(args.project_geojson_polygon, "r") as f:
Expand All @@ -502,7 +498,7 @@ def main():
args.generate_each_points,
args.generate_3d,
no_fly_zones,
# args.take_off_point,
args.take_off_point,
)

with open(args.output_file_path, "w") as f:
Expand Down

0 comments on commit a35a94f

Please sign in to comment.