Prerequisites

  • Python 3.12
  • FastSim 0.1.0a6
  • UniRoboSim Core 0.10.0
  • UniRoboSim Isaac Lab adapter 0.10.1
  • Isaac Lab 3.0 / Isaac Sim 6.0 and a working display

The Run explicitly selects launch_profile: visible.

Configuration

run.yaml creates the shared two-joint arm in Isaac Lab. Physics and control both run at 60 Hz. The initial values of joint_1 and joint_2 are zero, matching the first row produced by linear_path().

Key code, line by line

python
operation = await simulation.control.submit_joints(  # Submit without blocking.
    actor="arm",                                     # Scenario robot alias.
    group="arm",                                     # Public actuator group.
    path=linear_path(240),                           # Four seconds at 60 Hz.
    dt=1.0 / 60.0,                                   # Time between path rows.
    timeout=10.0,                                    # Admission timeout.
)

submit_joints() returns immediately with an operation handle. The 240-frame path is deliberately much longer than the 24 frames this program will allow to run.

python
status = await operation.status()                    # Read portable progress.
if status.progress.applied_frames >= 24:             # Stop at the chosen boundary.
    break
await simulation.single_step()                       # Advance exactly one physics step.

The application stays paused, so every call to single_step() is explicit and easy to inspect. No wall-clock sleep is used to guess how far control has progressed.

python
cancellation_accepted = await operation.cancel(timeout=5.0)
result = await operation.result(timeout=5.0)         # Wait for the terminal result.
await operation.release()                            # Release the completed record.

cancel() asks the control authority to linearize cancellation at a control boundary. result.status must then be cancelled, and applied_frames must remain smaller than planned_frames.

Run it

From this case directory:

bash
cd demo/fundamentals/14_cancel_control_operation
fastsim config validate run.yaml --json
python main.py

Expected final lines:

text
Cancellation accepted: True
Status: cancelled
Frames before cancel: 24
Applied/planned frames: 24/240

Cancelling the operation does not close the application. Code after result() may inspect the scene, submit another command, reset, or stop normally.

Verification level

REAL VISIBLE ISAAC PASS. The example was run with Python 3.12, Core 0.10.0, Isaac adapter 0.10.1, Isaac Lab 3.0, and Isaac Sim 6.0. The native result was exactly cancelled with 24/240 applied frames. Python compilation and Run compilation also passed.

Common errors

  • Calling cancel() after result() reports success: the operation already reached a terminal state, so there is nothing active to cancel.
  • Using wall-clock sleep() instead of status().progress: physics may run faster or slower than wall time.
  • Forgetting release(): completed operation records remain owned by the application until released or closed.

Next: 15 · Multi-resource tracks.