An autonomous vehicle platform by Pathfinder
Project description
Findee ๐
Findee๋ ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด ๊ธฐ๋ฐ์ ์์จ์ฃผํ ์ฐจ๋ ํ๋ซํผ์ ๋๋ค. ๋ชจํฐ ์ ์ด, ์นด๋ฉ๋ผ, ์ด์ํ ์ผ์๋ฅผ ํตํฉํ์ฌ ๋ก๋ณดํฑ์ค ํ๋ก์ ํธ๋ฅผ ์ฝ๊ฒ ๊ตฌํํ ์ ์๋๋ก ๋์์ค๋๋ค.
โจ ์ฃผ์ ๊ธฐ๋ฅ
- ๐ ๋ชจํฐ ์ ์ด: DC ๋ชจํฐ๋ฅผ ์ด์ฉํ ์ ์ง, ํ์ง, ํ์ ์ ์ด
- ๐ท ์นด๋ฉ๋ผ: Picamera2๋ฅผ ์ด์ฉํ ์ค์๊ฐ ์์ ์ฒ๋ฆฌ
- ๐ก ์ด์ํ ์ผ์: ๊ฑฐ๋ฆฌ ์ธก์ ๋ฐ ์ฅ์ ๋ฌผ ๊ฐ์ง
- ๐ฏ ํตํฉ ํ๋ซํผ: ํ๋์ ํด๋์ค๋ก ๋ชจ๋ ํ๋์จ์ด ์ ์ด
๐ง ํ๋์จ์ด ์๊ตฌ์ฌํญ
ํ์ ํ๋์จ์ด
- ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด 4 Model B (๊ถ์ฅ) ๋๋ ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด 3B+
- ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด ์นด๋ฉ๋ผ ๋ชจ๋ V2 ๋๋ ํธํ ์นด๋ฉ๋ผ
- DC ๋ชจํฐ 2๊ฐ (๋ฐํด์ฉ)
- ๋ชจํฐ ๋๋ผ์ด๋ฒ (L298N ๊ถ์ฅ)
- ์ด์ํ ์ผ์ (HC-SR04)
- ์ ํผ ์์ด์ด ๋ฐ ๋ธ๋ ๋๋ณด๋
๐ฆ ์ค์น ๋ฐฉ๋ฒ
1. ๊ธฐ๋ณธ ์ค์น
pip install findee
2. ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด ์ค์
# ์นด๋ฉ๋ผ ํ์ฑํ
sudo raspi-config
# Interface Options > Camera > Enable
# GPIO ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น (์์คํ
ํจํค์ง)
sudo apt update
sudo apt install python3-rpi.gpio
# ๊ถํ ์ค์ (์ ํ์ฌํญ)
sudo usermod -a -G gpio $USER
3. ๊ฐ๋ฐ์ฉ ์ค์น (๊ธฐ์ฌ์์ฉ)
git clone https://github.com/Comrid/findee.git
cd findee
pip install -e .[dev]
### 4. ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ์์
```markdown
## ๐ ์ฌ์ฉ๋ฒ
### ๊ธฐ๋ณธ ์์
```python
from findee import Findee
# Findee ๊ฐ์ฒด ์์ฑ
robot = Findee()
try:
# 2์ด๊ฐ ์ ์ง
robot.motor.move_forward(50)
time.sleep(2)
# 1์ด๊ฐ ์ฐํ์
robot.motor.turn_right(30)
time.sleep(1)
# ์ ์ง
robot.motor.stop()
# ๊ฑฐ๋ฆฌ ์ธก์
distance = robot.ultrasonic.get_distance()
print(f"๊ฑฐ๋ฆฌ: {distance}cm")
# ์นด๋ฉ๋ผ ํ๋ ์ ์บก์ฒ
frame = robot.camera.get_frame()
print(f"ํ๋ ์ ํฌ๊ธฐ: {frame.shape}")
finally:
# ๋ฆฌ์์ค ์ ๋ฆฌ
robot.motor.cleanup()
์์จ์ฃผํ ์์
import time
from findee import Findee
def autonomous_drive():
robot = Findee()
try:
while True:
# ๊ฑฐ๋ฆฌ ์ธก์
distance = robot.ultrasonic.get_distance()
if distance is None:
print("์ผ์ ์ค๋ฅ")
continue
if distance > 20: # 20cm ์ด์์ด๋ฉด ์ ์ง
robot.motor.move_forward(40)
elif distance > 10: # 10-20cm๋ฉด ์ฒ์ฒํ
robot.motor.move_forward(20)
else: # 10cm ์ดํ๋ฉด ํ์
robot.motor.turn_right(30)
time.sleep(0.5)
robot.motor.stop()
time.sleep(0.1)
except KeyboardInterrupt:
print("ํ๋ก๊ทธ๋จ ์ข
๋ฃ")
finally:
robot.motor.cleanup()
if __name__ == "__main__":
autonomous_drive()
### 5. API ๋ฌธ์
```markdown
## ๐ API ๋ฌธ์
### Findee ํด๋์ค
๋ฉ์ธ ํด๋์ค๋ก ๋ชจ๋ ํ๋์จ์ด ๊ตฌ์ฑ์์์ ์ ๊ทผํ ์ ์์ต๋๋ค.
```python
robot = Findee()
robot.motor # Motor ํด๋์ค ์ธ์คํด์ค
robot.camera # Camera ํด๋์ค ์ธ์คํด์ค
robot.ultrasonic # Ultrasonic ํด๋์ค ์ธ์คํด์ค
Motor ํด๋์ค
DC ๋ชจํฐ ์ ์ด๋ฅผ ๋ด๋นํฉ๋๋ค.
๊ธฐ๋ณธ ์ ์ด
move_forward(speed): ์ ์ง (speed: 20-100)move_backward(speed): ํ์ง (speed: 20-100)turn_left(speed): ์ ์๋ฆฌ ์ขํ์ (speed: 20-100)turn_right(speed): ์ ์๋ฆฌ ์ฐํ์ (speed: 20-100)stop(): ์ ์งcleanup(): GPIO ์ ๋ฆฌ
๊ณ ๊ธ ์ ์ด
smooth_turn_left(speed, angle): ๋ถ๋๋ฌ์ด ์ขํ์ (angle: 0-60)smooth_turn_right(speed, angle): ๋ถ๋๋ฌ์ด ์ฐํ์ (angle: 0-60)control_motors(right, left): ๊ฐ๋ณ ๋ชจํฐ ์ ์ด (-100 ~ 100)
Camera ํด๋์ค
๋ผ์ฆ๋ฒ ๋ฆฌํ์ด ์นด๋ฉ๋ผ ์ ์ด๋ฅผ ๋ด๋นํฉ๋๋ค.
get_frame(): ํ์ฌ ํ๋ ์ ๋ฐํ (numpy array)camera_test(): ์นด๋ฉ๋ผ ์ฐ๊ฒฐ ํ ์คํธ
Ultrasonic ํด๋์ค
HC-SR04 ์ด์ํ ์ผ์ ์ ์ด๋ฅผ ๋ด๋นํฉ๋๋ค.
get_distance(): ๊ฑฐ๋ฆฌ ์ธก์ ๋ฐํ (cm, None if error)- ์ธก์ ๋ฒ์: 2-400cm
- ์ ํ๋: ยฑ1cm
### ์ด์ ๋ฆฌํฌํธ
๋ฒ๊ทธ๋ ๊ธฐ๋ฅ ์์ฒญ์ [GitHub Issues](https://github.com/Comrid/findee/issues)๋ฅผ ์ด์ฉํด์ฃผ์ธ์.
## ๐ ๋ผ์ด์ ์ค
์ด ํ๋ก์ ํธ๋ MIT ๋ผ์ด์ ์ค๋ฅผ ๋ฐ๋ฆ
๋๋ค. ์์ธํ ๋ด์ฉ์ [LICENSE](LICENSE) ํ์ผ์ ์ฐธ์กฐํ์ธ์.
## ๐ฅ ์ ์์
- **Pathfinder** - *์ด๊ธฐ ๊ฐ๋ฐ* - [Comrid](https://github.com/Comrid)
## ๐ ๊ฐ์ฌ์ ๋ง
- ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด ์ฌ๋จ์ ํ๋ฅญํ ํ๋์จ์ด
- ์คํ์์ค ์ปค๋ฎค๋ํฐ์ ์ง์
---
**์ฆ๊ฑฐ์ด ๋ก๋ณดํฑ์ค ํ๋ก์ ํธ ๋์ธ์!** ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file findee-0.0.4.tar.gz.
File metadata
- Download URL: findee-0.0.4.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
262f32c3b58680fd793e2f99b513ca530c21e77a0ccca276381be437881102ee
|
|
| MD5 |
2f14d74c10c615e6c8facc557af8d848
|
|
| BLAKE2b-256 |
50153af88a94d86367aec9819bfd671b97d4bf4900e1d20cb19700f8b610e277
|
File details
Details for the file findee-0.0.4-py3-none-any.whl.
File metadata
- Download URL: findee-0.0.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8246820c7d622c862566315093d0eb2db6b8ea50106cafefab674ebaecfd765f
|
|
| MD5 |
a3666e7c4b805ded64094b2cadb9e93c
|
|
| BLAKE2b-256 |
1a29786ff852a44f1d1dd1513a1de5de9c4170cd1f4a7eeabf9efc19b9ec6528
|