execute_script
Execute arbitrary Python code in Isaac Sim to perform custom operations like creating Action Graphs, computing inverse kinematics, or setting up physics callbacks that named tools do not cover.
Instructions
Escape hatch: execute arbitrary Python code in Isaac Sim.
PREFER named tools over this for: reading/setting joints (set_joint_positions, get_joint_positions), inspecting state (get_prim_info, get_physics_state, get_joint_config), stepping simulation (step_simulation), and checking logs (get_isaac_logs).
USE this for: operations no named tool covers, such as creating Action Graphs, computing IK, setting up physics callbacks, or configuring advanced USD properties.
For persistent controllers (>20 lines), write a .py file and load it with reload_script instead of pasting code here.
Args: code: Python code to execute in the Isaac Sim context. cwd: Optional working directory to add to sys.path before execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| cwd | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |