textX languages for abstract scene models (scene) and executable scene instances (scenex).
scene(*.scene) describes abstract robotic scene content: objects, workspaces, agents, workspace compositions, and scene models.scenex(*.scenex) describes executable scene instances: model files, geometry, frames, poses, kinematics, attachments, bodies, and inertial mass..ktreefiles hold reusable device trees. They are parsed with thescenexmetamodel, and imported like a.scenefile.
scenex references the registered scene language, so executable models can
import a .scene file and link to SceneModel declarations.
A tree without a namespace is a template: it describes a device without being any particular one, so every use is an instance that copies it under its own name. An element's IRI is its namespace plus the path down to it, so two instances of one device may share a namespace, and a sensor is scoped by the agent carrying it.
scene-dsl is a Python package installable with pip. It depends on
rdf-utils, textx, rdflib, and
numpy.
For local development with sibling checkouts:
pip install "../rdf-utils[all]"
pip install -e .Example models live under examples/models.
Print abstract scene RDF as Turtle:
textx generate examples/models/lab.scene --target console --format ttlWrite abstract scene RDF to examples/generated/lab.scene.ttl:
textx generate examples/models/lab.scene --target graph -o examples/generated --format ttlPrint executable scenex RDF as Turtle:
textx generate examples/models/lab.scenex --target console --format ttlWrite executable scenex RDF to examples/generated/lab.scenex.ttl:
textx generate examples/models/lab.scenex --target graph -o examples/generated --format ttlThe RDF generators accept format (json-ld, ttl, or xml) and filename.
For JSON-LD, pass --nocompact to skip compacting IRIs.
Draw the scene's bodies and the joints between them, with each device a cluster
and any declared serial chain picked out. Needs graphviz
for anything but dot:
textx generate examples/models/lab.scenex --target dot -o examples/generated --format pngformat takes dot (the default), png, svg, or pdf. To print the graph
instead of writing it:
textx generate examples/models/lab.scenex --target dot-consolepytest -q tests
ruff check src tests