Skip to content

Commit 02bc095

Browse files
author
Robomation
committed
robomation 파이썬 패키지 0.1.0 개발
* 공통 - Utils * 로봇 - HamsterS / Hamster / Pio / Turtle / Beagle / RaccoonBot / CheeseStick * AI 확장모듈 - ASR / Camera / FaceDetection / DetailedFaceDetection / FaceExpression / HandDetection / BodyDetection / ObjectDetection / ColorDetection / ArucoMarker / SelfDriving * 치즈스틱 확장모듈 - CSD01 / CSD02 / CSD03 / CSD07 / CSD09 / CSD10 / HAT010 / HAT022 / PID10 / PID13 / PID26 / NeoPixel
1 parent 77f5f16 commit 02bc095

75 files changed

Lines changed: 20512 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/publish.yml‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags: ['v*'] # v로 시작하는 태그가 push되면 실행
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0 # setuptools-scm 가 태그를 읽으려면 전체 히스토리 필요
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.x'
17+
- name: Build sdist & wheel
18+
run: |
19+
python -m pip install --upgrade build
20+
python -m build
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: dist
24+
path: dist/
25+
26+
publish:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
environment: pypi # PyPI Trusted Publishing 설정과 일치
30+
permissions:
31+
id-token: write # OIDC 토큰 발급 — 필수 (이게 토큰 대체)
32+
steps:
33+
- uses: actions/download-artifact@v4
34+
with:
35+
name: dist
36+
path: dist/
37+
- uses: pypa/gh-action-pypi-publish@release/v1

‎.gitignore‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# --- Python 빌드 및 패키지 ---
2+
# 가상환경
3+
venv/
4+
.venv/
5+
env/
6+
ENV/
7+
8+
# 빌드 및 배포 결과물
9+
build/
10+
dist/
11+
*.egg-info/
12+
13+
# 캐시 파일
14+
__pycache__/
15+
*.pyc
16+
17+
# --- 테스트 및 Coverage ---
18+
htmlcov/
19+
.tox/
20+
.coverage
21+
.coverage.*
22+
.cache
23+
nosetests.xml
24+
coverage.xml
25+
*.cover
26+
.hypothesis/
27+
28+
# --- IDE 설정 (VS Code, PyCharm 등) ---
29+
.vscode/
30+
.idea/
31+
*.swp
32+
*.swo
33+
34+
# --- 기타 ---
35+
.DS_Store
36+
.env
37+
.pytest_cache/
38+
39+
.claude/
40+
.playwright-mcp/
41+
42+
RELEASING.md

‎LICENSE‎

Lines changed: 501 additions & 0 deletions
Large diffs are not rendered by default.

‎MANIFEST.in‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md
2+
include LICENSE
3+
include robomation/py.typed

‎README.md‎

