Conversation
Chanpreet077
commented
Dec 30, 2025
- Implemented heartbeat sender/receiver, telemetry, and command workers and ran tests
logs/heartbeat_receiver/main.log
Outdated
| @@ -0,0 +1,2 @@ | |||
| 18:47:03: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\modules\common\modules\logger\logger_main_setup.py | setup_main_logger | 62] main logger initialized | |||
There was a problem hiding this comment.
in your main there should be the status of either "connected" or "disconnected" logged
| @@ -0,0 +1,2 @@ | |||
| 18:47:06: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\modules\heartbeat\heartbeat_receiver_worker.py | heartbeat_receiver_worker | 57] Logger initialized | |||
There was a problem hiding this comment.
it would also be beneficial for including log statements here too
| @@ -0,0 +1,2 @@ | |||
| 15:39:28: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\modules\heartbeat\heartbeat_sender_worker.py | heartbeat_sender_worker | 46] Logger initialized | |||
| 15:39:28: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\modules\heartbeat\heartbeat_sender_worker.py | heartbeat_sender_worker | 57] send_period_s=1 | |||
There was a problem hiding this comment.
same comment as above, nice to see log statements to know what's happening in the worker
modules/command/command.py
Outdated
| yaw_error = (desired_yaw_deg - current_yaw_deg + 180) % 360 - 180 | ||
|
|
||
| if abs(yaw_error) > 5: | ||
| direction = 1 if yaw_error >= 0 else -1 |
| controller: worker_controller.WorkerController, | ||
| output_queue: queue_proxy_wrapper.QueueProxyWrapper, |
There was a problem hiding this comment.
generally, to align with WorkerProperties used in bootcamp_main.py, the input/output queues come before the controller
| ok, heartbeat_receiver_instance = heartbeat_receiver.HeartbeatReceiver.create( | ||
| connection, disconnect_threshold, local_logger | ||
| ) | ||
| if not ok or heartbeat_receiver_instance is None: |
There was a problem hiding this comment.
the tuple that the object returns enables you to only need to check the boolean if the instantiation exists rather than having to check both items in the tuple - this applies to the rest of your code
modules/telemetry/telemetry.py
Outdated
| if time.time() - start_time > timeout_s: | ||
| self._logger.warning("Telemetry timeout, restarting") | ||
| start_time = time.time() | ||
| self._last_attitude = None | ||
| self._last_position = None |
There was a problem hiding this comment.
instead of nesting the 1 second timeout logic requirement, it may make more sense + add to the readabilty of your code to add it into the the requirement of your while loop instead of having it as while True
bootcamp_main.py
Outdated
| try: | ||
| report = report_queue.queue.get_nowait() | ||
| main_logger.info(f"Command report: {report}", True) | ||
| except queue.Empty: | ||
| pass |
There was a problem hiding this comment.
you can include this in the same try and except block from above
|
reviewed! |
logs/heartbeat_receiver_log/main.log
Outdated
| 23:20:11: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: {'got_heartbeat': True, 'connected': True} | ||
| 23:20:13: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: {'got_heartbeat': False, 'connected': True} | ||
| 23:20:15: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: {'got_heartbeat': False, 'connected': True} | ||
| 23:20:17: [INFO] [C:\Users\1makk\OneDrive\Documents\JavaProjects\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: {'got_heartbeat': False, 'connected': True} |
There was a problem hiding this comment.
the requirements of the bootcamp specify an output of either "connected" or "disconnected"
| if not is_connected: | ||
| local_logger.info("Drone disconnected, stopping heartbeat receiver", True) | ||
| break |
There was a problem hiding this comment.
no need for this logic here, it's used in bootcamp_main.py
tests/integration/test_command.py
Outdated
| controller: worker_controller.WorkerController, | ||
| input_queue: queue_proxy_wrapper.QueueProxyWrapper, | ||
| output_queue: queue_proxy_wrapper.QueueProxyWrapper, |
There was a problem hiding this comment.
to match the syntax used in WorkerProperties that's in bootcamp_main.py, the input/output queues generally come before the controller in the parameters
tests/integration/test_telemetry.py
Outdated
| controller: worker_controller.WorkerController, | ||
| output_queue: queue_proxy_wrapper.QueueProxyWrapper, # Add any necessary arguments |
|
reviewed! |
| 02:30:28: [INFO] [C:\dev\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: Connected | ||
| 02:30:29: [INFO] [C:\dev\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: Connected | ||
| 02:30:30: [INFO] [C:\dev\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: Connected | ||
| 02:30:31: [INFO] [C:\dev\autonomy-bootcamp-2025-p2\tests\integration\test_heartbeat_receiver.py | read_queue | 71] Receiver output: Connected |
There was a problem hiding this comment.
this needs to show when it disconnects as well