"""Config for Isaac-GolfCartDriver-PathFollow-v0 (Isaac Lab 3.0, PhysX backend). Research and simulation project only. Do not install this device in a real vehicle or attempt to drive a vehicle with it. It has not been built or tested on any vehicle. Simulation-tested ยท Not built. Every number comes from params.json, written by package/src/gen_isaac.py from spec.yaml and the Phase 4 MuJoCo harness (src/simlib.py). The kit (robot/robot.usd, 5 joints) is a PhysX articulation: zero drive gains, joint friction 0 and generous solver limits, because env.py computes every effort itself (actuator-MCU PD + torque-speed saturation + clutch, as simlib does in MuJoCo; brake spring, cords, pedal reactions and steering resistance from the spec maps). Armature: the MJCF values; the steering hub also carries the steering chain it clamps to (per vehicle, written at reset). Self-collisions off (the MJCF contact sweep found none, D15; USD diagnostic D19 showed no change). """ 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 from isaaclab_physx.sim.schemas import PhysxArticulationRootPropertiesCfg HERE = Path(__file__).resolve().parent PKG = HERE.parents[2] # package/ P = json.loads((HERE / "params.json").read_text(encoding="utf-8")) USD = str((PKG / P["usd_path"]).resolve()) ACT = P["actuators"] ACCEL_IN_ACTOR = any(o["name"] == "imu_accel_xy" for o in P["observation"]) ARMATURE = {ACT[a]["joint"]: ACT[a]["armature"] for a in ACT} ARMATURE.update({"brake_slider_joint": 0.0, "throttle_lever_joint": 0.0}) ROBOT_CFG = ArticulationCfg( prim_path="{ENV_REGEX_NS}/Robot", spawn=sim_utils.UsdFileCfg( usd_path=USD, articulation_props=PhysxArticulationRootPropertiesCfg(enabled_self_collisions=False, solver_position_iteration_count=8, solver_velocity_iteration_count=1), ), init_state=ArticulationCfg.InitialStateCfg(pos=(0.0, 0.0, 0.0), rot=(0.0, 0.0, 0.0, 1.0)), # xyzw (Isaac Lab 3.0) actuators={ "kit": ImplicitActuatorCfg(joint_names_expr=list(P["kit_joints"]), stiffness=0.0, damping=0.0, armature=ARMATURE, friction=0.0, joint_effort_limit=1.0e4, joint_velocity_limit=1.0e3), }, ) @configclass class GolfCartPathFollowEnvCfg(DirectRLEnvCfg): decimation = P["decimation"] episode_length_s = P["rl"]["episode_s"] action_space = 3 observation_space = P["observation_size"] state_space = P["observation_size"] + 29 + (0 if ACCEL_IN_ACTOR else 2) # critic: clean actor inputs + privileged values (env.py, D41) sim: SimulationCfg = SimulationCfg(dt=P["physics_dt"], render_interval=P["decimation"], physics=PhysxCfg()) robot_cfg: ArticulationCfg = ROBOT_CFG scene: InteractiveSceneCfg = InteractiveSceneCfg(num_envs=P["rl"]["num_envs"], env_spacing=2.0, replicate_physics=True) eval_mode: bool = False # True: spec course only (mirrored at random), cruise = course.cruise_speed_mps randomize: bool = True # False: nominal vehicle V1, no noise, no disturbances (probe / debugging only) terminate: bool = True # False: no cross-track / heading termination (scripted probe only) # reward weights (per policy step) and sigmas: spec rl.reward (through params.json; D21, D41). Terms are defined in # env.py _get_rewards and in the spec comments. rew = dict(P["rl"]["reward"]["weights"]) xte_sigma = float(P["rl"]["reward"]["sigma"]["xte_m"]) heading_sigma = float(P["rl"]["reward"]["sigma"]["heading_rad"]) speed_sigma = float(P["rl"]["reward"]["sigma"]["speed_mps"])