Conversation
Greptile SummaryThis PR adds the Assemble Trocar manipulation task for the Unitree G1 (29-DoF + Dex3) robot, including a 4-stage MDP (lift → tip-align → insert → place), camera presets, a GR00T data config, and a minor RLinf extension patch for render warm-up on reset. The overall architecture follows established IsaacLab task conventions, but there are two blocking issues that prevent the task from running for any user other than the author:
Additional issues found:
Confidence Score: 1/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
S0["Stage 0: Initial\n(trocars on tray)"]
S1["Stage 1: Lifted\n(both trocars above table)"]
S2["Stage 2: Tip Aligned\n(trocar tips within 15 mm)"]
S3["Stage 3: Inserted\n(parallel + centers < 30 mm)"]
S4["Stage 4: Placed\n(both in target zone)"]
TERM_TIMEOUT["Terminate: Timeout"]
TERM_DROP["Terminate: Object Drop\n(z < 0.5 m)"]
TERM_SUCCESS["Terminate: Success"]
S0 -->|"lift_trocars_reward\nboth z > table+0.05"| S1
S1 -->|"trocar_tip_alignment_reward\ntip_dist < 0.015 m"| S2
S2 -->|"trocar_insertion_reward\nparallel + center < 0.03 m"| S3
S3 -->|"trocar_placement_reward\nboth in XY zone"| S4
S0 & S1 & S2 & S3 --> TERM_TIMEOUT
S0 & S1 & S2 & S3 --> TERM_DROP
S4 --> TERM_SUCCESS
|
...aclab_tasks/isaaclab_tasks/manager_based/manipulation/assemble_trocar/config/robot_config.py
Outdated
Show resolved
Hide resolved
source/isaaclab_tasks/isaaclab_tasks/manager_based/manipulation/assemble_trocar/__init__.py
Show resolved
Hide resolved
| f"is_parallel={is_parallel.item()} | reward={reward[0].item():.3f}" | ||
| ) |
There was a problem hiding this comment.
.item() called on a batch tensor
is_parallel has shape (num_envs,). Calling .item() on it will raise a RuntimeError: only one element tensors can be converted to Python scalars whenever num_envs > 1 and print_log=True. The fix is to index into the first environment:
| f"is_parallel={is_parallel.item()} | reward={reward[0].item():.3f}" | |
| ) | |
| f" └─ Stage 2 (Push In, {mode_str}): angle={angle[0].item():.3f} | " | |
| f"center_d={center_dist[0].item():.4f} | " | |
| f"is_parallel={is_parallel[0].item()} | reward={reward[0].item():.3f}" |
| _body_obs_cache = { | ||
| "device": None, | ||
| "batch": None, | ||
| "idx_t": None, | ||
| "idx_batch": None, | ||
| "pos_buf": None, | ||
| "vel_buf": None, | ||
| "torque_buf": None, | ||
| "combined_buf": None, | ||
| } |
There was a problem hiding this comment.
Module-level global cache breaks multi-instance and reloading scenarios
_body_obs_cache (and _dex3_obs_cache) are module-level mutable dicts. If two ManagerBasedRLEnv instances exist simultaneously (e.g., a training env and an eval env in the same process), both will share and overwrite the same cache, producing corrupted observations for one of them. The cache should either be keyed by id(env) or stored per-env instance (e.g., via setattr(env, '_body_obs_cache', ...)), consistent with how get_trocar_tip_position in rewards.py correctly uses setattr(env, cache_key, ...).
Description
Adds the Assemble Trocar manipulation task for the Unitree G1 (29-DoF + Dex3), with RLinf support.
Key additions:
IsaacLabDataConfigdefining video/state/action modality keys, transforms (SinCos state encoding, min-max action normalization, color jitter), and model-specific settings.isaaclab_contrib/rl/rlinf/extension.pyto support the new task registration.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there