-
Notifications
You must be signed in to change notification settings - Fork 266
Initial Submission - Manjot #100
base: main
Are you sure you want to change the base?
Conversation
maxlou05
left a comment
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.