Conversation
| 20:30:25: [INFO] [/Users/derekgou/autonomy-bootcamp-2025-p2/tests/integration/test_heartbeat_receiver.py | main | 111] Connected! | ||
| 20:30:26: [INFO] [/Users/derekgou/autonomy-bootcamp-2025-p2/tests/integration/test_heartbeat_receiver.py | read_queue | 69] Connected |
There was a problem hiding this comment.
your main log is missing when the heartbeat receiver doesn't recieve any heartbeats
logs/heartbeat_sender_logs/main.log
Outdated
| @@ -0,0 +1,2 @@ | |||
| 20:22:16: [INFO] [/Users/derekgou/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.
you're missing the heartbeat_sender_drone_###### file
modules/telemetry/telemetry.py
Outdated
| elif msg.get_type() == "ATTITUDE": | ||
| self.last_attitude = msg | ||
|
|
||
| # Only return if we have both types |
There was a problem hiding this comment.
you're missing the logic for what happens when it doesn't receive both types in 1 second - what should the logger show?
| queue.queue.put(telemetry_data) | ||
| local_logger.info(f"Telemetry data queued: {telemetry_data}", False) | ||
| else: | ||
| break # no more messages right now |
There was a problem hiding this comment.
what would the logger show when it is missing telemetry data?
modules/command/command.py
Outdated
| data_queue: queue_proxy_wrapper.QueueProxyWrapper, | ||
| response_queue: queue_proxy_wrapper.QueueProxyWrapper, |
There was a problem hiding this comment.
while the logic you implement overall stays the same inputting the queues in the class implementation, the purpose of the worker is to use the logic in there
There was a problem hiding this comment.
I'm not totally sure what to change here - I'm assuming you mean to move some logic into the worker, but I'm pretty sure that all of my logic is to fulfill the instructions left in the command.py file - am I missing something?
There was a problem hiding this comment.
i'm trying to say that inputting and taking output from queues should happen within your worker. they way you have it right now works, but the whole point of the worker is to deal with the queues in there
modules/telemetry/telemetry.py
Outdated
| attitude = self.last_attitude | ||
| if position is not None and attitude is not None: | ||
| telemetry_data = TelemetryData( | ||
| time_since_boot=int( |
There was a problem hiding this comment.
also your time_since_boot is weirdly off
There was a problem hiding this comment.
lol I can't figure out why - are you allowed to tell me what I'm supposed to expect?
modules/command/command.py
Outdated
| yaw_change %= 360 | ||
| if yaw_change > 180: | ||
| yaw_change -= 360 | ||
| queued.append(f"CHANGING_YAW: {yaw_change}") |
There was a problem hiding this comment.
your yaw_change calculations are also wrong
modules/command/command.py
Outdated
| yaw_change -= 360 | ||
| queued.append(f"CHANGING_YAW: {yaw_change}") | ||
|
|
||
| if abs(telemetry_data.z - self.target.z) > 0.5 or abs(telemetry_data.yaw - angle) > ( |
There was a problem hiding this comment.
also the altitude change and the yaw change should not be the same mavlink message
There was a problem hiding this comment.
the drone seems to only work if the altitude and yaw change messages are sent simultaneously when they are both triggered - the drone expects 26 messages, but 28 are sent if the altitude and yaw changes are separated. Am I missing something?
There was a problem hiding this comment.
actually jk forget this i read it wrong
There was a problem hiding this comment.
lol probably because i just fixed it (i think) - should be ready for review tho
bootcamp_main.py
Outdated
| target=heartbeat_sender_worker.heartbeat_sender_worker, | ||
| work_arguments=(connection, HEARTBEAT_PERIOD), | ||
| input_queues=[], | ||
| output_queues=[heartbeat_queue], |
There was a problem hiding this comment.
heartbeat sender shouldn't have anything in the input or output queues (reference the worker schematic)
bootcamp_main.py
Outdated
| connection, | ||
| HEARTBEAT_PERIOD, | ||
| ), | ||
| input_queues=[heartbeat_queue], |
There was a problem hiding this comment.
this is also incorrect, i reccommend referencing the worker schematic photo to know where your queues should go
| @@ -0,0 +1,58 @@ | |||
| 22:17:46: [INFO] [/Users/derekgou/autonomy-bootcamp-2025-p2/modules/command/command_worker.py | command_worker | 54] Logger initialized | |||
| 22:17:46: [INFO] [/Users/derekgou/autonomy-bootcamp-2025-p2/modules/command/command.py | run | 91] Average velocity: [0.0, 0.0, 4.0] | |||
| 22:17:46: [INFO] [/Users/derekgou/autonomy-bootcamp-2025-p2/modules/command/command.py | run | 128] 63.43494882292201 | |||
There was a problem hiding this comment.
you shouldn't be logging the yaw here
There was a problem hiding this comment.
this still needs to be fixed
modules/command/command.py
Outdated
| 1, | ||
| 0, | ||
| 0, | ||
| yaw_diff, |
There was a problem hiding this comment.
this needs to go to another parameter spot within self.connection.mav.command_long_send()
modules/command/command.py
Outdated
| self, | ||
| args, # Put your own arguments here | ||
| ): | ||
| def run(self, data: telemetry.TelemetryData) -> None: |
There was a problem hiding this comment.
the return type isn't none if you return something
bootcamp_main.py
Outdated
| HEARTBEAT_PERIOD, | ||
| ), | ||
| input_queues=[], | ||
| output_queues=[], |
There was a problem hiding this comment.
there should be something here
| local_logger.error("Failed to create CommandWorker", True) | ||
| return | ||
| # Main loop: do work. | ||
| while not controller.is_exit_requested(): |
There was a problem hiding this comment.
it's good practice to include controller.check_pause() within the main look as well. this check if the workers are requested to pause (it blocks/sleeps the worker until unpause). the same applies to all other workers
| controller: worker_controller.WorkerController, | ||
| queue: queue_proxy_wrapper.QueueProxyWrapper, |
There was a problem hiding this comment.
it's typically good practice to put the input/output queues above the controller - within WorkerProperties that the bootcamp_main.py uses, it follows this format
|
lgtm! |
🙏