exp+fix: 候选塌缩定案(steps=2 把K条候选抹平35倍)+z_scale反例;补 n_plans/brake_rate 核算§9.2刹停率;记录我在链式作业排队期间改库导致两臂未跑的事故
This commit is contained in:
@@ -204,6 +204,7 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
vratio = torch.zeros(B, device=device); aratio = torch.zeros(B, device=device); prev_exec = torch.zeros(B, 6, device=device)
|
||||
rev = torch.zeros(B, device=device); nact = torch.zeros(B, device=device); prev_sgn = torch.zeros(B, 6, device=device)
|
||||
nmov = torch.zeros(B, device=device)
|
||||
nplan = torch.zeros(B, device=device) # 每题规划次数 = 推理周期数(§9.2 的"刹停 <2% 推理周期"要这个分母)
|
||||
traj = [q.clone()] if return_traj else None
|
||||
plans = {k: [] for k in ('it', 'r', 'qe', 'commit', 'points', 'midpoints', 'gaps', 'certified')} if return_traj else None
|
||||
n_start = int(round(0.5 / DT)); moved_start = None # R2 起步失败:0.5 s 内关节总行程 < 1°
|
||||
@@ -216,6 +217,7 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
for it in range(nmax):
|
||||
tnow = it * DT
|
||||
if (queue.shape[1] <= 3) if replan == 'r3' else (queue.shape[1] == 0):
|
||||
nplan += 1.0 # 验收判据要"刹停 / 推理周期"的比值,分母就是这个(批内所有行同步规划)
|
||||
r = queue.shape[1]
|
||||
pre = torch.zeros(B, 3, 6, device=device)
|
||||
qe = q
|
||||
@@ -513,6 +515,7 @@ def rollout(model, kin, tasks, device, K=8, safety=False, seed=0, max_sec=None,
|
||||
side = torch.where(j1_first != 0, j1_first, torch.where(j1_max >= -j1_min, torch.ones_like(j1_max), -torch.ones_like(j1_max)))
|
||||
per = {'done': done.cpu(), 'ok': ok.cpu(), 't_done': t_done.cpu(), 'limit': limit.cpu(), 'col': col.cpu(), 'travel': travel.cpu(), 'err': e_end.cpu(),
|
||||
'side': side.cpu(), 'start_fail': start_fail.cpu(), 'brakes': brakes.cpu(), 'backoff': bo.cpu(), 'first_hit': first_hit.cpu(), 'dls_it': dls_it.cpu(),
|
||||
'n_plans': nplan.cpu(), 'brake_rate': (brakes / nplan.clamp_min(1.0)).cpu(),
|
||||
'goal_ratio_2s': ratio2.cpu(), 'speed_ratio': vratio.cpu(), 'accel_ratio': aratio.cpu(),
|
||||
# 口径与离线分解一致:换向的 (步,轴) 对数 / 活动的 (步,轴) 对数 ∈ [0,1](除以 6 个轴)
|
||||
'reverse_rate': (rev / (6.0 * nact.clamp_min(1.0))).cpu(),
|
||||
|
||||
Reference in New Issue
Block a user