Skip to content

Phase 2: autonomy bootcamp#35

Open
Chanpreet077 wants to merge 11 commits intoUWARG:mainfrom
Chanpreet077:phase2
Open

Phase 2: autonomy bootcamp#35
Chanpreet077 wants to merge 11 commits intoUWARG:mainfrom
Chanpreet077:phase2

Conversation

@Chanpreet077
Copy link

  • Implemented heartbeat sender/receiver, telemetry, and command workers and ran tests

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above, nice to see log statements to know what's happening in the worker

yaw_error = (desired_yaw_deg - current_yaw_deg + 180) % 360 - 180

if abs(yaw_error) > 5:
direction = 1 if yaw_error >= 0 else -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic is flipped

Comment on lines 22 to 23
controller: worker_controller.WorkerController,
output_queue: queue_proxy_wrapper.QueueProxyWrapper,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Contributor

@ellyokes253 ellyokes253 Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 135 to 139
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Comment on lines 215 to 219
try:
report = report_queue.queue.get_nowait()
main_logger.info(f"Command report: {report}", True)
except queue.Empty:
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can include this in the same try and except block from above

@ellyokes253
Copy link
Contributor

reviewed!

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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the requirements of the bootcamp specify an output of either "connected" or "disconnected"

Comment on lines 84 to 86
if not is_connected:
local_logger.info("Drone disconnected, stopping heartbeat receiver", True)
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this logic here, it's used in bootcamp_main.py

Comment on lines 57 to 59
controller: worker_controller.WorkerController,
input_queue: queue_proxy_wrapper.QueueProxyWrapper,
output_queue: queue_proxy_wrapper.QueueProxyWrapper,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 51 to 52
controller: worker_controller.WorkerController,
output_queue: queue_proxy_wrapper.QueueProxyWrapper, # Add any necessary arguments
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@ellyokes253
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to show when it disconnects as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants