Skip to content

sim2bot.RobotInfo

RobotInfo dataclass

Model-derived metadata for one robot announced by the simulator.

Attributes:

  • index (int) –

    Current scene command address. Pass it as robot= to commands.

  • id (str) –

    Stable identity while this scene instance is loaded.

  • name (str) –

    Human-readable model or instance name.

  • dof (int) –

    Number of controllable arm joints, excluding gripper joints.

  • joint_names (list[str]) –

    Joint names in the exact order expected by commands.

  • joint_limits (list[Optional[list[float]]]) –

    Per-joint [lower, upper] limits in radians, or None for an unlimited joint.

  • home (list[float]) –

    Model-defined home target in radians and command order.

  • has_gripper (bool) –

    Whether the robot exposes a supported gripper.

  • locomotion (str) –

    Capability label such as "arm", mobile, or aerial.

  • base_dof (int) –

    Number of supported mobile or aerial base degrees of freedom.

  • category (str) –

    Sim2Bot catalog category.

  • manufacturer (str) –

    Authored manufacturer, when declared.

  • license (str) –

    SPDX licence identifier, when declared.

  • source_url (str) –

    Upstream model source, when declared.

  • snapshot_digest (str) –

    SHA-256 identity of the exact bundled model snapshot.

  • capabilities (list[str]) –

    Verified Sim2Bot capability labels.

  • arm_actuators (list[str]) –

    Authored arm actuator names in command order.

  • gripper_actuators (list[str]) –

    Authored gripper actuator names.

  • tcp_sites (list[str]) –

    Authored tool-centre-point site candidates.

  • end_effector_bodies (list[str]) –

    Authored end-effector body candidates.

  • keyframes (list[str]) –

    Named MJCF poses such as home or rest.

  • model_cameras (list[str]) –

    Cameras compiled as part of this robot model.

  • model_sensors (list[str]) –

    Sensors compiled as part of this robot model.

Source code in sim2bot/client.py
@dataclass
class RobotInfo:
    """Model-derived metadata for one robot announced by the simulator.

    Attributes:
        index: Current scene command address. Pass it as ``robot=`` to commands.
        id: Stable identity while this scene instance is loaded.
        name: Human-readable model or instance name.
        dof: Number of controllable arm joints, excluding gripper joints.
        joint_names: Joint names in the exact order expected by commands.
        joint_limits: Per-joint ``[lower, upper]`` limits in radians, or ``None``
            for an unlimited joint.
        home: Model-defined home target in radians and command order.
        has_gripper: Whether the robot exposes a supported gripper.
        locomotion: Capability label such as ``"arm"``, mobile, or aerial.
        base_dof: Number of supported mobile or aerial base degrees of freedom.
        category: Sim2Bot catalog category.
        manufacturer: Authored manufacturer, when declared.
        license: SPDX licence identifier, when declared.
        source_url: Upstream model source, when declared.
        snapshot_digest: SHA-256 identity of the exact bundled model snapshot.
        capabilities: Verified Sim2Bot capability labels.
        arm_actuators: Authored arm actuator names in command order.
        gripper_actuators: Authored gripper actuator names.
        tcp_sites: Authored tool-centre-point site candidates.
        end_effector_bodies: Authored end-effector body candidates.
        keyframes: Named MJCF poses such as ``home`` or ``rest``.
        model_cameras: Cameras compiled as part of this robot model.
        model_sensors: Sensors compiled as part of this robot model.
    """

    index: int
    """Current scene command address passed as ``robot=`` to control methods."""
    id: str
    """Stable robot identity while the current scene instance remains loaded."""
    name: str
    """Human-readable robot model or scene-instance name."""
    dof: int
    """Number of controllable arm joints, excluding gripper joints."""
    joint_names: list[str] = field(default_factory=list)
    """Joint names in the exact order expected by commands and telemetry."""
    joint_limits: list[Optional[list[float]]] = field(default_factory=list)
    """Per-joint ``[lower, upper]`` limits in radians, or ``None`` if unlimited."""
    home: list[float] = field(default_factory=list)
    """Model-defined home joint target in radians and command order."""
    has_gripper: bool = False
    """Whether the robot exposes a gripper supported by `Robot.gripper`."""
    locomotion: str = "arm"
    """Capability label such as ``"arm"``, ``"mobile"``, or ``"aerial"``."""
    base_dof: int = 0
    """Number of supported mobile or aerial base degrees of freedom."""
    category: str = "custom"
    """Sim2Bot catalog category such as ``arm`` or ``mobile-base``."""
    manufacturer: str = ""
    """Authored robot manufacturer, if declared by the model package."""
    license: str = ""
    """SPDX licence identifier for the model package, if declared."""
    source_url: str = ""
    """Upstream source URL for the model package, if declared."""
    source_revision: str = ""
    """Pinned upstream source revision, if declared."""
    snapshot_digest: str = ""
    """SHA-256 identity of the exact bundled model snapshot, if available."""
    capabilities: list[str] = field(default_factory=list)
    """Verified Sim2Bot capability labels for this model."""
    arm_actuators: list[str] = field(default_factory=list)
    """Authored arm actuator names in command order."""
    gripper_actuators: list[str] = field(default_factory=list)
    """Authored gripper actuator names."""
    tcp_sites: list[str] = field(default_factory=list)
    """Authored TCP site candidates in preference order."""
    end_effector_bodies: list[str] = field(default_factory=list)
    """Authored end-effector body candidates in preference order."""
    keyframes: list[str] = field(default_factory=list)
    """Named MJCF keyframe poses exposed by the robot."""
    model_cameras: list[str] = field(default_factory=list)
    """Camera names compiled as part of this robot model."""
    model_sensors: list[str] = field(default_factory=list)
    """Sensor names compiled as part of this robot model."""
    variant: str = ""
    """Selected end-effector/model variant label, if applicable."""

    @classmethod
    def from_json(cls, data: dict) -> "RobotInfo":
        return cls(
            index=int(data.get("index", 0)),
            id=str(data.get("id") or ""),
            name=str(data.get("name", "")),
            dof=int(data.get("dof", 0)),
            joint_names=list(data.get("jointNames", []) or []),
            joint_limits=list(data.get("jointLimits", []) or []),
            home=list(data.get("home", []) or []),
            has_gripper=bool(data.get("hasGripper", False)),
            locomotion=str(data.get("locomotion", "arm")),
            base_dof=int(data.get("baseDof", 0)),
            category=str(data.get("category") or "custom"),
            manufacturer=str(data.get("manufacturer") or ""),
            license=str(data.get("license") or ""),
            source_url=str(data.get("sourceUrl") or ""),
            source_revision=str(data.get("sourceRevision") or ""),
            snapshot_digest=str(data.get("snapshotDigest") or ""),
            capabilities=list(data.get("capabilities", []) or []),
            arm_actuators=list(data.get("armActuators", []) or []),
            gripper_actuators=list(data.get("gripperActuators", []) or []),
            tcp_sites=list(data.get("tcpSites", []) or []),
            end_effector_bodies=list(data.get("endEffectorBodies", []) or []),
            keyframes=list(data.get("keyframes", []) or []),
            model_cameras=list(data.get("modelCameras", []) or []),
            model_sensors=list(data.get("modelSensors", []) or []),
            variant=str(data.get("variant") or ""),
        )

Practical examples

Examples use objects discovered from the current scene rather than hard-coded robot metadata.

Inspect capabilities

arm = sim.describe()[0]
print(arm.dof, arm.has_gripper, arm.locomotion)

Pair names with limits

for name, limits in zip(arm.joint_names, arm.joint_limits):
    print(name, limits)

Guidance

Usage tip

Use index for current commands and id for correlating a specific scene instance in your application.


See also