From 2b84a9d541a7a0b391a6f07bd0c0acfdac95d5e6 Mon Sep 17 00:00:00 2001 From: sladro Date: Sat, 13 Sep 2025 15:01:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=BF=E7=9C=9F=E8=BF=AD=E4=BB=A3=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E8=AE=A9=E6=8E=A7=E5=88=B6=E5=99=A8=E5=85=85=E5=88=86?= =?UTF-8?q?=E6=94=B6=E6=95=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- debug_execution.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debug_execution.py b/debug_execution.py index 8edc4f9..8da6eca 100644 --- a/debug_execution.py +++ b/debug_execution.py @@ -117,8 +117,9 @@ def debug_path_execution(): # 设置插值位置 arm_controller.set_joint_positions(interpolated.tolist()) - # 执行仿真步进(关键修复:让PyBullet执行控制命令) - p.stepSimulation(physicsClientId=physics_client) + # 执行多次仿真步进让控制器充分收敛 + for _ in range(10): + p.stepSimulation(physicsClientId=physics_client) # 等待timestep时间(和主程序相同) time.sleep(timestep) @@ -150,7 +151,8 @@ def debug_path_execution(): break # 执行仿真步进让机械臂继续收敛 - p.stepSimulation(physicsClientId=physics_client) + for _ in range(10): + p.stepSimulation(physicsClientId=physics_client) time.sleep(timestep) # 记录最终实际位置