Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamD1 authored Sep 25, 2024
1 parent 1c8a9a4 commit 03304b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 5 additions & 5 deletions decision_simple_waypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ def __init__(self, waypoint: location.Location, acceptance_radius: float) -> Non
# ↓ BOOTCAMPERS MODIFY BELOW THIS COMMENT ↓
# ============

self.waypoint_found =False
self.waypoint_found = False
self.landing_pad_found = False


# ============
# ↑ BOOTCAMPERS MODIFY ABOVE THIS COMMENT ↑
# ============
Expand Down Expand Up @@ -82,9 +81,10 @@ def run(
if distance_squared < self.acceptance_radius**2:
command = commands.Command.create_land_command()
print("The drone is within the accepted range")
else: command = commands.Command.create_set_relative_destination_command(
destination_x, destination_y
)
else:
command = commands.Command.create_set_relative_destination_command(
destination_x, destination_y
)
print(f"Moving to waypoint{waypoint.location_x},{waypoint.location_y}")

# ============
Expand Down
4 changes: 2 additions & 2 deletions decision_waypoint_landing_pads.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def at_point(self, current_x: float, current_y: float) -> bool:
bool: True if the drone is within the acceptance radius, False otherwise.
"""
distance_squared = (self.waypoint.location_x - current_x) ** 2 + (
self.waypoint.location_y - current_y
self.waypoint.location_y - current_y
) ** 2
return distance_squared <= self.acceptance_radius ** 2
return distance_squared <= self.acceptance_radius**2

def run(
self, report: drone_report.DroneReport, landing_pad_locations: "list[location.Location]"
Expand Down
4 changes: 1 addition & 3 deletions detect_landing_pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def run(self, image: np.ndarray) -> "tuple[list[bounding_box.BoundingBox], np.nd
# * verbose
# conf threshold is around 0.7
predictions = self.__model.predict(
source=image, conf=0.7, device=self.__DEVICE, verbose =False
source=image, conf=0.7, device=self.__DEVICE, verbose=False
)

# Get the Result object
Expand Down Expand Up @@ -129,10 +129,8 @@ def run(self, image: np.ndarray) -> "tuple[list[bounding_box.BoundingBox], np.nd
if not success:
continue


return [], image_annotated


# ============
# ↑ BOOTCAMPERS MODIFY ABOVE THIS COMMENT ↑
# ============

0 comments on commit 03304b0

Please sign in to comment.