-
Notifications
You must be signed in to change notification settings - Fork 222
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
base: main
Are you sure you want to change the base?
My Submission #126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
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 |
There was a problem hiding this comment.
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
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") |
There was a problem hiding this comment.
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?
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
No description provided.