diff --git a/config/compound_eye.png b/config/compound_eye.png index 74970b0..a7240e2 100644 Binary files a/config/compound_eye.png and b/config/compound_eye.png differ diff --git a/gripper_control_02/README.md b/gripper_control_02/README.md index 47b2b39..61ddd82 100644 --- a/gripper_control_02/README.md +++ b/gripper_control_02/README.md @@ -14,8 +14,8 @@ 8. 自适应补力停止并稳定 `RELEASE_ARM_DELAY_SECONDS` 后,重新记录释放参考力,才开始检测人取物松开。 9. 后续法向力或切向力变化超过阈值,夹爪直接张开到 `OPEN_POS`。 10. 张开后进入 `open_recover`,保持张开并等待恢复条件。 -11. 夹爪回到 `OPEN_POS` 初始点位,或法向/切向读数都低于恢复阈值并稳定后,回到 `open_wait`。 -12. 回到 `open_wait` 后,如果是因为夹爪已回到 `OPEN_POS`,会直接重新武装;程序只响应下一次新的触发上升沿,残余力保持不变时不会自动闭合。 +11. 夹爪回到 `OPEN_POS` 初始点位,或法向/切向读数都低于恢复阈值并稳定后,继续休息至少 `REARM_SECONDS`。 +12. 休息结束后才回到 `open_wait` 并重新武装;休息期间不管有没有物体扫过,都不会闭合。 ## 运行 @@ -81,7 +81,7 @@ gripper_control_02\config\gripper_demo_02.py - `RELEASE_OPEN_SPEED`: 检测到松开后,张开到 `OPEN_POS` 使用的速度。 - `RELEASE_OPEN_ACCEL`: release 张开的加速度。 - `RELEASE_OPEN_DECEL`: release 张开的减速度。 -- `REARM_SECONDS`: 张开后最短等待时间,防止刚松开马上又误触发。 +- `REARM_SECONDS`: 夹爪回到 `OPEN_POS` 或恢复条件成立后,至少休息多久才重新等待触发;休息期间扫过也不会闭合。 - `RECOVER_NORMAL_FORCE`: 张开恢复时允许重新触发的最大法向残余力。 - `RECOVER_SHEAR_FORCE`: 张开恢复时允许重新触发的最大切向残余力。 - `RECOVER_STABLE_SECONDS`: 力清空后需要连续稳定多久,才重新等待触发。 @@ -134,11 +134,11 @@ gripper_control_02\config\gripper_demo_02.py - `release-arm-delay`: 补力刚停止,正在等待力稳定,暂时不触发松开。 - `release-reference-armed`: 已重新记录释放参考力,后续法向/切向变化会触发张开。 - `open-recover-position`: 夹爪当前位置已经接近 `OPEN_POS`,正在等待到位稳定。 -- `open-ready-position`: 夹爪已经回到初始点位,重新进入等待下一次扫过触发;此时会直接武装,但残余触发保持不变不会自动闭合。 +- `open-ready-position`: 夹爪已经回到初始点位,并且休息时间结束,重新进入等待下一次扫过触发;此时会直接武装,但残余触发保持不变不会自动闭合。 - `open-wait-clear-trigger`: 已经回到等待状态,但当前力还超过触发阈值,暂时不会闭合。 - `open-wait-trigger-clearing`: 触发力已经低于阈值,正在等待清零稳定时间。 - `open-wait-armed`: 触发已经清掉并稳定,下一次扫过可以闭合。 - `open-wait-trigger-held`: 已经武装,但当前触发不是新上升沿,等待力先降下去再下一次扫过。 - `open-recover-wait-force-clear`: 夹爪保持张开,但传感器还有残余力,不允许重新闭合。 -- `open-recover-stabilizing`: 力已经低于恢复阈值,正在等待稳定时间。 -- `open-ready`: 力已经清空并稳定,重新进入等待下一次扫过触发。 +- `open-recover-stabilizing`: 力已经低于恢复阈值,正在等待稳定和休息时间结束。 +- `open-ready`: 力已经清空并稳定,并且休息时间结束,重新进入等待下一次扫过触发。 diff --git a/gripper_control_02/__pycache__/controller.cpython-311.pyc b/gripper_control_02/__pycache__/controller.cpython-311.pyc index 4c0d7d4..724f042 100644 Binary files a/gripper_control_02/__pycache__/controller.cpython-311.pyc and b/gripper_control_02/__pycache__/controller.cpython-311.pyc differ diff --git a/gripper_control_02/__pycache__/controller.cpython-313.pyc b/gripper_control_02/__pycache__/controller.cpython-313.pyc index f30f5f5..bb75513 100644 Binary files a/gripper_control_02/__pycache__/controller.cpython-313.pyc and b/gripper_control_02/__pycache__/controller.cpython-313.pyc differ diff --git a/gripper_control_02/__pycache__/settings.cpython-311.pyc b/gripper_control_02/__pycache__/settings.cpython-311.pyc index 966bc6c..e58f8a0 100644 Binary files a/gripper_control_02/__pycache__/settings.cpython-311.pyc and b/gripper_control_02/__pycache__/settings.cpython-311.pyc differ diff --git a/gripper_control_02/__pycache__/settings.cpython-313.pyc b/gripper_control_02/__pycache__/settings.cpython-313.pyc index 63dbe21..9b1ad90 100644 Binary files a/gripper_control_02/__pycache__/settings.cpython-313.pyc and b/gripper_control_02/__pycache__/settings.cpython-313.pyc differ diff --git a/gripper_control_02/__pycache__/visualizer.cpython-311.pyc b/gripper_control_02/__pycache__/visualizer.cpython-311.pyc index 76182a5..c602aa4 100644 Binary files a/gripper_control_02/__pycache__/visualizer.cpython-311.pyc and b/gripper_control_02/__pycache__/visualizer.cpython-311.pyc differ diff --git a/gripper_control_02/__pycache__/visualizer.cpython-313.pyc b/gripper_control_02/__pycache__/visualizer.cpython-313.pyc index 28510da..fe49cd3 100644 Binary files a/gripper_control_02/__pycache__/visualizer.cpython-313.pyc and b/gripper_control_02/__pycache__/visualizer.cpython-313.pyc differ diff --git a/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-311.pyc b/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-311.pyc index 50a258d..6b1c886 100644 Binary files a/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-311.pyc and b/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-311.pyc differ diff --git a/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-313.pyc b/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-313.pyc index 237027a..b08cb11 100644 Binary files a/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-313.pyc and b/gripper_control_02/config/__pycache__/gripper_demo_02.cpython-313.pyc differ diff --git a/gripper_control_02/config/gripper_demo_02.py b/gripper_control_02/config/gripper_demo_02.py index 551cb0e..b6f2268 100644 --- a/gripper_control_02/config/gripper_demo_02.py +++ b/gripper_control_02/config/gripper_demo_02.py @@ -54,7 +54,7 @@ CLOSE_FORCE = 15 # 单侧触发后闭合时使用的小力。 GRIP_START_FORCE = 10 # 闭合检测到物体后,先切到这个低力保持。 HOLD_FORCE = 15 # 基础夹持力;轻物体默认慢慢加到这个力。 FORCE_MIN = 10 -FORCE_MAX = 60 # 允许自适应加力的最大总上限;重物夹不住时可以适当加大。 +FORCE_MAX = 80 # 允许自适应加力的最大总上限;重物夹不住时可以适当加大。 # 控制循环频率。越高检测释放越快。 @@ -101,7 +101,8 @@ RELEASE_ARM_DELAY_SECONDS = 0.8 # 自适应加力停止后,等待这么久 RELEASE_NORMAL_CHANGE = 0.2 # 左/右法向力相对夹住参考值的变化阈值,单位 N。 RELEASE_SHEAR_CHANGE = 0.2 # 左/右切向力相对夹住参考值的变化阈值,单位 N。 -# 松开后至少等待多久重新进入等待触发,避免刚张开时马上再次触发。 +# 张开到位或恢复条件成立后,至少休息多久才重新进入等待触发。 +# 休息期间即使有物体扫过,也不会触发闭合。 REARM_SECONDS = 0.5 # 松开/超时张开后,必须等传感器读数低于这些阈值并稳定,才允许下一次触发。 diff --git a/gripper_control_02/controller.py b/gripper_control_02/controller.py index 0715e6d..f3c4e20 100644 --- a/gripper_control_02/controller.py +++ b/gripper_control_02/controller.py @@ -342,8 +342,10 @@ class SideTriggerGripController: action = f"open-recover-position pos={current_pos}" elif ( now - recover_position_since - >= config.open_position_stable_seconds - and now - state_start >= config.rearm_seconds + >= max( + config.open_position_stable_seconds, + config.rearm_seconds, + ) ): state = "open_wait" state_start = now @@ -364,8 +366,8 @@ class SideTriggerGripController: recover_quiet_since = now action = "open-recover-quiet" elif ( - now - recover_quiet_since >= config.recover_stable_seconds - and now - state_start >= config.rearm_seconds + now - recover_quiet_since + >= max(config.recover_stable_seconds, config.rearm_seconds) ): state = "open_wait" state_start = now diff --git a/gripper_control_02/visualizer.py b/gripper_control_02/visualizer.py index cec6112..68d12b3 100644 --- a/gripper_control_02/visualizer.py +++ b/gripper_control_02/visualizer.py @@ -299,7 +299,7 @@ class GripperDemo02Viewer(QMainWindow): self.force_pct_box = MetricBox("force_pct", "--") self.target_force_box = MetricBox("目标力", "--") self.speed_box = MetricBox("速度", "--") - self.trigger_box = MetricBox("触发/武装", "--") + self.trigger_box = MetricBox("是否触发/系统是否允许触发", "--") self.contact_box = MetricBox("接触", "--") self.release_box = MetricBox("释放检测", "--") boxes = [