Skip to content

sim2bot.Robot.stop

stop(robot: int = 0) -> None

Hold one robot at its current joint pose.

Parameters:

  • robot (int, default: 0 ) –

    Robot index returned by describe.

Returns:

  • None

    The simulator receives a hold-position command.

Raises:

  • RuntimeError

    If the client is not connected.

  • ConnectionClosed

    If the WebSocket closes while sending the command.

  • OSError

    If the selected transport cannot send the command.

Notes

This replaces active velocity, TCP, or trajectory control for the addressed robot. It is a simulation hold command, not an emergency stop certified for real hardware.

Source code in sim2bot/client.py
def stop(self, robot: int = 0) -> None:
    """Hold one robot at its current joint pose.

    Args:
        robot: Robot index returned by
            [`describe`][sim2bot.client.Robot.describe].

    Returns:
        The simulator receives a hold-position command.

    Raises:
        RuntimeError: If the client is not connected.
        ConnectionClosed: If the WebSocket closes while sending the command.
        OSError: If the selected transport cannot send the command.

    Notes:
        This replaces active velocity, TCP, or trajectory control for the
        addressed robot. It is a simulation hold command, not an emergency
        stop certified for real hardware.
    """
    self._send({"type": "stop", "robot": robot})

Practical examples

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

Stop one robot

sim.stop(robot=arm.index)

Guarantee cleanup after streamed control

try:
    run_velocity_controller(sim, arm)
finally:
    sim.stop(robot=arm.index)

Guidance

Usage tip

Use stop() to end SDK velocity, TCP, or trajectory control without resetting the rest of the scene.

Important behavior

This is a simulation hold command, not a hardware emergency stop.


See also