"""Config for Isaac-Sim01-ResidualPass-v0 (PhysX backend). Simulation-tested ยท Not built. Synthetic training materials only. Not for human or veterinary treatment. Every number comes from params.json, written by package/src/gen_isaac.py from spec.yaml and robot/robot.xml: each joint is an implicit PD drive with the MuJoCo position-actuator gains (kp, kv), the STS3215-C018 stall torque as the effort limit and the no-load speed as the velocity limit; armature, viscous damping and friction are the MJCF values. The bench (both SO-101 arms, the instrument fixed in the R gripper, fixture, cameras) is one fixed-base articulation. """ from __future__ import annotations import json from pathlib import Path import isaaclab.sim as sim_utils from isaaclab.actuators import ImplicitActuatorCfg from isaaclab.assets import ArticulationCfg from isaaclab.envs import DirectRLEnvCfg from isaaclab.scene import InteractiveSceneCfg from isaaclab.sim import SimulationCfg from isaaclab.utils import configclass from isaaclab_physx.physics import PhysxCfg HERE = Path(__file__).resolve().parent P = json.loads((HERE / "params.json").read_text()) USD = str((HERE.parents[2] / P["usd_path"]).resolve()) # package/robot/robot.usd J = P["joints"] def per(key): return {j["name"]: float(j[key]) for j in J} ROBOT_CFG = ArticulationCfg( prim_path="{ENV_REGEX_NS}/Robot", spawn=sim_utils.UsdFileCfg( usd_path=USD, rigid_props=sim_utils.RigidBodyPropertiesCfg(disable_gravity=False, max_depenetration_velocity=1.0), articulation_props=sim_utils.ArticulationRootPropertiesCfg(enabled_self_collisions=False, solver_position_iteration_count=8, solver_velocity_iteration_count=2), ), init_state=ArticulationCfg.InitialStateCfg(pos=(0.0, 0.0, 0.0), rot=(0.0, 0.0, 0.0, 1.0), joint_pos=per("home"), joint_vel={".*": 0.0}), actuators={ # passive joint damping folded into the drive damping (DESIGN_LOG D29): a probe of the v1 task # (tools/probe_contact.py, runs/isaac_probe_contact.json) showed PhysX following the 30 deg/s wrist-roll ramp with # the lag of the drive damping alone (1.18 mrad, viscous_friction 0.6 set but not acting), while MuJoCo adds the # MJCF joint damping. kd + damping gives MuJoCo's total; the servo-load observation keeps kd only (env.py). "servos": ImplicitActuatorCfg(joint_names_expr=[j["name"] for j in J], stiffness=per("kp"), damping={j["name"]: float(j["kd"]) + float(j["damping"]) for j in J}, armature=per("armature"), friction=per("friction"), viscous_friction=0.0, joint_effort_limit=per("effort"), joint_velocity_limit=per("velocity")), }, ) @configclass class ResidualPassEnvCfg(DirectRLEnvCfg): decimation = P["decimation"] episode_length_s = P["rl"]["episode_s"] action_space = len(P["policy_joints"]) observation_space = P["obs_dim"] state_space = P["obs_dim"] + 5 + 3 + 1 + 3 + 3 # + offsets, true centre error, latency, proxy force, tunnel offset sim: SimulationCfg = SimulationCfg(dt=P["physics_dt"], render_interval=decimation, physics=PhysxCfg()) robot_cfg: ArticulationCfg = ROBOT_CFG scene: InteractiveSceneCfg = InteractiveSceneCfg(num_envs=P["rl"]["num_envs"], env_spacing=1.5, replicate_physics=True)