Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My Submission #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

My Submission #126

wants to merge 1 commit into from

Conversation

Ammo-byte
Copy link

No description provided.

Copy link

@AaronWang04 AaronWang04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

Comment on lines +72 to +75
if (
abs(self.waypoint.location_x - report.position.location_x) <= self.acceptance_radius
and abs(self.waypoint.location_y - report.position.location_y)
<= self.acceptance_radius

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that this is an acceptance RADIUS

Comment on lines +80 to +85
elif not self.waypoint_reached:
command = commands.Command.create_set_relative_destination_command(
self.waypoint.location_x - report.position.location_x,
self.waypoint.location_y - report.position.location_y,
)
print("Drone is moving")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if dorne halts and have not reached waypoint, then does it get stuck in a loop of doing nothing?

Comment on lines +26 to +52
def l2_norm(self, x1: float, y1: float, x2: float, y2: float) -> float:
"""
Calculate the L2 norm between two points.
"""
return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5

def closest_pad(
self, landing_pad_locations: "list[location.Location]", position: location.Location
) -> "tuple[float, float]":
"""
Find the closest landing pad.
"""
min_distance = float("inf")
closest_pad_coords = (None, None)

for landing_pad in landing_pad_locations:
distance = self.l2_norm(
position.location_x,
position.location_y,
landing_pad.location_x,
landing_pad.location_y,
)
if distance < min_distance:
min_distance = distance
closest_pad_coords = (landing_pad.location_x, landing_pad.location_y)

return closest_pad_coords

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can make these methods static, generally a good thing to do

otherwise, good formatting and naming of functions

@@ -67,8 +97,70 @@ def run(
# ============
# ↓ BOOTCAMPERS MODIFY BELOW THIS COMMENT ↓
# ============

# Do something based on the report and the state of this class...
if report.status == drone_status.DroneStatus.HALTED:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue dittoed from decision simple waypoint

for i in range(0, boxes_cpu.shape[0]):
result, box = bounding_box.BoundingBox.create(boxes_cpu[i])
if not result:
return [], image_annotated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good handling of error points

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants