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๋ฅผ ์ด์šฉํ•ด์ฃผ์„ธ์š”.

๐Ÿ“„ ๋ผ์ด์„ ์Šค

์ด ํ”„๋กœ์ ํŠธ๋Š” MIT ๋ผ์ด์„ ์Šค๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ LICENSE ํŒŒ์ผ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๐Ÿ‘ฅ ์ œ์ž‘์ž

  • Pathfinder - ์ดˆ๊ธฐ ๊ฐœ๋ฐœ - 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.5.tar.gz (8.4 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.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file findee-0.0.5.tar.gz.

File metadata

  • Download URL: findee-0.0.5.tar.gz
  • Upload date:
  • Size: 8.4 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.5.tar.gz
Algorithm Hash digest
SHA256 1f2dc3aa6cf22419e481fa1e9442e096f8e9ce8c4a5dde298c612fd09fe8dbcf
MD5 b9051ef31c290354c56216959756df76
BLAKE2b-256 fadd713a5f983e23c759138ddd4f6aadbab902f45d4a3197b767dfc507bf79cc

See more details on using hashes here.

File details

Details for the file findee-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: findee-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1945b0a1c2cfba08e7cd030e03af8d0994670360f948ab3c7fcbbe639cce347c
MD5 64ddb23dbb4345f20ee45f053475916a
BLAKE2b-256 6de00c51b71cf4ba0b6141d75819098b43b34410afd8bb955aa173f078b362e6

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