From d8b601ab9a7b286179788d18ea6149705dce4c67 Mon Sep 17 00:00:00 2001 From: qing <1776177662@qq.com> Date: Sat, 15 Aug 2026 19:48:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(bot4cj/scripts):=2012=20=E4=B8=AA=20mtc=20?= =?UTF-8?q?DSL=20=E6=BA=90=E5=A3=B0=E6=98=8E=20Camera=E2=80=94=E2=80=94?= =?UTF-8?q?=E5=BD=95=E5=88=B6=E5=85=8D=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 动作脚本统一加入 Camera("cam0",640,480,30,8)(record_stand.py 已有), 编译产物自带 @Camera 块,pybot --record 直接可录,取代 v2 的 "注入式录制"变体方案。手写 .mt 保持不动(bot4cj 共享、美化格式)。 --- bot4cj/scripts/jump.py | 3 +++ bot4cj/scripts/left-hand.py | 3 +++ bot4cj/scripts/left-turn.py | 3 +++ bot4cj/scripts/lie-down.py | 3 +++ bot4cj/scripts/rght-hand.py | 3 +++ bot4cj/scripts/std.py | 3 +++ bot4cj/scripts/stdd.py | 3 +++ bot4cj/scripts/t0.py | 3 +++ bot4cj/scripts/tilt-b.py | 3 +++ bot4cj/scripts/tilt-f.py | 3 +++ bot4cj/scripts/tilt-l.py | 3 +++ bot4cj/scripts/tilt-r.py | 3 +++ 12 files changed, 36 insertions(+) diff --git a/bot4cj/scripts/jump.py b/bot4cj/scripts/jump.py index 75c143f..c116ac6 100644 --- a/bot4cj/scripts/jump.py +++ b/bot4cj/scripts/jump.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/left-hand.py b/bot4cj/scripts/left-hand.py index 562e805..d460b36 100644 --- a/bot4cj/scripts/left-hand.py +++ b/bot4cj/scripts/left-hand.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/left-turn.py b/bot4cj/scripts/left-turn.py index 25f0d56..2059564 100644 --- a/bot4cj/scripts/left-turn.py +++ b/bot4cj/scripts/left-turn.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/lie-down.py b/bot4cj/scripts/lie-down.py index 2c7677b..4662d48 100644 --- a/bot4cj/scripts/lie-down.py +++ b/bot4cj/scripts/lie-down.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/rght-hand.py b/bot4cj/scripts/rght-hand.py index f95026b..0a7555d 100644 --- a/bot4cj/scripts/rght-hand.py +++ b/bot4cj/scripts/rght-hand.py @@ -33,6 +33,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/std.py b/bot4cj/scripts/std.py index 81dda8f..2662933 100644 --- a/bot4cj/scripts/std.py +++ b/bot4cj/scripts/std.py @@ -37,6 +37,9 @@ Servo("s8", -180, 0, 0, "pca9685-0", 7) # rf1 Servo("s9", 180, 0, 0, "pca9685-0", 8) # cam0 Servo("s10", 180, 0, 0, "pca9685-0", 9) # cam1 +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + # stand:10ms(一个栅格步)内到位并保持;首行即目标值,无爬升 SetTo("s1", 45, 10) SetTo("s2", 0, 10) diff --git a/bot4cj/scripts/stdd.py b/bot4cj/scripts/stdd.py index d7f382e..81f65e8 100644 --- a/bot4cj/scripts/stdd.py +++ b/bot4cj/scripts/stdd.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/t0.py b/bot4cj/scripts/t0.py index 8c8ada7..3dc48ca 100644 --- a/bot4cj/scripts/t0.py +++ b/bot4cj/scripts/t0.py @@ -26,6 +26,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/tilt-b.py b/bot4cj/scripts/tilt-b.py index 868775e..dfc26b6 100644 --- a/bot4cj/scripts/tilt-b.py +++ b/bot4cj/scripts/tilt-b.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/tilt-f.py b/bot4cj/scripts/tilt-f.py index a35140a..4332dc2 100644 --- a/bot4cj/scripts/tilt-f.py +++ b/bot4cj/scripts/tilt-f.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/tilt-l.py b/bot4cj/scripts/tilt-l.py index 00f3bab..aa73420 100644 --- a/bot4cj/scripts/tilt-l.py +++ b/bot4cj/scripts/tilt-l.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10): diff --git a/bot4cj/scripts/tilt-r.py b/bot4cj/scripts/tilt-r.py index 4f92a57..505595c 100644 --- a/bot4cj/scripts/tilt-r.py +++ b/bot4cj/scripts/tilt-r.py @@ -32,6 +32,9 @@ _SERVOS = [("s1", 90, 0), # rb0 for _name, _max, _ch in _SERVOS: Servo(_name, _max, 0, 0, "pca9685-0", _ch) +# 录制源(pybot --record 需要 @Camera 块) +Camera("cam0", 640, 480, 30, 8) + _STAND = [45, 0, 45, 0, 45, 0, 45, 0, 90, 90] def stand(dur=10):