-
Notifications
You must be signed in to change notification settings - Fork 0
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
clustering integration #45
Conversation
still writing tests, just wanted to put this here earlier so there's more time to review. |
bf9a02c
to
26c7fae
Compare
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
OBSTACLES = 0 | ||
DETECTIONS = 0 |
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.
is this meant to be an enum? if so use an enum class, and they shouldn't both be 0 right?
detection_input_queue: queue_wrapper.QueueWrapper, | ||
obstacle_input_queue: queue_wrapper.QueueWrapper, |
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.
why do we need 2 queues if we'll only run either obstacles or detections but not both at the same time?
try: | ||
odometry: drone_odometry_local.DroneOdometryLocal = ( | ||
odometry_input_queue.queue.get_nowait() | ||
) | ||
except queue.Empty: | ||
continue |
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.
since this must happen not matter the merge data type, you should move it outside after the if statement
if len(obstacles) == 0: | ||
continue |
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.
we do we skip the delay if the length is 0? why is this a special case?
if len(detections) == 0: | ||
continue | ||
time.sleep(delay) |
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 as above
detections = [] | ||
obstacles = [] |
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.
why do we need 2 variables if we'll only run either obstacles or detections but not both at the same time?
modules/decision/decision.py
Outdated
if str(type(merged_data)) == "<class 'detections_and_odometry.DetectionsAndOdometry'>": | ||
return self.run_simple_decision( | ||
self.merged_odometries, self.proximity_limit, current_flight_mode | ||
) | ||
if str(type(merged_data)) == "<class 'obstacles_and_odometry.ObstaclesAndOdometry'>": | ||
return self.run_obstacle_avoidance(self.merged_odometries) |
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.
don't use the string of the classes, pass in the method instead - maybe instead of passing a string from main to data merge, pass a data merge enum, and here, use the enum as well
modules/decision/decision_worker.py
Outdated
obstacle_data: obstacle.Obstacle = obstacle_in_queue.queue.get_nowait() | ||
if obstacle_data is None: | ||
break | ||
|
||
result, value = decider.run(merged_data) | ||
if not result: | ||
continue | ||
|
||
result, value = decider.run_obstacle_avoidance(obstacle_data) | ||
if not result: | ||
continue | ||
|
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.
use the config passed in from main to decide what to run - we're not running both
detection_to_clustering_queue.queue.put(value) | ||
detection_to_data_merge_queue.queue.put(value) |
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.
don't do both
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
merged_to_clustering_queue.fill_and_drain_queue() | ||
clustering_to_deflection_queue.fill_and_drain_queue() |
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.
check not None
No description provided.