-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lidar processing #48
Lidar processing #48
Conversation
modules/lidar_oscillation.py
Outdated
""" | ||
|
||
|
||
class LidarReading: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have a data structure for lidar detections so use that instead. it's called LidarDetection
|
||
class LidarOscillation: | ||
""" | ||
Class to represent a collection of LiDAR readings that make up an oscillation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how many degrees are there in one oscillation?
@classmethod | ||
def create(cls, readings: list[LidarReading]) -> "tuple[bool, LidarOscillation | None]": | ||
""" | ||
Create a new LidarOscillation object from a list of LidarReading objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create this from a list[LidarDetection]
modules/lidar_oscillation.py
Outdated
Create a new LidarOscillation object from a list of LidarReading objects. | ||
""" | ||
# Ensuring the list only contains LidarReading instances | ||
if not all(isinstance(reading, LidarReading) for reading in readings): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to check that they are the correct type. just check that the object is not None.
modules/lidar_oscillation.py
Outdated
|
||
return True, LidarOscillation(cls.__create_key, readings) | ||
|
||
def __init__(self, class_private_create_key: object, readings: list) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type annotation for readings is incorrect
modules/lidar_oscillation.py
Outdated
""" | ||
assert class_private_create_key is LidarOscillation.__create_key, "Use the create() method" | ||
|
||
# Store the list of LidarReading objects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is not needed
modules/lidar_oscillation.py
Outdated
""" | ||
reading_strs = [ | ||
str(reading) for reading in self.readings | ||
] # Create a list of reading strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with this comment
modules/lidar_oscillation.py
Outdated
reading_strs = [ | ||
str(reading) for reading in self.readings | ||
] # Create a list of reading strings | ||
return f"LidarOscillation with {len(self.readings)} readings:\n" + "\n".join(reading_strs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reformat to keep strings on one line. you can leave spaces or commas in between readings instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a period and a space at the end as well
…rDetection objects, adjusted _str_ to print on one line and include all relevant details
Fixed Linting, Creating custom data structures to store lidar oscillations