Lines changed: 147 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,147 @@
1-
# Robomation_Python
2-
Python library for Robomation robots and AI extensions
1+
# robomation
2+
3+
<p>
4+
<a href="https://pypi.org/project/robomation/"><img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python versions"></a>
5+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-LGPL--2.1--or--later-blue.svg" alt="License"></a>
6+
</p>
7+
8+
로보메이션(Robomation) 로봇과 AI 확장모듈을 위한 파이썬 패키지입니다.
9+
햄스터 S, 햄스터, 삐오봇, 터틀, Beagle, 라쿤봇, 치즈스틱 등 로보메이션 로봇을 파이썬 코드로 제어하고,
10+
카메라·마이크 기반의 AI 인식 기능(얼굴/손/몸/사물/색깔/마커 인식, 음성 인식, 자율주행)을 손쉽게 사용할 수 있습니다.
11+
12+
Windows / macOS / Chromebook 어느 환경에서든, VSCode 같은 파이썬 환경에서 바로 동작합니다.
13+
14+
<br>
15+
16+
## 설치
17+
18+
```bash
19+
pip install -U robomation
20+
```
21+
22+
<br>
23+
24+
### 요구 사항
25+
26+
- Python 3.9 이상
27+
- 로봇 사용 시: USB 동글 또는 시리얼 연결
28+
- AI 모듈 사용 시: 카메라 / 마이크, 그리고 OS의 카메라·마이크 권한 허용
29+
30+
<br>
31+
32+
주요 의존성(`pip install -U robomation` 시 자동 설치됩니다):
33+
`pyserial`, `numpy`, `opencv-contrib-python`, `mediapipe`, `SpeechRecognition`, `sounddevice` (Windows는 `pygrabber` 추가).
34+
35+
<br>
36+
37+
## 지원 라이브러리
38+
39+
### 공통
40+
41+
| 모듈 | 설명 |
42+
|---|---|
43+
| Utils | 유틸리티 |
44+
45+
### 로봇
46+
47+
| 모듈 | 설명 |
48+
|---|---|
49+
| HamsterS | 햄스터 S |
50+
| Hamster | 햄스터 |
51+
| Pio | 삐오봇 |
52+
| Turtle | 터틀 |
53+
| Beagle | 비글 |
54+
| RaccoonBot | 라쿤봇 |
55+
| CheeseStick | 치즈스틱 |
56+
57+
### AI 확장모듈
58+
59+
| 모듈 | 설명 |
60+
|---|---|
61+
| ASR | 음성 인식 |
62+
| FaceDetection | 얼굴 찾기 |
63+
| DetailedFaceDetection | 상세하게 얼굴 찾기 |
64+
| FaceExpression | 나이, 성별, 표정 |
65+
| HandDetection | 손 찾기 |
66+
| BodyDetection | 몸 찾기 |
67+
| ObjectDetection | 사물 인식 찾기 |
68+
| ColorDetection | 색깔 찾기 |
69+
| ArucoMarker | ArUco 마커 찾기 |
70+
| SelfDriving | 카메라 자율주행하기 |
71+
72+
### 치즈스틱 확장모듈
73+
74+
| 모듈 | 설명 |
75+
|---|---|
76+
| CSD01 | 스위치 |
77+
| CSD02 | RGB LED |
78+
| CSD03 | 로터리 퍼텐쇼미터 |
79+
| CSD07 | 소리 센서 |
80+
| CSD09 | 모터 |
81+
| CSD10 | 조도 센서 |
82+
| NeoPixel | 네오픽셀 |
83+
| HAT010 | HAT-010 5x5 매트릭스 |
84+
| HAT022 | HAT-022 터치 피아노 |
85+
| PID13 | PID-13 조이스틱과 버튼 |
86+
| PID26 | PID-26 환경 센서 |
87+
88+
<br>
89+
90+
## 사용법 (Usage)
91+
92+
### 로봇 제어
93+
94+
```python
95+
from robomation import *
96+
97+
hamster_s = HamsterS()
98+
hamster_s.set_wheel_speed('both', 30)
99+
```
100+
101+
### AI 확장 모듈 — 얼굴 인식
102+
103+
```python
104+
from robomation import *
105+
106+
face_detection = FaceDetection(0)
107+
face_detection.device(0)
108+
face_detection.load_model()
109+
face_detection.detect_continuous()
110+
111+
while True:
112+
if face_detection.detected():
113+
print(face_detection.face('x'), face_detection.face('y'))
114+
Utils.wait(0.1)
115+
```
116+
117+
### 치즈스틱 확장 모듈 - 네오픽셀
118+
119+
```python
120+
from robomation import *
121+
122+
cheesestick = CheeseStick()
123+
neopixel = cheesestick.NeoPixel()
124+
125+
neopixel.set_range_pattern(1, 1, '3_colors')
126+
```
127+
<br>
128+
129+
## 참고 사항 (Notes)
130+
131+
- 카메라/마이크는 OS 권한 허용이 필요합니다.
132+
133+
<br>
134+
135+
## 문서 (Documentation)
136+
137+
자세한 사용법과 예제는 [Github Wiki](https://github.com/RobomationLAB/Robomation_Python/wiki)에서 확인할 수 있습니다.
138+
139+
<br>
140+
141+
## 라이선스 (License)
142+
143+
본 라이브러리는 **GNU Lesser General Public License v2.1 이상**(LGPL-2.1-or-later) 하에 배포됩니다.
144+
자세한 내용은 [LICENSE](LICENSE) 파일을 참고하세요.
145+
146+
Copyright (c) 2016 Kwang-Hyun Park.
147+
Copyright (c) 2026 Robomation.

‎pyproject.toml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[build-system]
2+
requires = ["setuptools>=77.0", "setuptools-scm>=8", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "robomation"
7+
dynamic = ["version"]
8+
description = "Python library for Robomation robots and AI extensions"
9+
readme = { file = "README.md", content-type = "text/markdown" }
10+
requires-python = ">=3.9"
11+
license = "LGPL-2.1-or-later"
12+
license-files = ["LICENSE"]
13+
authors = [
14+
{ name = "Robomation", email = "info@robomation.co.kr" },
15+
]
16+
maintainers = [
17+
{ name = "Jiwoo Jeong", email = "jwjeong@robomation.co.kr" },
18+
]
19+
keywords = ["robomation", "roboid", "robot", "education", "ai", "coding"]
20+
classifiers = [
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3 :: Only",
23+
"Operating System :: OS Independent",
24+
"Topic :: Education",
25+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
26+
"Intended Audience :: Education",
27+
"Intended Audience :: Developers",
28+
]
29+
dependencies = [
30+
"pyserial", # core: serial connector
31+
"SpeechRecognition", # ai: ASR
32+
"sounddevice", # ai: microphone capture
33+
"numpy", # ai / core
34+
"opencv-contrib-python", # ai: camera + vision
35+
"mediapipe", # ai: detection models
36+
"matplotlib", # core: Utils.scope oscilloscope (_internal/_scope.py)
37+
"pynput", # core: Utils.keypressed (core/keyboard.py)
38+
'pygrabber; sys_platform == "win32"',
39+
]
40+
41+
[project.urls]
42+
Homepage = "https://robomation.net"
43+
Repository = "https://github.com/RobomationLAB/Robomation_Python"
44+
Documentation = "https://github.com/RobomationLAB/Robomation_Python/wiki"
45+
46+
[tool.setuptools.packages.find]
47+
48+
[tool.setuptools.package-data]
49+
"robomation" = ["py.typed"]
50+
51+
[tool.setuptools_scm]
52+
fallback_version = "0.1.0"
53+
local_scheme = "no-local-version"

‎robomation/__init__.py‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Based on the ROBOID project - http://hamster.school
2+
# Copyright (c) 2016 Kwang-Hyun Park (akaii@kw.ac.kr)
3+
#
4+
# Modified by Robomation in 2026.
5+
# Copyright (c) 2026 Robomation
6+
#
7+
# This library is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU Lesser General Public
9+
# License as published by the Free Software Foundation; either
10+
# version 2.1 of the License, or (at your option) any later version.
11+
#
12+
# This library is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
# Lesser General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Lesser General
18+
# Public License along with this library; if not, write to the
19+
# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
# Boston, MA 02111-1307 USA
21+
22+
23+
import signal
24+
25+
from robomation.core.scanner import Scanner
26+
# from robomation.core.keyboard import Keyboard
27+
from robomation.core.utils import Utils
28+
from robomation.core.runner import Runner
29+
# from robomation.core.model import DeviceType, DataType
30+
from robomation.roboids import HamsterS, Hamster, Pio, Turtle, Beagle, RaccoonBot, CheeseStick
31+
from robomation.ai import ASR, FaceDetection, DetailedFaceDetection, FaceExpression, HandDetection, BodyDetection, ObjectDetection, ColorDetection, ArucoMarker, SelfDriving
32+
33+
__version__ = "0.1.0"
34+
# __author__ =
35+
# __email__ =
36+
37+
__all__ = [
38+
"Utils",
39+
"HamsterS", "Hamster", "Pio", "Turtle", "Beagle", "RaccoonBot", "CheeseStick",
40+
"ASR", "FaceDetection", "DetailedFaceDetection", "FaceExpression", "HandDetection", "BodyDetection", "ObjectDetection", "ColorDetection", "ArucoMarker", "SelfDriving",
41+
# "scan", "dispose", "set_executable", "when_do", "while_do",
42+
# "wait", "wait_until_ready", "wait_until", "parallel",
43+
# "DeviceType", "DataType",
44+
]
45+
46+
def _handle_signal(signal, frame):
47+
Runner.shutdown()
48+
raise SystemExit
49+
50+
signal.signal(signal.SIGINT, _handle_signal)
51+
52+
# def scan():
53+
# Scanner.scan()
54+
55+
# def dispose():
56+
# Runner.dispose_all()
57+
58+
# def set_executable(execute):
59+
# Runner.set_executable(execute)
60+
61+
# def wait(milliseconds):
62+
# Runner.wait(milliseconds)
63+
64+
# def wait_until_ready():
65+
# Runner.wait_until_ready()
66+
67+
# def wait_until(condition, args=None):
68+
# Runner.wait_until(condition, args)
69+
70+
# def when_do(condition, do, args=None):
71+
# Runner.when_do(condition, do, args)
72+
73+
# def while_do(condition, do, args=None):
74+
# Runner.while_do(condition, do, args)
75+
76+
# def parallel(*functions):
77+
# Runner.parallel(functions)

0 commit comments

Comments
 (0)