Skip to main content

An autonomous vehicle platform by Pathfinder

Project description

Findee ๐Ÿš—

PyPI version Python License: MIT Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

findee-0.0.4.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

findee-0.0.4-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for findee-0.0.4.tar.gz
Algorithm Hash digest
SHA256 262f32c3b58680fd793e2f99b513ca530c21e77a0ccca276381be437881102ee
MD5 2f14d74c10c615e6c8facc557af8d848
BLAKE2b-256 50153af88a94d86367aec9819bfd671b97d4bf4900e1d20cb19700f8b610e277

See more details on using hashes here.

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

Hashes for findee-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8246820c7d622c862566315093d0eb2db6b8ea50106cafefab674ebaecfd765f
MD5 a3666e7c4b805ded64094b2cadb9e93c
BLAKE2b-256 1a29786ff852a44f1d1dd1513a1de5de9c4170cd1f4a7eeabf9efc19b9ec6528

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page