Skip to content
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

Closed
wants to merge 15 commits into from
Closed

feat: capture and process lidar data #73

wants to merge 15 commits into from

Conversation

Willtura
Copy link
Contributor

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.

@Willtura Willtura added the enhancement New feature or request label Apr 10, 2024
requirements.txt Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
src/utils/lidar.py Outdated Show resolved Hide resolved
src/utils/lidar.py Outdated Show resolved Hide resolved
src/utils/lidar.py Show resolved Hide resolved
Comment on lines +45 to +46
if min(self.scan_data[20:120]) < 2500:
for i in range(20, 120):
Copy link
Collaborator

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 Show resolved Hide resolved
src/utils/lidar.py Outdated Show resolved Hide resolved
:param port_name: the name of the port
"""
self.port_name = port_name
self.lidar = RPLidar(None, self.port_name, timeout=3)
Copy link
Collaborator

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

config = ConfigLoader()
self.port_name = config.lidar.port_name

print(' PAASHAAS ')
Copy link
Contributor

Choose a reason for hiding this comment

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

why print paashaas?

@MichelGerding MichelGerding deleted the Lidar-overtake branch April 11, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants