-
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
feat: capture and process lidar data #73
Conversation
if min(self.scan_data[20:120]) < 2500: | ||
for i in range(20, 120): |
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.
please use globals for this
src/utils/lidar.py
Outdated
:param port_name: the name of the port | ||
""" | ||
self.port_name = port_name | ||
self.lidar = RPLidar(None, self.port_name, timeout=3) |
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.
use config for the port name
src/utils/lidar.py
Outdated
config = ConfigLoader() | ||
self.port_name = config.lidar.port_name | ||
|
||
print(' PAASHAAS ') |
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.
why print paashaas?
lidar.py contains the Lidar class for interacting with a lidar.
Usage:
find_obstacle_distance(self, anglemin: int, anglemax: int): Finds the distance to the closest obstacle within a specified angle range.
right_free(self): Checks if the right side of the car is free of obstacles.
free_side(self, anglemin: int, anglemax: int): Checks if a specified angle range is free of obstacles.
data_processing(self): Processes the raw data from the LIDAR device.
capture(self): Continuously captures data from the LIDAR device and updates the scan_data attribute.
start(self): Starts the LIDAR device and begins capturing data.
stop(self): Stops the LIDAR device and ends data capture.