-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
140 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Deflection. | ||
""" | ||
|
||
|
||
class Deflection: | ||
""" | ||
Deflection. | ||
""" | ||
|
||
def __init__(self) -> None: | ||
""" | ||
Initialization. | ||
""" | ||
|
||
def run(self) -> "tuple[False, None]": | ||
""" | ||
Run. | ||
""" | ||
return False, None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Gets obstacles and odometry and outputs a decision. | ||
""" | ||
|
||
from modules import obstacles_and_odometry | ||
from worker import queue_wrapper | ||
from worker import worker_controller | ||
from . import deflection | ||
|
||
|
||
def deflection_worker( | ||
cluster_in_queue: queue_wrapper.QueueWrapper, | ||
command_out_queue: queue_wrapper.QueueWrapper, | ||
controller: worker_controller.WorkerController, | ||
) -> None: | ||
""" | ||
Worker process. | ||
cluster_in_queue, command_out_queue are data queues. | ||
controller is how the main process communicates to this worker process. | ||
""" | ||
|
||
deflecter = deflection.Deflection() | ||
|
||
while not controller.is_exit_requested(): | ||
controller.check_pause() | ||
|
||
cluster_data: obstacles_and_odometry.ObstaclesAndOdometry = cluster_in_queue.queue.get() | ||
if cluster_data is None: | ||
break | ||
|
||
result, value = deflecter.run(cluster_data) | ||
if not result: | ||
continue | ||
|
||
command_out_queue.queue.put(value) |