MoveCommand

class pyniryo_nate.components.MoveCommand(robot: Robot, command_id: str, timeout: float, callbacks: List[Callable[[MoveFeedback], None]])[source]

Bases: BaseCommand

Represents a move command and tracks its execution progress.

This class monitors the state of a robot movement operation, receiving feedback through MQTT and allowing you to wait for completion.

Attributes

command_id

Get the command ID of the command.

state

Get the current state of the move command.

Methods

pause

resume

stop

wait

Wait for the move command to complete.

Parameters:
  • robot (Robot)

  • command_id (str)

  • timeout (float)

  • callbacks (List[Callable[[MoveFeedback], None]])

property state: MoveState

Get the current state of the move command.

Returns:

The current state of the move command.

wait() → None[source]

Wait for the move command to complete. A timeout of zero or less waits indefinitely. The timeout counts from the moment the command was sent. A paused move keeps waiting until it is resumed.

Raises:
  • TimeoutError – If the timeout is exceeded.

  • PyNiryoError – If the execution fails.

Return type:

None

pause() → None[source]
Return type:

None

resume() → None[source]
Return type:

None

stop() → None[source]
Return type:

None