-
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
Initial Submission - Manjot #100
base: main
Are you sure you want to change the base?
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 not self.waypoint_reached: | ||
# Moves towards the waypoint | ||
x_dist = self.waypoint.location_x - report.position.location_x | ||
y_dist = self.waypoint.location_y - report.position.location_y | ||
command = commands.Command.create_set_relative_destination_command(x_dist, y_dist) |
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.
Although this works for the simulation, in real life your drone won't be this precise. Please use the acceptnace_radius to account for minor errors in positioning.
if not self.waypoint_reached: | ||
# Moves towards the waypoint | ||
x_dist = self.waypoint.location_x - report.position.location_x | ||
y_dist = self.waypoint.location_y - report.position.location_y | ||
command = commands.Command.create_set_relative_destination_command(x_dist, y_dist) | ||
|
||
self.waypoint_reached = True |
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.
Same here, please use accpetance_radius
closest_pad = min( | ||
landing_pad_locations, key=lambda pad: self.get_distance(report.position, pad) | ||
) | ||
print(f"Closest Landpad: {closest_pad.location_x}, {closest_pad.location_y}") |
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.
This can be moved to the section where you first reach the waypoint. Right now, it recalculates your landing pad continuously (whenever it stops), which is unnecessary.
# This func returns a tuple, with whether the operation was a sucess (bool) & the bounding box itself | ||
successful, box = bounding_box.BoundingBox.create(bounds=boxes_cpu[i]) | ||
|
||
if successful: |
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.
Normally, in statistics, we discard the entire data point (the entire image) if one part of it (the bounding box) is invalid.
(You do not need to change anything here, just something to think about)
No description provided.