Conversation
MatthewCalligaro
left a comment
There was a problem hiding this comment.
Good job! Most of my feedback is in coordination with MITLLRacecar/Simulation#1. Let's discuss and check these in together when they are ready!
library/drone.py
Outdated
| """ | ||
| Copyright MIT and Harvey Mudd College | ||
| MIT License | ||
| Summer 2020 |
There was a problem hiding this comment.
Go ahead and make that 2022 :)
library/drone.py
Outdated
| # Store the amount of blue in the pixel on row 3, column 5 | ||
| blue = image[3][5][0] | ||
| """ | ||
| return copy.deepcopy(self.get_drone_image_no_copy()) |
There was a problem hiding this comment.
Please add a declaration for get_image_no_copy as well (see camera.py for comparison).
library/drone.py
Outdated
| _HEIGHT: int = 480 | ||
|
|
||
|
|
||
| def get_drone_image(self) -> NDArray[(480, 640, 3), np.uint8]: |
There was a problem hiding this comment.
To keep in line with my comment in the Simulation PR review, consider changing this to get_image instead. Happy to discuss if you disagree.
library/drone.py
Outdated
| pass | ||
|
|
||
| @abc.abstractmethod | ||
| def get_drone_height(self) -> float: |
There was a problem hiding this comment.
consider changing to get_height
library/drone.py
Outdated
| @abc.abstractmethod | ||
| def get_drone_height(self) -> float: | ||
| """ | ||
| Returns the drone's height. |
There was a problem hiding this comment.
Please add an Example:: and Returns:: entry to the docstring. This is needed so that the documentation is auto-formatted correctly on the website (the website pulls from these docstrings to make the html).
library/simulation/drone_sim.py
Outdated
| self.__drone_image: NDArray[(480, 640, 3), np.uint8] = None | ||
| self.__is_drone_image_current: bool = False | ||
|
|
||
| def get_drone_image_no_copy(self) -> NDArray[(480, 640, 3), np.uint8]: |
There was a problem hiding this comment.
any function names changed in drone.py will have to be made here as well
| def get_drone_image_async(self) -> NDArray[(480, 640, 3), np.uint8]: | ||
| return self.__request_drone_image(True) | ||
|
|
||
| def __update(self) -> None: |
There was a problem hiding this comment.
Organize by public and private methods (ie move __update and __request_drone_image to the bottom)
| import drive_sim | ||
| import lidar_sim | ||
| import physics_sim | ||
| import drone_sim |
There was a problem hiding this comment.
You need to change __VERSION = 1 to 2 since you are updating the communication protocol.
| lidar_get_samples = 26 | ||
| physics_get_linear_acceleration = 27 | ||
| physics_get_angular_velocity = 28 | ||
| physics_get_position = 29 |
There was a problem hiding this comment.
Any changes in Simulation/PythonInterface.cs will need to be made here too
| rc_utils.print_error(text) | ||
| print(">> Closing script...") | ||
| exit(0) | ||
|
|
There was a problem hiding this comment.
nit: remove extra newline
Added all new files and modifications to old files for the GPS and drone modules (on the Python side).