Commit graph

13 commits

Author SHA1 Message Date
7931d42010 merge: fix hardcoded current_pos + add requirements.txt (closes #3, #4) 2026-02-20 20:45:27 +08:00
f631157887 merge: fix whisper broken start_recording (closes #2) 2026-02-20 20:45:23 +08:00
01313a1d94 merge: fix bare except + deque optimization (closes #1, #6) 2026-02-20 20:45:18 +08:00
9e672ce637 fix(voice_main): pass actual current_pos to execute_pick/execute_lift; add requirements.txt
- Closes #3: execute_pick and execute_lift now accept an optional
  current_pos parameter. Callers (execute_command) pass self.current_pos
  so move_line starts from the actual arm position rather than a hardcoded
  [120, 0, 60] default. Falls back to rest position when None.
- Closes #4: add requirements.txt with correct package names.
  Note: README listed 'openai-whisper' but the code imports faster_whisper;
  requirements.txt uses the correct 'faster-whisper' package name.
- Replace all `servo_buffer = []` assignments with `.clear()` to stay
  compatible with the deque introduced in PR #8 (#6 follow-up).
- Partial #5: translate Chinese print/comment strings to English in
  execute_pick, execute_lift, and execute_command.
2026-02-20 20:26:30 +08:00
6977061bef fix(whisper): remove broken start_recording; move scipy import to top-level
whisper_main.py:
- Remove RobotEar.start_recording() and record_callback() which called
  the nonexistent sd.start_stream() API (correct API is sd.InputStream).
  These methods were never called by voice_main.py and contained a broken
  sounddevice API call that would raise AttributeError (#2).
- Remove unused recording_buffer field
- Translate Chinese comment/docstring to English (#5)

voice_main.py:
- Move `import scipy.io.wavfile as wav` from inside get_audio_text()
  function body to module top-level where all imports belong (#4 related)
- Sort imports: stdlib before third-party, local last
- Remove Chinese comment, replace with English equivalent
2026-02-20 20:24:24 +08:00
f1df158d56 fix(arm_main): replace bare except with SerialException, use deque for servo_buffer
- Replace `except:` with `except serial.SerialException as e` to prevent
  silently swallowing KeyboardInterrupt and other system exceptions (#1)
- Replace list + pop(0) with collections.deque(maxlen=N) for O(1) buffer
  management; removes manual length check in _send_and_audit (#6)
- Rebuild deque in set_damping_params when buffer_size changes
- Translate all Chinese log messages and comments to English (#5)
- Minor: sort imports (stdlib before third-party)
2026-02-20 20:22:12 +08:00
whisper11111111111
a7209c4f78 Optimize project introduction in README 2026-02-11 00:16:49 +08:00
whisper11111111111
0e7d692784 Add BOM list and cost summary 2026-02-11 00:11:53 +08:00
whisper11111111111
e7278edeb4 Enhance README with project overview and keywords 2026-02-10 23:56:33 +08:00
whisper11111111111
c7828ea914 Add main.ino firmware and update docs 2026-02-10 23:52:15 +08:00
whisper11111111111
865957604d Set replication guide as README.md 2026-02-10 23:43:48 +08:00
whisper11111111111
eaa8b9a132 Add usage manual and replication guide 2026-02-10 23:41:06 +08:00
whisper11111111111
bb85c3266b Initial commit for robot arm voice control system 2026-02-10 23:31:14 +08:00