i7 ep500/700 checkpoints, flat-start patch
Browse filesFiles changed (7)
- str-rl-policy/ring_2026-12-01_5080/ckpt/SHA256SUMS_i7Added+2
- str-rl-policy/ring_2026-12-01_5080/ckpt/wc_clr_i7_5080_ep500.pthAdded+3
- str-rl-policy/ring_2026-12-01_5080/ckpt/wc_clr_i7_5080_ep700.pthAdded+3
- str-rl-policy/ring_2026-12-01_5080/code/0001-0002-axial-flat-start.patchAdded+510
- str-rl-policy/ring_2026-12-01_5080/code/launch_clr_i7_5080.sh+9-3
- str-rl-policy/ring_2026-12-01_5080/code/launch_clr_i8_5080.shAdded+28
- str-rl-policy/ring_2026-12-01_5080/code/uncommitted_head_penalty_prelift.patchAdded+78
123e731b45fbb9659993198a07103363c0a4b9360998d7bb0661d19105fec54df5 wc_clr_i7_5080_ep500.pth572ebde500a6c337616dec5360af98dfa5304db008b069892ebc38995bf1cac6 wc_clr_i7_5080_ep700.pth123version https://git-lfs.github.com/spec/v1oid sha256:3e731b45fbb9659993198a07103363c0a4b9360998d7bb0661d19105fec54df5size 130156019123version https://git-lfs.github.com/spec/v1oid sha256:572ebde500a6c337616dec5360af98dfa5304db008b069892ebc38995bf1cac6size 130155955123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510From 294421b2c02010bb5f5f26822b240d9c4f487493 Mon Sep 17 00:00:00 2001From: Chanyoung Ahn <ahn205@purdue.edu>Date: Tue, 1 Dec 2026 00:51:39 -0500Subject: [PATCH 1/2] Fixed tolerance schedule, linear checkpoint saves, axial grasp-position terms and eval diagnostics
- termination.tolerance_schedule=fixed: tolerance = start x increment^(frames // interval), floored at the target; independent of the success signal (default "success" keeps the old curriculum).- rl_games save_linear: save every save_frequency epochs (default keeps the perfect-square schedule).- reward.axial_band_rew_scale / axial_slip_penalty_scale (default 0): palm centre in the 30-70 % band of the handle length from the head end, penalty on axial slip speed while held (reward_utils.palm_from_head_end).- eval_hand_contact.py grasp_position_diag: band share, first-grasp position, shares within 3 / 4.5 cm of the head end and past it, axial slip events (> 2 cm in 0.5 s), per handle-length bin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Claude-Session: https://claude.ai/code/session_01RLSVK2nwbnDdBsyTT5Ykv3--- .../simtoolreal_tesollo_env_cfg.py | 17 +++ .../tasks/simtoolreal/utils/reward_utils.py | 66 ++++++++ .../simtoolreal/utils/termination_utils.py | 12 +- isaacsimenvs/tools/eval_hand_contact.py | 142 ++++++++++++++++++ rl_games/rl_games/common/a2c_common.py | 4 +- 5 files changed, 239 insertions(+), 2 deletions(-)
diff --git a/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py b/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.pyindex afd58d8..57d7152 100644--- a/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py+++ b/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py@@ -1148,6 +1148,18 @@ class RewardCfg: dorsal_penalty_scale: float = 0.0 # fingers the dorsal-contact penalty is averaged over (fingertip order); () = wrap_fingers. dorsal_penalty_fingers: tuple = ()+ # Axial grasp position (2026-12-01, reward_utils.palm_from_head_end): while held, axial_band_rew_scale per step x+ # clamp(1 - m_out / axial_band_ramp_m, 0, 1), m_out = metres of the palm centre outside the band+ # [max(axial_band[0] x L, axial_band_min_m), axial_band[1] x L] measured from the head-side end of the handle+ # (L = handle length). axial_slip_penalty_scale: per step x |d(palm from head)/dt| [m/s] while held on+ # consecutive steps (capped at axial_slip_speed_cap). axial_metrics logs the terms without paying. 0 = off.+ axial_band_rew_scale: float = 0.0+ axial_band: tuple = (0.3, 0.7)+ axial_band_min_m: float = 0.0+ axial_band_ramp_m: float = 0.03+ axial_slip_penalty_scale: float = 0.0+ axial_slip_speed_cap: float = 0.5+ axial_metrics: bool = False seat_rew_scale: float = 0.0 seat_sigma: float = 0.02 seat_points_use_min: bool = False@@ -1460,6 +1472,11 @@ class TerminationCfg: tolerance_curriculum_increment: float = 0.9 # multiplicative per step tolerance_curriculum_interval: int = 3000 # env steps across all agents tolerance_curriculum_success_threshold: float = 3.0+ # "success": the curriculum above (steps when completed episodes reach the threshold). "fixed": tolerance =+ # success_tolerance x tolerance_curriculum_increment^k after k x tolerance_schedule_interval env steps+ # (horizon 16 -> one epoch = 16 env steps), floored at target_success_tolerance; no success signal.+ tolerance_schedule: str = "success"+ tolerance_schedule_interval: int = 4800 # ----------------------------------------------------------------------------diff --git a/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.py b/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.pyindex bb4187a..09757b4 100644--- a/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.py+++ b/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.py@@ -616,6 +616,33 @@ def _init_handle_align(env) -> bool: return True +def palm_from_head_end(env):+ """Palm centre (palm body + robot.palm_center_offset) projected on the handle axis, as the distance [m] from+ the head-side end of the handle (negative = past the end, on the head). Returns (from_head (N,),+ handle length (N,), has_head (N,) bool). Head = the largest primitive other than the handle (as in+ tools/eval_hand_contact.py); needs _init_handle_align(env)."""+ if not hasattr(env, "_handle_head_sign"):+ half = env._obj_prim_half+ a_idx = torch.arange(half.shape[0], device=half.device)+ ext = half.max(dim=-1).values.clone()+ ext[a_idx, env._handle_prim_idx] = -1.0+ op = ext.argmax(dim=-1)+ env._handle_has_head = ext[a_idx, op] > 0.0+ d = ((env._obj_prim_center[a_idx, op] - env._handle_centre_obj) * env._handle_axis_obj).sum(dim=-1)+ env._handle_head_sign = torch.where(env._handle_has_head & (d.abs() > 1e-6), torch.sign(d), torch.ones_like(d))+ idx = env._object_asset_index_per_env+ oq = env.object.data.root_quat_w+ u = quat_apply(oq, env._handle_axis_obj[idx])+ centre = env.object.data.root_pos_w + quat_apply(oq, env._handle_centre_obj[idx])+ palm = env.robot.data.body_state_w[:, env._palm_body_id]+ n = palm.shape[0]+ off = torch.as_tensor(env._palm_center_offset, device=palm.device, dtype=palm.dtype).reshape(1, 3).expand(n, 3)+ pc = palm[:, 0:3] + quat_apply(palm[:, 3:7], off)+ length = 2.0 * env._handle_half_len[idx]+ from_head = 0.5 * length - ((pc - centre) * u).sum(dim=-1) * env._handle_head_sign[idx]+ return from_head, length, env._handle_has_head[idx]++ def handle_seat_distance(env, seat_points) -> torch.Tensor: """(N, K) distance [m] from each seat point (palm body frame, robot.palm_body_name) to the handle axis segment. @@ -1262,6 +1289,45 @@ def compute_rewards(env) -> torch.Tensor: if env._pad_thumb_col >= 0: extra_terms["thumb_touch_steps"] = in_contact[:, env._pad_thumb_col].float() * held.float() + # Axial grasp position + axial slip (2026-12-01; real robot: i3 ep625 grasps ~2.6 cm from the head end and the+ # tool slides along the handle). Off unless reward.axial_band_rew_scale / axial_slip_penalty_scale > 0.+ ab_s = float(getattr(rew_cfg, "axial_band_rew_scale", 0.0))+ as_s = float(getattr(rew_cfg, "axial_slip_penalty_scale", 0.0))+ if (ab_s > 0.0 or as_s > 0.0 or getattr(rew_cfg, "axial_metrics", False)) and _init_handle_align(env):+ fh, length, has_head = palm_from_head_end(env)+ if lift_pair is not None:+ held_ax = (lift_z - held_ref) > rew_cfg.finger_engage_min_lift+ else:+ held_ax = env._lifted_object.bool()+ held_ax = held_ax & has_head+ lo_m = torch.maximum(float(rew_cfg.axial_band[0]) * length,+ torch.full_like(length, float(getattr(rew_cfg, "axial_band_min_m", 0.0))))+ hi_m = torch.maximum(float(rew_cfg.axial_band[1]) * length, lo_m)+ out_m = (lo_m - fh).clamp(min=0.0) + (fh - hi_m).clamp(min=0.0) # metres outside the band+ band_score = (1.0 - out_m / max(float(rew_cfg.axial_band_ramp_m), 1e-6)).clamp(0.0, 1.0)+ band_rew = ab_s * band_score * held_ax.float()+ if not hasattr(env, "_axial_prev_fh"):+ env._axial_prev_fh = fh.clone()+ env._axial_prev_held = torch.zeros_like(held_ax)+ both = held_ax & env._axial_prev_held+ axial_speed = (fh - env._axial_prev_fh).abs() / float(env.step_dt) * both.float() # m/s along the handle+ slip_pen = -as_s * axial_speed.clamp(max=float(getattr(rew_cfg, "axial_slip_speed_cap", 0.5)))+ env._axial_prev_fh = fh.clone()+ env._axial_prev_held = held_ax.clone()+ reward = reward + band_rew + slip_pen+ hf = held_ax.float()+ frac = fh / length.clamp(min=1e-6)+ extra_terms.update({+ "axial_band_rew": band_rew,+ "axial_slip_pen": slip_pen,+ "axial_from_head_held": fh * hf,+ "axial_band_steps": ((frac >= rew_cfg.axial_band[0]) & (frac <= rew_cfg.axial_band[1])).float() * hf,+ "axial_within_4p5cm_steps": (fh < 0.045).float() * hf,+ "axial_past_head_steps": (fh < 0.0).float() * hf,+ "axial_speed_held": axial_speed,+ "axial_held_steps": hf,+ })+ env._reward_terms = { "fingertip_delta_rew": ft_rew, "lifting_rew": lift_rew,diff --git a/isaacsimenvs/tasks/simtoolreal/utils/termination_utils.py b/isaacsimenvs/tasks/simtoolreal/utils/termination_utils.pyindex d42ab58..3635bc0 100644--- a/isaacsimenvs/tasks/simtoolreal/utils/termination_utils.py+++ b/isaacsimenvs/tasks/simtoolreal/utils/termination_utils.py@@ -40,7 +40,17 @@ def update_tolerance_curriculum(env) -> None: env._frame_counter += 1 term = env.cfg.termination rot_curriculum_active = update_goal_rot_curriculum(env)- if (not rot_curriculum_active+ if getattr(term, "tolerance_schedule", "success") == "fixed":+ # Fixed schedule: tol = start x increment^k, k = frames // tolerance_schedule_interval, floored at the+ # target. Independent of the success signal, so the tolerance at every epoch is known in advance.+ k = env._frame_counter // max(int(term.tolerance_schedule_interval), 1)+ new_tol = max(min(term.success_tolerance * term.tolerance_curriculum_increment ** k, term.success_tolerance),+ term.target_success_tolerance)+ if new_tol != env._current_success_tolerance:+ env._current_success_tolerance = new_tol+ env._last_curriculum_update = env._frame_counter+ print(f"[tolerance schedule] frame {env._frame_counter}: tolerance {new_tol:.4f}", flush=True)+ elif (not rot_curriculum_active and env._frame_counter - env._last_curriculum_update >= term.tolerance_curriculum_interval): successes = env._prev_episode_successes.float() eligible_mask = Nonediff --git a/isaacsimenvs/tools/eval_hand_contact.py b/isaacsimenvs/tools/eval_hand_contact.pyindex 63221a5..a3bd023 100644--- a/isaacsimenvs/tools/eval_hand_contact.py+++ b/isaacsimenvs/tools/eval_hand_contact.py@@ -31,6 +31,144 @@ import time from pathlib import Path +# --- Axial grasp position + slip diagnostics (2026-12-01, real-robot finding: grasp near the head, slides) ----+GP_BAND = (0.3, 0.7) # acceptance band: palm centre at 30-70 % of the handle length from the head end+GP_NEAR_HEAD_M = 0.03 # "at the head": palm centre within 3 cm of the head-side end of the handle+GP_SLIP_M, GP_SLIP_S = 0.02, 0.5 # slip event: palm moves > 2 cm along the handle within 0.5 s while held+GP_FIRST_S = 1.0 # first grasp position = mean over the first 1 s after the first lift of an episode+GP_LEN_EDGES = (0.0, 0.12, 0.16, 0.20, 1.0)+++def _palm_axial(env, along):+ """Palm centre projected on the handle axis, all envs: (from_head_m, fraction, axial_m, ok)."""+ import torch+ from isaacsimenvs.tasks.simtoolreal.utils import reward_utils as ru+ ai = env._object_asset_index_per_env+ oq = env.object.data.root_quat_w+ u = ru.quat_apply(oq, env._handle_axis_obj[ai])+ centre = env.object.data.root_pos_w + ru.quat_apply(oq, env._handle_centre_obj[ai])+ palm_s = env.robot.data.body_state_w[:, env._palm_body_id, :7]+ off = torch.as_tensor(env._palm_center_offset, device=palm_s.device, dtype=palm_s.dtype).reshape(1, 3)+ palm_c = palm_s[:, 0:3] + ru.quat_apply(palm_s[:, 3:7], off.expand(palm_s.shape[0], 3))+ p_axial = ((palm_c - centre) * u).sum(dim=-1) * along["sign"][ai] # + = toward the head+ length = along["len"][ai]+ from_head = 0.5 * length - p_axial+ return from_head, from_head / length.clamp(min=1e-6), p_axial, along["has_head"][ai]+++def _grasp_position_init(env, dev) -> dict:+ import torch+ n = env.num_envs+ dt = float(getattr(env, "step_dt", 1.0 / 60.0))+ w = max(int(round(GP_SLIP_S / dt)), 1)+ nl = len(GP_LEN_EDGES) - 1+ return dict(dt=dt, w=w, n_first=max(int(round(GP_FIRST_S / dt)), 1),+ hist_ax=torch.zeros(w, n, device=dev), hist_held=torch.zeros(w, n, dtype=torch.bool, device=dev),+ slipping=torch.zeros(n, dtype=torch.bool, device=dev),+ lifted_once=torch.zeros(n, dtype=torch.bool, device=dev), since=torch.zeros(n, device=dev),+ first_sum=torch.zeros(n, device=dev), first_frac=torch.zeros(n, device=dev),+ first_n=torch.zeros(n, device=dev), first_done=torch.zeros(n, dtype=torch.bool, device=dev),+ first_m=[], first_f=[],+ held_n=torch.zeros((), device=dev), band=torch.zeros((), device=dev),+ near_head=torch.zeros((), device=dev), past_head=torch.zeros((), device=dev),+ near_head45=torch.zeros((), device=dev),+ speed_sum=torch.zeros((), device=dev), speed_n=torch.zeros((), device=dev),+ slip_events=0, held_s=0.0, prev_ax=torch.zeros(n, device=dev),+ prev_held=torch.zeros(n, dtype=torch.bool, device=dev),+ len_n=torch.zeros(nl, device=dev), len_band=torch.zeros(nl, device=dev),+ len_m=torch.zeros(nl, device=dev), len_near=torch.zeros(nl, device=dev),+ frac_hist=torch.zeros(10, device=dev))+++def _flush_first(gp, mask) -> None:+ m = mask & gp["first_done"].logical_not() & (gp["first_n"] > 0)+ if m.any():+ gp["first_m"] += (gp["first_sum"][m] / gp["first_n"][m]).tolist()+ gp["first_f"] += (gp["first_frac"][m] / gp["first_n"][m]).tolist()+ gp["first_done"] |= m+++def _grasp_position_diag(env, along, gp, held, done, k) -> None:+ import torch+ from_head, frac, ax, ok = _palm_axial(env, along)+ h = held & ok+ # held-step distributions+ gp["held_n"] += h.sum()+ gp["band"] += (h & (frac >= GP_BAND[0]) & (frac <= GP_BAND[1])).sum()+ gp["near_head"] += (h & (from_head < GP_NEAR_HEAD_M)).sum()+ gp["past_head"] += (h & (from_head < 0.0)).sum()+ gp["near_head45"] += (h & (from_head < 0.045)).sum()+ gp["frac_hist"].index_add_(0, (frac[h].clamp(0.0, 0.999) * 10).long(), torch.ones_like(frac[h]))+ length = along["len"][env._object_asset_index_per_env]+ lb = (torch.bucketize(length, torch.tensor(GP_LEN_EDGES[1:-1], device=length.device), right=True))[h]+ gp["len_n"].index_add_(0, lb, torch.ones_like(frac[h]))+ gp["len_band"].index_add_(0, lb, ((frac[h] >= GP_BAND[0]) & (frac[h] <= GP_BAND[1])).float())+ gp["len_m"].index_add_(0, lb, from_head[h])+ gp["len_near"].index_add_(0, lb, (from_head[h] < GP_NEAR_HEAD_M).float())+ # axial speed while held on consecutive steps+ both = h & gp["prev_held"]+ if both.any():+ gp["speed_sum"] += ((ax - gp["prev_ax"]).abs()[both] / gp["dt"]).sum()+ gp["speed_n"] += both.sum()+ # slip events: held over the whole window and |axial change| > GP_SLIP_M; count rising edges per env+ w = gp["w"]+ i = k % w+ old_ax, old_held = gp["hist_ax"][i].clone(), gp["hist_held"][i].clone()+ gp["hist_ax"][i] = ax+ gp["hist_held"][i] = h+ if k >= w:+ win_held = gp["hist_held"].all(dim=0)+ slip = win_held & old_held & ((ax - old_ax).abs() > GP_SLIP_M)+ gp["slip_events"] += int((slip & ~gp["slipping"]).sum())+ gp["slipping"] = slip+ gp["held_s"] += float(h.sum()) * gp["dt"]+ # first grasp position of each episode: mean over the first GP_FIRST_S after the first lift+ start = h & ~gp["lifted_once"]+ gp["lifted_once"] |= h+ gp["since"] = torch.where(start, torch.zeros_like(gp["since"]), gp["since"])+ acc = gp["lifted_once"] & ~gp["first_done"] & (gp["since"] < gp["n_first"]) & h+ gp["first_sum"] += torch.where(acc, from_head, torch.zeros_like(from_head))+ gp["first_frac"] += torch.where(acc, frac, torch.zeros_like(frac))+ gp["first_n"] += acc.float()+ gp["since"] += gp["lifted_once"].float()+ _flush_first(gp, gp["lifted_once"] & (gp["since"] >= gp["n_first"]))+ # episode end: flush and reset the per-episode state+ if done.any():+ _flush_first(gp, done)+ for key in ("lifted_once", "first_done", "slipping"):+ gp[key][done] = False+ for key in ("since", "first_sum", "first_frac", "first_n"):+ gp[key][done] = 0.0+ gp["hist_held"][:, done] = False+ gp["prev_ax"], gp["prev_held"] = ax, h+++def _grasp_position_report(gp) -> dict:+ import torch+ _flush_first(gp, torch.ones_like(gp["first_done"]))+ hn = float(gp["held_n"].clamp(min=1))+ fm = torch.tensor(gp["first_m"]) if gp["first_m"] else torch.zeros(0)+ ff = torch.tensor(gp["first_f"]) if gp["first_f"] else torch.zeros(0)+ q = lambda t, p: float(t.quantile(p)) if t.numel() else float("nan")+ ln = gp["len_n"].clamp(min=1)+ return dict(+ band=list(GP_BAND), band_share_held=float(gp["band"]) / hn,+ near_head_share_held=float(gp["near_head"]) / hn, near_head_m=GP_NEAR_HEAD_M,+ past_head_share_held=float(gp["past_head"]) / hn, within_4p5cm_share_held=float(gp["near_head45"]) / hn,+ palm_fraction_hist10=(gp["frac_hist"] / hn).tolist(),+ first_grasp=dict(episodes=int(fm.numel()), from_head_m_median=q(fm, 0.5), from_head_m_p25=q(fm, 0.25),+ from_head_m_p75=q(fm, 0.75), fraction_median=q(ff, 0.5),+ band_share=float(((ff >= GP_BAND[0]) & (ff <= GP_BAND[1])).float().mean()) if ff.numel() else float("nan"),+ window_s=GP_FIRST_S),+ axial_speed_mean_m_s=float(gp["speed_sum"] / gp["speed_n"].clamp(min=1)),+ slip_events=gp["slip_events"], slip_events_per_held_min=gp["slip_events"] / max(gp["held_s"] / 60.0, 1e-9),+ slip_def=f"> {GP_SLIP_M} m axial palm motion within {GP_SLIP_S} s, held over the window (rising edges)",+ by_handle_length=dict(edges_m=list(GP_LEN_EDGES), held_steps=gp["len_n"].tolist(),+ band_share=(gp["len_band"] / ln).tolist(), from_head_m=(gp["len_m"] / ln).tolist(),+ near_head_share=(gp["len_near"] / ln).tolist()),+ note="palm centre (palm body + robot.palm_center_offset) on the handle axis; 0 = head-side end of the handle")++ def _joint_pos_report(env, mean_pos) -> dict: """Mean joint angle while the tool is held: rad and as a fraction of the joint's range (0 = lower limit).""" data = env.robot.data@@ -201,6 +339,7 @@ def main() -> None: palm_m=torch.zeros((), device=dev), palm_frac=torch.zeros((), device=dev), palm_hist=torch.zeros(5, device=dev), palm_radial=torch.zeros((), device=dev), axis_pt=torch.zeros(3, device=dev), head_side=torch.zeros(3, device=dev))+ gp = _grasp_position_init(env, dev) if along is not None else None # per-tool split (tool type from the generated URDF name "<idx>_<type>_handle_..."): successes, contacts, # facing and grasp position, so that pool-level means are not read as true for every tool by_tool = None@@ -331,6 +470,8 @@ def main() -> None: held = (height > args.lift) & ~done h = held nh = int(h.sum())+ if along is not None:+ _grasp_position_diag(env, along, gp, held, done, k) if tv is not None: r_c = env.cfg.reward fs_all = ru.finger_object_distance(env, per_sample=True)@@ -707,6 +848,7 @@ def main() -> None: tool_res[t_name] = {k: (None if isinstance(v, float) and math.isnan(v) else v) for k, v in tool_res[t_name].items()} res = dict( checkpoint=str(args.checkpoint), overrides=args.overrides, keep_dr=bool(args.keep_dr),+ grasp_position_diag=_grasp_position_report(gp) if gp is not None else None, held_definition=args.held if lift_pair is not None else "origin", mean_fingers_inward=float(n_in_sum / hs), push_away={n: float(push_cnt[1, i] / push_cnt[0, i].clamp(min=1)) for i, n in enumerate(names)},diff --git a/rl_games/rl_games/common/a2c_common.py b/rl_games/rl_games/common/a2c_common.pyindex c006544..d1c9d2f 100644--- a/rl_games/rl_games/common/a2c_common.py+++ b/rl_games/rl_games/common/a2c_common.py@@ -1690,7 +1690,9 @@ class ContinuousA2CBase(A2CBase): checkpoint_name = self.config['name'] + '_ep_' + str(epoch_num) + '_rew_' + str(mean_rewards[0]) if self.save_freq > 0:- if int(math.sqrt(epoch_num // self.save_freq)) ** 2 == epoch_num // self.save_freq and epoch_num % self.save_freq == 0:+ # save_linear: every save_freq epochs; default keeps the sparse perfect-square schedule+ if epoch_num % self.save_freq == 0 and (self.config.get('save_linear', False)+ or int(math.sqrt(epoch_num // self.save_freq)) ** 2 == epoch_num // self.save_freq): self.save(os.path.join(self.nn_dir, 'last_' + checkpoint_name), all_state_dict) if epoch_num % 200 == 0: torch_ext.safe_filesystem_op(os.makedirs, os.path.join(self.experiment_dir, 'last'), exist_ok=True)-- 2.43.0
From 958949252d92db759be8cff3142689bdf9f94fd9 Mon Sep 17 00:00:00 2001From: Chanyoung Ahn <ahn205@purdue.edu>Date: Tue, 1 Dec 2026 03:43:21 -0500Subject: [PATCH 2/2] Real-like flat starts, seated first-grasp metric, friction knob in the fine-tune launcher
- reset.flat_start_fraction / flat_start_yaw_range_deg / flat_start_xy_box (default off): a share of the resets lays the tool on its wide face with the head at a chosen yaw and xy (the real runs start like this; i3 ep625 grasps 5.3 cm from the head end at yaw 0 both in sim and on the robot).- eval grasp_position_diag first_grasp: first 1 s of seated holding (palm centre within 7 cm of the handle axis).- finetune_soup3lock.sh: OBJ_FRICTION overrides the object friction DR range.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Claude-Session: https://claude.ai/code/session_01RLSVK2nwbnDdBsyTT5Ykv3--- .../simtoolreal_tesollo_env_cfg.py | 6 +++++ .../tasks/simtoolreal/utils/reset_utils.py | 27 +++++++++++++++++++ isaacsimenvs/tools/eval_hand_contact.py | 17 +++++++----- scripts/synergy_noise/finetune_soup3lock.sh | 2 +- 4 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py b/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.pyindex 57d7152..104737d 100644--- a/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py+++ b/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py@@ -1227,6 +1227,12 @@ class ResetCfg: # Shift of the object spawn box centre (env frame x, y [m]); table and goal volume # unchanged. (0, 0) = old behaviour. object_spawn_xy_offset_m: tuple[float, float] = (0.0, 0.0)+ # Real-robot-like flat starts (reset_utils.reset_object_pose): fraction of the resets with the tool lying on its+ # wide face, head direction at a yaw in flat_start_yaw_range_deg (env frame, 0 = head toward +x), xy in+ # flat_start_xy_box (x_lo, x_hi, y_lo, y_hi; () = the usual spawn box). 0 = off.+ flat_start_fraction: float = 0.0+ flat_start_yaw_range_deg: tuple = (-180.0, 180.0)+ flat_start_xy_box: tuple = () fixed_start_pose: tuple[float, float, float, float, float, float, float] | None = None # Joint state noise on resetdiff --git a/isaacsimenvs/tasks/simtoolreal/utils/reset_utils.py b/isaacsimenvs/tasks/simtoolreal/utils/reset_utils.pyindex 160a2e8..8995611 100644--- a/isaacsimenvs/tasks/simtoolreal/utils/reset_utils.py+++ b/isaacsimenvs/tasks/simtoolreal/utils/reset_utils.py@@ -681,6 +681,28 @@ def _reset_object_pose(env, env_ids: torch.Tensor) -> None: else: noise = torch.empty(n, 3, device=env.device).uniform_(-1.0, 1.0) quat = random_orientation(n, device=env.device)+ # Real-robot-like flat starts (2026-12-01): for reset.flat_start_fraction of the resets the tool lies on its+ # stable wide face (thin side vertical, either way up) with the head direction at a yaw drawn from+ # flat_start_yaw_range_deg (env frame, 0 = head toward +x), and (if flat_start_xy_box is set) its xy drawn+ # from that box. The real runs (2026-11-30) start like this, and i3 grasps near the head at yaw ~0 there.+ flat_mask = None+ ff = float(getattr(cfg, "flat_start_fraction", 0.0))+ if ff > 0.0 and _init_in_hand(env): # _init_in_hand caches the primitive arrays+ flat_mask = torch.rand(n, device=env.device) < ff+ nf = int(flat_mask.sum())+ if nf > 0:+ a = env._object_asset_index_per_env[env_ids[flat_mask]]+ t = _clearance_tables(env)+ hd, down = t["hd"][a], t["down"][a]+ m_obj = torch.stack([hd, down, torch.linalg.cross(hd, down)], dim=-1)+ lo, hi = (float(v) for v in cfg.flat_start_yaw_range_deg)+ yaw = torch.deg2rad(torch.empty(nf, device=env.device).uniform_(lo, hi))+ s = torch.where(torch.rand(nf, device=env.device) < 0.5, 1.0, -1.0)+ zero = torch.zeros(nf, device=env.device)+ h = torch.stack([torch.cos(yaw), torch.sin(yaw), zero], dim=-1)+ v = torch.stack([zero, zero, s], dim=-1)+ m_w = torch.stack([h, v, torch.linalg.cross(h, v)], dim=-1)+ quat[flat_mask] = quat_from_matrix(m_w @ m_obj.transpose(1, 2)) spawn_off = tuple(getattr(cfg, "object_spawn_xy_offset_m", (0.0, 0.0)) or (0.0, 0.0)) corners = getattr(env, "_object_aabb_corners", None) if corners is not None:@@ -715,6 +737,11 @@ def _reset_object_pose(env, env_ids: torch.Tensor) -> None: ), dim=-1, )+ box = tuple(getattr(cfg, "flat_start_xy_box", ()) or ())+ if flat_mask is not None and flat_mask.any() and len(box) == 4: # (x_lo, x_hi, y_lo, y_hi), env frame [m]+ nf = int(flat_mask.sum())+ pos_local[flat_mask, 0] = torch.empty(nf, device=env.device).uniform_(float(box[0]), float(box[1]))+ pos_local[flat_mask, 1] = torch.empty(nf, device=env.device).uniform_(float(box[2]), float(box[3])) if not hasattr(env, "_object_spawn_xy"): # env-local spawn xy (the clearance block goes under it) env._object_spawn_xy = torch.zeros(env.num_envs, 2, device=env.device)diff --git a/isaacsimenvs/tools/eval_hand_contact.py b/isaacsimenvs/tools/eval_hand_contact.pyindex a3bd023..165ea30 100644--- a/isaacsimenvs/tools/eval_hand_contact.py+++ b/isaacsimenvs/tools/eval_hand_contact.py@@ -35,7 +35,8 @@ from pathlib import Path GP_BAND = (0.3, 0.7) # acceptance band: palm centre at 30-70 % of the handle length from the head end GP_NEAR_HEAD_M = 0.03 # "at the head": palm centre within 3 cm of the head-side end of the handle GP_SLIP_M, GP_SLIP_S = 0.02, 0.5 # slip event: palm moves > 2 cm along the handle within 0.5 s while held-GP_FIRST_S = 1.0 # first grasp position = mean over the first 1 s after the first lift of an episode+GP_FIRST_S = 1.0 # first grasp position = mean over the first 1 s of seated holding after the first lift+GP_SEAT_M = 0.07 # seated: palm centre within 7 cm of the handle axis (excludes the approach / pre-seat phase) GP_LEN_EDGES = (0.0, 0.12, 0.16, 0.20, 1.0) @@ -50,9 +51,12 @@ def _palm_axial(env, along): palm_s = env.robot.data.body_state_w[:, env._palm_body_id, :7] off = torch.as_tensor(env._palm_center_offset, device=palm_s.device, dtype=palm_s.dtype).reshape(1, 3) palm_c = palm_s[:, 0:3] + ru.quat_apply(palm_s[:, 3:7], off.expand(palm_s.shape[0], 3))- p_axial = ((palm_c - centre) * u).sum(dim=-1) * along["sign"][ai] # + = toward the head+ rel = palm_c - centre+ p_axial = (rel * u).sum(dim=-1) * along["sign"][ai] # + = toward the head length = along["len"][ai] from_head = 0.5 * length - p_axial+ radial = (rel - (rel * u).sum(dim=-1, keepdim=True) * u).norm(dim=-1)+ env._gp_radial = radial return from_head, from_head / length.clamp(min=1e-6), p_axial, along["has_head"][ai] @@ -123,10 +127,11 @@ def _grasp_position_diag(env, along, gp, held, done, k) -> None: gp["slipping"] = slip gp["held_s"] += float(h.sum()) * gp["dt"] # first grasp position of each episode: mean over the first GP_FIRST_S after the first lift- start = h & ~gp["lifted_once"]- gp["lifted_once"] |= h+ seated = h & (env._gp_radial < GP_SEAT_M)+ start = seated & ~gp["lifted_once"]+ gp["lifted_once"] |= seated gp["since"] = torch.where(start, torch.zeros_like(gp["since"]), gp["since"])- acc = gp["lifted_once"] & ~gp["first_done"] & (gp["since"] < gp["n_first"]) & h+ acc = gp["lifted_once"] & ~gp["first_done"] & (gp["since"] < gp["n_first"]) & seated gp["first_sum"] += torch.where(acc, from_head, torch.zeros_like(from_head)) gp["first_frac"] += torch.where(acc, frac, torch.zeros_like(frac)) gp["first_n"] += acc.float()@@ -159,7 +164,7 @@ def _grasp_position_report(gp) -> dict: first_grasp=dict(episodes=int(fm.numel()), from_head_m_median=q(fm, 0.5), from_head_m_p25=q(fm, 0.25), from_head_m_p75=q(fm, 0.75), fraction_median=q(ff, 0.5), band_share=float(((ff >= GP_BAND[0]) & (ff <= GP_BAND[1])).float().mean()) if ff.numel() else float("nan"),- window_s=GP_FIRST_S),+ window_s=GP_FIRST_S, seated_m=GP_SEAT_M), axial_speed_mean_m_s=float(gp["speed_sum"] / gp["speed_n"].clamp(min=1)), slip_events=gp["slip_events"], slip_events_per_held_min=gp["slip_events"] / max(gp["held_s"] / 60.0, 1e-9), slip_def=f"> {GP_SLIP_M} m axial palm motion within {GP_SLIP_S} s, held over the window (rising edges)",diff --git a/scripts/synergy_noise/finetune_soup3lock.sh b/scripts/synergy_noise/finetune_soup3lock.shindex baa85b1..1f7ef0b 100755--- a/scripts/synergy_noise/finetune_soup3lock.sh+++ b/scripts/synergy_noise/finetune_soup3lock.sh@@ -23,7 +23,7 @@ exec bash "$REPO/scripts/synergy_noise/train.sh" \ "env.assets.handle_head_types=[hammer,screwdriver,spatula,eraser,brush]" "env.assets.object_pool_limit=0" \ "env.assets.exclude_cylinder_handle_types=[screwdriver]" \ "env.domain_randomization.object_mass_scale_range=[0.5,1.5]" \- "env.domain_randomization.object_friction_scale_range=[0.6,1.4]" \+ "env.domain_randomization.object_friction_scale_range=${OBJ_FRICTION:-[0.6,1.4]}" \ "env.domain_randomization.object_restitution_range=[0.0,0.3]" \ "env.reset.target_volume_mins=[-0.22,-0.2,0.832]" \ $EXTRA_ARGS "$@"-- 2.43.0
123453 unmodified lines910111213141516171819#!/bin/bash# wc_clr_i7_5080: START_CK (default i3 ep625), slip penalty AXS (default 20), CONSTANT tolerance .0324 (i4: tightening to .02 collapsed eval successes) + axial grasp band (30-70 %, >= 4.5 cm from the head end) + axial slip penalty + wider friction DR + object pose delay 20 on the RTX 5080, weights-only, NUM_ENVS (default 3072 = i3, block NUM_ENVS/6), seed 42.# = i3 recipe (clearance block, ring clip, seat 5 [2,3], dorsal 5, straight ramp .6, D405) with three fixes:# (1) tolerance FIXED schedule .0324 (i3's tol at ep625) x0.9 every 300 epochs -> .02 floor at ep1500# (2) checkpoints every SAVE_FREQ epochs (save_linear) for screening, (3) wandb logging.3 unmodified linesCK=${START_CK:-~/str_train/hf_recorded/str-rl-policy/ring_2026-11-29/handover_2026-11-30/ckpt/clr3/wc_clr_i3_d405_ep625.pth}[ -n "${START_CK:-}" ] || [ "$(sha256sum $CK | cut -c1-64)" = 06af0ebca8710e24b7a58e88aa66edffdaa6cd724f5459abc002d45ca6a74c3d ] || { echo "bad checkpoint"; exit 1; }N=${NAME:-wc_clr_i7_5080}OV="agent.params.config.bounds_loss_coef=0.01 env.assets.min_handle_length=0.09 env.termination.target_success_tolerance=0.0324 env.termination.tolerance_schedule=fixed env.termination.tolerance_schedule_interval=4800 env.assets.robot_urdf=assets/urdf/ur5_tesollo_description/ur5_dg5fs_right_d405.urdf env.reward.wrap_rew_scale=2.0 env.reward.wrap_held_scale=3.0 env.reward.ring_term_metrics=True env.reward.dorsal_penalty_scale=5.0 env.reward.dorsal_penalty_fingers=[2,3] env.reward.straight_finger_mode=ramp env.reward.straight_finger_penalty_scale=0.6 env.reward.straight_finger_near_dist=0.0 env.robot.ring_approach_clip_deg=60.0 env.robot.ring_approach_gate_mode=lifted env.robot.ring_approach_clip_joints=mcp_pip env.reward.ring_clip_excess_scale=0.2 env.assets.clearance_block=True env.assets.clearance_block_groove_deg=3.0 env.reset.clearance_fraction=0.5 env.reset.clearance_m=0.045 env.reset.clearance_schedule=fixed env.reward.clearance_block_contact_scale=0.0 env.reward.seat_rew_scale=5.0 env.reward.seat_wrap_fingers=[2,3] +agent.params.config.save_linear=True env.reward.axial_band_rew_scale=${AXB:-3.0} env.reward.axial_band_min_m=0.045 env.reward.axial_band_ramp_m=0.03 env.reward.axial_slip_penalty_scale=${AXS:-20.0} env.domain_randomization.object_state_delay_max=${ODELAY:-20} ${EXTRA_OV:-}"if [ "${SMOKE:-0}" = 1 ]; thenN=${N}_smoke; EP=5; WB=""; rm -rf $REPO/outputs/synergy_noise/$NelseEP=${MAX_EPOCHS:-1500}; WB="--wandb_activate --wandb_project isaacsimenvs --wandb_group ring_2026-11-29 --wandb_name $N"ficd $REPORUN_DIR=outputs/synergy_noise/$N; mkdir -p $RUN_DIR12345678910113 unmodified lines1516171819202122232425#!/bin/bash# wc_clr_i7_5080 (real-robot oriented): START_CK (default i3 ep625), CONSTANT tolerance .0324 (i4: tightening collapsed evals).# DR from the 2026-11-30 real logs (pose 0.2-0.5 s old, tracker dropouts, tool slides along the handle): object pose delay# up to 30 steps (0.5 s), tracker holds 0.15 Hz x 0.3-1.0 s, pose bias 5 mm / 3 deg, object friction [0.4,1.4], fingertip# friction [0.7,1.3], hand gain / effort [0.8,1.2]. Human-like grasp: axial band 3.0 (30-70 %, >= 4.5 cm from the head end),# axial slip 20 + full in-palm slip 100. Smoother motion: hand joint-velocity penalty .003 -> .006.# Real-like flat starts: 50 % of table starts lie flat, yaw uniform, xy in the real start box (i3 grasps near the head at# yaw 0 flat: sim first seated grasp 5.3 cm from the head end = real 5.3 cm). + axial grasp band (30-70 %, >= 4.5 cm from the head end) + axial slip penalty + wider friction DR + object pose delay 20 on the RTX 5080, weights-only, NUM_ENVS (default 3072 = i3, block NUM_ENVS/6), seed 42.# = i3 recipe (clearance block, ring clip, seat 5 [2,3], dorsal 5, straight ramp .6, D405) with three fixes:# (1) tolerance FIXED schedule .0324 (i3's tol at ep625) x0.9 every 300 epochs -> .02 floor at ep1500# (2) checkpoints every SAVE_FREQ epochs (save_linear) for screening, (3) wandb logging.3 unmodified linesCK=${START_CK:-~/str_train/hf_recorded/str-rl-policy/ring_2026-11-29/handover_2026-11-30/ckpt/clr3/wc_clr_i3_d405_ep625.pth}[ -n "${START_CK:-}" ] || [ "$(sha256sum $CK | cut -c1-64)" = 06af0ebca8710e24b7a58e88aa66edffdaa6cd724f5459abc002d45ca6a74c3d ] || { echo "bad checkpoint"; exit 1; }N=${NAME:-wc_clr_i7_5080}OV="agent.params.config.bounds_loss_coef=0.01 env.assets.min_handle_length=0.09 env.termination.target_success_tolerance=0.0324 env.termination.tolerance_schedule=fixed env.termination.tolerance_schedule_interval=4800 env.assets.robot_urdf=assets/urdf/ur5_tesollo_description/ur5_dg5fs_right_d405.urdf env.reward.wrap_rew_scale=2.0 env.reward.wrap_held_scale=3.0 env.reward.ring_term_metrics=True env.reward.dorsal_penalty_scale=5.0 env.reward.dorsal_penalty_fingers=[2,3] env.reward.straight_finger_mode=ramp env.reward.straight_finger_penalty_scale=0.6 env.reward.straight_finger_near_dist=0.0 env.robot.ring_approach_clip_deg=60.0 env.robot.ring_approach_gate_mode=lifted env.robot.ring_approach_clip_joints=mcp_pip env.reward.ring_clip_excess_scale=0.2 env.assets.clearance_block=True env.assets.clearance_block_groove_deg=3.0 env.reset.clearance_fraction=0.5 env.reset.clearance_m=0.045 env.reset.clearance_schedule=fixed env.reward.clearance_block_contact_scale=0.0 env.reward.seat_rew_scale=5.0 env.reward.seat_wrap_fingers=[2,3] +agent.params.config.save_linear=True env.reward.axial_band_rew_scale=${AXB:-3.0} env.reward.axial_band_min_m=0.045 env.reward.axial_band_ramp_m=0.03 env.reward.axial_slip_penalty_scale=${AXS:-20.0} env.domain_randomization.object_state_delay_max=${ODELAY:-30} env.domain_randomization.tracker_fail_hold_rate_hz=0.15 env.domain_randomization.tracker_fail_hold_s=[0.3,1.0] env.domain_randomization.object_state_xyz_bias_m=0.005 env.domain_randomization.object_state_rotation_bias_degrees=3.0 env.domain_randomization.fingertip_friction_scale_range=[0.7,1.3] env.domain_randomization.hand_gain_scale_range=[0.8,1.2] env.domain_randomization.hand_effort_scale_range=[0.8,1.2] env.reward.slip_penalty_scale=${SLIP:-100.0} env.reward.hand_actions_penalty_scale=0.006 env.reset.flat_start_fraction=${FLATF:-0.5} env.reset.flat_start_yaw_range_deg=[-180.0,180.0] env.reset.flat_start_xy_box=[-0.02,0.14,-0.25,-0.04] ${EXTRA_OV:-}"if [ "${SMOKE:-0}" = 1 ]; thenN=${N}_smoke; EP=5; WB=""; rm -rf $REPO/outputs/synergy_noise/$NelseEP=${MAX_EPOCHS:-1500}; WB="--wandb_activate --wandb_project isaacsimenvs --wandb_group ring_2026-11-29 --wandb_name $N --capture_viewer --capture_viewer_object_types hammer"ficd $REPORUN_DIR=outputs/synergy_noise/$N; mkdir -p $RUN_DIR
12345678910111213141516171819202122232425262728#!/bin/bash# wc_clr_i8_5080 = i7 + stronger axial grasp (band 5.0, ramp 1.5 cm, head-proximity cost 3.0 inside 6 cm). Was i7: (real-robot oriented): START_CK (default i3 ep625), CONSTANT tolerance .0324 (i4: tightening collapsed evals).# DR from the 2026-11-30 real logs (pose 0.2-0.5 s old, tracker dropouts, tool slides along the handle): object pose delay# up to 30 steps (0.5 s), tracker holds 0.15 Hz x 0.3-1.0 s, pose bias 5 mm / 3 deg, object friction [0.4,1.4], fingertip# friction [0.7,1.3], hand gain / effort [0.8,1.2]. Human-like grasp: axial band 3.0 (30-70 %, >= 4.5 cm from the head end),# axial slip 20 + full in-palm slip 100. Smoother motion: hand joint-velocity penalty .003 -> .006.# Real-like flat starts: 50 % of table starts lie flat, yaw uniform, xy in the real start box (i3 grasps near the head at# yaw 0 flat: sim first seated grasp 5.3 cm from the head end = real 5.3 cm). + axial grasp band (30-70 %, >= 4.5 cm from the head end) + axial slip penalty + wider friction DR + object pose delay 20 on the RTX 5080, weights-only, NUM_ENVS (default 3072 = i3, block NUM_ENVS/6), seed 42.# = i3 recipe (clearance block, ring clip, seat 5 [2,3], dorsal 5, straight ramp .6, D405) with three fixes:# (1) tolerance FIXED schedule .0324 (i3's tol at ep625) x0.9 every 300 epochs -> .02 floor at ep1500# (2) checkpoints every SAVE_FREQ epochs (save_linear) for screening, (3) wandb logging.# Usage: SMOKE=1 bash launch_clr_i4_5080.sh (5 epochs, no wandb) | bash launch_clr_i4_5080.shset -euo pipefailREPO=~/cy_ws/SimToolReal-marsCK=${START_CK:-~/str_train/hf_recorded/str-rl-policy/ring_2026-11-29/handover_2026-11-30/ckpt/clr3/wc_clr_i3_d405_ep625.pth}[ -n "${START_CK:-}" ] || [ "$(sha256sum $CK | cut -c1-64)" = 06af0ebca8710e24b7a58e88aa66edffdaa6cd724f5459abc002d45ca6a74c3d ] || { echo "bad checkpoint"; exit 1; }N=${NAME:-wc_clr_i8_5080}OV="agent.params.config.bounds_loss_coef=0.01 env.assets.min_handle_length=0.09 env.termination.target_success_tolerance=0.0324 env.termination.tolerance_schedule=fixed env.termination.tolerance_schedule_interval=4800 env.assets.robot_urdf=assets/urdf/ur5_tesollo_description/ur5_dg5fs_right_d405.urdf env.reward.wrap_rew_scale=2.0 env.reward.wrap_held_scale=3.0 env.reward.ring_term_metrics=True env.reward.dorsal_penalty_scale=5.0 env.reward.dorsal_penalty_fingers=[2,3] env.reward.straight_finger_mode=ramp env.reward.straight_finger_penalty_scale=0.6 env.reward.straight_finger_near_dist=0.0 env.robot.ring_approach_clip_deg=60.0 env.robot.ring_approach_gate_mode=lifted env.robot.ring_approach_clip_joints=mcp_pip env.reward.ring_clip_excess_scale=0.2 env.assets.clearance_block=True env.assets.clearance_block_groove_deg=3.0 env.reset.clearance_fraction=0.5 env.reset.clearance_m=0.045 env.reset.clearance_schedule=fixed env.reward.clearance_block_contact_scale=0.0 env.reward.seat_rew_scale=5.0 env.reward.seat_wrap_fingers=[2,3] +agent.params.config.save_linear=True env.reward.axial_band_rew_scale=${AXB:-5.0} env.reward.axial_band_min_m=0.045 env.reward.axial_band_ramp_m=0.015 env.reward.axial_head_penalty_scale=${AXH:-3.0} env.reward.axial_head_margin_m=0.06 env.reward.axial_band_prelift_frac=${AXP:-0.3} env.reward.axial_slip_penalty_scale=${AXS:-20.0} env.domain_randomization.object_state_delay_max=${ODELAY:-30} env.domain_randomization.tracker_fail_hold_rate_hz=0.15 env.domain_randomization.tracker_fail_hold_s=[0.3,1.0] env.domain_randomization.object_state_xyz_bias_m=0.005 env.domain_randomization.object_state_rotation_bias_degrees=3.0 env.domain_randomization.fingertip_friction_scale_range=[0.7,1.3] env.domain_randomization.hand_gain_scale_range=[0.8,1.2] env.domain_randomization.hand_effort_scale_range=[0.8,1.2] env.reward.slip_penalty_scale=${SLIP:-100.0} env.reward.hand_actions_penalty_scale=0.006 env.reset.flat_start_fraction=${FLATF:-0.5} env.reset.flat_start_yaw_range_deg=[-180.0,180.0] env.reset.flat_start_xy_box=[-0.02,0.14,-0.25,-0.04] ${EXTRA_OV:-}"if [ "${SMOKE:-0}" = 1 ]; then N=${N}_smoke; EP=5; WB=""; rm -rf $REPO/outputs/synergy_noise/$Nelse EP=${MAX_EPOCHS:-1500}; WB="--wandb_activate --wandb_project isaacsimenvs --wandb_group ring_2026-11-29 --wandb_name $N --capture_viewer --capture_viewer_object_types hammer"ficd $REPORUN_DIR=outputs/synergy_noise/$N; mkdir -p $RUN_DIRgit diff > $RUN_DIR/uncommitted.patch; git rev-parse HEAD > $RUN_DIR/commit.txtOBJ_FRICTION=${OBJ_FRICTION:-[0.4,1.4]} NUM_ENVS=${NUM_ENVS:-3072} SMALL_GPU=1 SEED=42 MAX_EPOCHS=$EP START_TOL=0.0324 SAVE_FREQ=${SAVE_FREQ:-100} ARM=cap RUN_DIR=$RUN_DIR \ bash scripts/synergy_noise/finetune_soup3lock.sh $CK $OV $WB 2>&1 | tee ~/str_train/logs/${N}.log123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778diff --git a/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py b/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.pyindex 104737d..d660e99 100644--- a/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py+++ b/isaacsimenvs/tasks/simtoolreal/simtoolreal_tesollo_env_cfg.py@@ -1160,6 +1160,14 @@ class RewardCfg: axial_slip_penalty_scale: float = 0.0 axial_slip_speed_cap: float = 0.5 axial_metrics: bool = False+ # axial_head_penalty_scale: per step while held, - scale x clamp((axial_head_margin_m - d) / margin, 0, 1), d = palm+ # centre from the head-side end of the handle (negative on the head). 0 = off.+ axial_head_penalty_scale: float = 0.0+ axial_head_margin_m: float = 0.045+ # axial_band_prelift_frac: share of the band term also paid before the lift while the palm centre is within+ # axial_prelift_radius_m of the handle axis (shapes where the hand lands). 0 = held only.+ axial_band_prelift_frac: float = 0.0+ axial_prelift_radius_m: float = 0.07 seat_rew_scale: float = 0.0 seat_sigma: float = 0.02 seat_points_use_min: bool = Falsediff --git a/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.py b/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.pyindex 09757b4..60a4889 100644--- a/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.py+++ b/isaacsimenvs/tasks/simtoolreal/utils/reward_utils.py@@ -639,7 +639,9 @@ def palm_from_head_end(env): off = torch.as_tensor(env._palm_center_offset, device=palm.device, dtype=palm.dtype).reshape(1, 3).expand(n, 3) pc = palm[:, 0:3] + quat_apply(palm[:, 3:7], off) length = 2.0 * env._handle_half_len[idx]- from_head = 0.5 * length - ((pc - centre) * u).sum(dim=-1) * env._handle_head_sign[idx]+ rel = pc - centre+ from_head = 0.5 * length - (rel * u).sum(dim=-1) * env._handle_head_sign[idx]+ env._palm_axis_radial = (rel - (rel * u).sum(dim=-1, keepdim=True) * u).norm(dim=-1) # palm centre to the axis line return from_head, length, env._handle_has_head[idx] @@ -1293,7 +1295,8 @@ def compute_rewards(env) -> torch.Tensor: # tool slides along the handle). Off unless reward.axial_band_rew_scale / axial_slip_penalty_scale > 0. ab_s = float(getattr(rew_cfg, "axial_band_rew_scale", 0.0)) as_s = float(getattr(rew_cfg, "axial_slip_penalty_scale", 0.0))- if (ab_s > 0.0 or as_s > 0.0 or getattr(rew_cfg, "axial_metrics", False)) and _init_handle_align(env):+ if (ab_s > 0.0 or as_s > 0.0 or float(getattr(rew_cfg, "axial_head_penalty_scale", 0.0)) > 0.0+ or getattr(rew_cfg, "axial_metrics", False)) and _init_handle_align(env): fh, length, has_head = palm_from_head_end(env) if lift_pair is not None: held_ax = (lift_z - held_ref) > rew_cfg.finger_engage_min_lift@@ -1306,6 +1309,18 @@ def compute_rewards(env) -> torch.Tensor: out_m = (lo_m - fh).clamp(min=0.0) + (fh - hi_m).clamp(min=0.0) # metres outside the band band_score = (1.0 - out_m / max(float(rew_cfg.axial_band_ramp_m), 1e-6)).clamp(0.0, 1.0) band_rew = ab_s * band_score * held_ax.float()+ # Approach shaping (axial_band_prelift_frac): before the lift, while the palm centre is within+ # axial_prelift_radius_m of the handle axis, pay that share of the band term, so the landing point moves+ # (the held-only term moved the held position but the first seat only ~1 cm, 2026-12-01 evals).+ pl = float(getattr(rew_cfg, "axial_band_prelift_frac", 0.0))+ if pl > 0.0:+ near = (~held_ax) & has_head & (env._palm_axis_radial < float(getattr(rew_cfg, "axial_prelift_radius_m", 0.07)))+ band_rew = band_rew + pl * ab_s * band_score * near.float()+ # Head-proximity cost (axial_head_penalty_scale): linear in how far the palm centre is inside+ # axial_head_margin_m of the head-side end of the handle (1 at the end or past it, on the head).+ ah_s = float(getattr(rew_cfg, "axial_head_penalty_scale", 0.0))+ ah_m = max(float(getattr(rew_cfg, "axial_head_margin_m", 0.045)), 1e-6)+ head_pen = -ah_s * ((ah_m - fh) / ah_m).clamp(0.0, 1.0) * held_ax.float() if not hasattr(env, "_axial_prev_fh"): env._axial_prev_fh = fh.clone() env._axial_prev_held = torch.zeros_like(held_ax)@@ -1314,12 +1329,13 @@ def compute_rewards(env) -> torch.Tensor: slip_pen = -as_s * axial_speed.clamp(max=float(getattr(rew_cfg, "axial_slip_speed_cap", 0.5))) env._axial_prev_fh = fh.clone() env._axial_prev_held = held_ax.clone()- reward = reward + band_rew + slip_pen+ reward = reward + band_rew + slip_pen + head_pen hf = held_ax.float() frac = fh / length.clamp(min=1e-6) extra_terms.update({ "axial_band_rew": band_rew, "axial_slip_pen": slip_pen,+ "axial_head_pen": head_pen, "axial_from_head_held": fh * hf, "axial_band_steps": ((frac >= rew_cfg.axial_band[0]) & (frac <= rew_cfg.axial_band[1])).float() * hf, "axial_within_4p5cm_steps": (fh < 0.045).float() * hf,str-rl-policy/ring_2026-12-01_5080/ckpt/SHA256SUMS_i7Added+2
str-rl-policy/ring_2026-12-01_5080/ckpt/wc_clr_i7_5080_ep500.pthAdded+3
str-rl-policy/ring_2026-12-01_5080/ckpt/wc_clr_i7_5080_ep700.pthAdded+3
str-rl-policy/ring_2026-12-01_5080/code/0001-0002-axial-flat-start.patchAdded+510
str-rl-policy/ring_2026-12-01_5080/code/launch_clr_i7_5080.sh+9-3
str-rl-policy/ring_2026-12-01_5080/code/launch_clr_i8_5080.shAdded+28
str-rl-policy/ring_2026-12-01_5080/code/uncommitted_head_penalty_prelift.patchAdded+78