Skip to content

simulo.Asset

A read-only, registry-resolved resource mounted into running jobs.

A registry ref is [<publisher>/]<kind>/<name>[:v<N>] (e.g. simulo/robot/cartpole:v1); from_registry() names one, and path resolves to its read-only mount inside a running job. Asset is also how a task names USD/URDF model sources to load into a scene — usd() / urdf().

Raises:

  • ContractViolationError — if uri is not a valid [<publisher>/]<kind>/<name>[:v<N>] ref.

Real usage, shared by every shipped training app — resolve a published, version-pinned catalog robot once, then pass it to simulo.Robot:

# module level:
cartpole = simulo.Asset.from_registry("simulo/robot/cartpole:v1")
# inside Task.build() / Scenario.build():
self.robot = simulo.Robot(asset=cartpole, initial_pose=simulo.Pose.identity())
simulo.Asset(uri: str, *, read_only: bool = True)
Asset.from_registry(uri: str, read_only: bool = True) -> Asset

classmethod

Get a handle to the registry asset at uri.

uri is a catalog ref [<publisher>/]<kind>/<name>[:v<N>] — the publisher defaults to your own org, simulo names the global catalog, and an omitted :v<N> is resolved to the current latest at submit. The handle is directly consumable wherever a model source is accepted — Robot(asset=...) for a robot ref, scene.add(...) for a world ref.

Asset.usd(path: str) -> Any

classmethod

Name a USD model source to load into a scene.

At submit time this returns an inert, torch-free spec object so authoring stays lean; in the execution runtime it resolves to the real model asset. The return type depends on mode, so it is typed Any.

Asset.urdf(path: str) -> Any

classmethod

Name a URDF model source to load into a scene (see usd()).

Asset.uri: str

property

The registry ref as authored ([<publisher>/]<kind>/<name>[:v<N>]).

Asset.kind: str

property

The <kind> segment of the ref — "robot", "world", or "prop".

Asset.name: str

property

The asset <name> slug.

Asset.publisher: Optional[str]

property

The owning catalog publisher ("simulo" = global, an org slug, or None when omitted — the caller’s own org).

Asset.version: Optional[int]

property

The pinned version number, or None for an unpinned ref (resolved at submit).

Asset.is_read_only: bool

property

Whether this handle is read-only (registry assets always are).

Asset.read_only() -> Asset

Return a read-only view of this asset (builder marker).

Asset.path: str

property

Local read-only mount path — only meaningful inside a running job.

Resolution order, in execution mode:

  1. SIMULO_ASSET_<uri> — the mount the execution environment exported for this asset. When set, it is authoritative.
  2. The on-disk catalog cache ~/.simulo/assets/<org>/<kind>/<name>/v<N>/ — the colon-free layout simulo asset get writes into. Used for a local run with no runner-provided mount.

Raises outside execution mode, or — when neither a mount env var nor a cached copy is present — with the exact simulo asset get <ref> command to fetch it.