Features

Behavior

Behavior-related features for managing robot state and known entities.

class pymirokai.features.abilities.behavior.Behavior

Bases: object

Class to handle behavior-related features of the robot.

async entity_id_to_label(entity_id)

Get the label for a given entity ID.

Parameters:

entity_id (str) – The ID of the entity for which to retrieve the label.

Return type:

str | None

Returns:

str | None – The label of the entity, or None if not found.

Raises:

ValueError – If the API response does not contain a location list.

exit_arms_collision()

Exit current arms collision.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API.

async list_all_entities_from_type(type)

List all known entities for a given ontology model type.

Parameters:

type (type[BaseModel]) – Model class used to decode entity identifiers.

Return type:

list[BaseModel]

Returns:

list[BaseModel] – Entities instantiated with their identifiers.

Raises:

ValueError – If the API response does not contain an entity list.

async list_all_locations()

List all the currently known locations by the robot.

Return type:

list[Location]

Returns:

list[Location] – Known locations as lightweight Location models.

Raises:

ValueError – If the API response does not contain a location list.

Generic

Generic feature interface for robot configuration and knowledge queries.

class pymirokai.features.abilities.generic.Generic

Bases: object

Generic read-oriented robot abilities.

get_character_name()

Get the current character name.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_language()

Get the current language setting.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_publishers()

Get the list of available publishers.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The list of available publishers.

is_pddl_condition_true(pddl_condition)

Check whether a simple PDDL atom currently holds true.

The legacy is_condition_true command is not part of v2. This method now evaluates truthiness against list_facts_and_fluents entries.

Parameters:

pddl_condition (str) – The PDDL condition to evaluate.

Return type:

bool

Returns:

bool – True if the condition is satisfied, False otherwise.

pretty_print_facts_and_fluents()

Render all facts and fluents in a human-readable format.

Return type:

str

Returns:

str – A string containing the pretty-printed facts and fluents.

Interaction

Interaction-related features for robot perception and human-robot interaction.

class pymirokai.features.abilities.interaction.Interaction

Bases: object

Class to handle interaction-related features of the robot.

async autonomous_planning_output()

Return the last autonomous planning result.

Return type:

str

Returns:

str – The last autonomous planning result.

get_human_neck_roll()

Get the human neck roll angle.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API.

get_humans_relative_positions()

Get humans positions relative to the robot.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API.

get_perceived_emotions()

Retrieve the current emotional state perceived by the robot.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API containing perceived emotions.

is_seeing_handle()

Check if the robot is seeing a handle.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_seeing_human()

Check if the robot is seeing a human.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_sleeping()

Check if the robot is sleeping.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

async pddl_domain()

Return the robot’s current PDDL domain definition.

The domain describes the available actions, predicates, and structure used by the autonomous planner.

Return type:

str

Returns:

str – The current PDDL domain, formatted as a string.

async pddl_problem()

Return the robot’s current PDDL problem definition.

The problem defines the specific goals, objects, and initial conditions for the autonomous planner to solve using the domain.

Return type:

str

Returns:

str – The current PDDL problem, formatted as a string.

set_actions_by_voice(enabled)

Activate or deactivate the trigger by voice.

Parameters:

enabled (bool) – True to enable, False to disable.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

set_sound_level(level)

Set the sound level of the robot.

Parameters:

level (int) – The sound level (0-100).

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API.

Raises:

ValueError – If level is outside the [0, 100] range.

Navigation

Navigation-related features for motion control and stability management.

class pymirokai.features.abilities.navigation.Navigation

Bases: object

Class to handle navigation-related features of the robot.

set_robot_max_velocity(percentage)

Set the maximum velocity at which the robot can operate.

Parameters:

percentage (float) – The maximum velocity in percent.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

toggle_balancing(value)

Set balancing state to the current value.

True to activate balancing, False to deactivate.

This state is available with the websocket topic “is_balancing”.

Parameters:

value (bool) – True to activate the balancing, False to deactivate.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API.

Runes

Rune interaction features for detecting and associating physical rune markers.

class pymirokai.features.abilities.runes.Runes

Bases: object

Rune-oriented ability methods exposed on pymirokai.robot.Robot.

get_all_runes_details()

Get details on all detected runes.

Each entry may include rune identifier, RSSI, and horizontal/vertical angle of arrival metadata when available.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API.

get_clicked_runes()

Get a list of all clicked runes.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_detected_runes()

Get a list of all detected runes.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_double_clicked_runes()

Get a list of all double-clicked runes.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_long_pressed_runes()

Get a list of all long-pressed runes.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_rune_angle_of_arrival(rune_id)

Get the angle of arrival of a rune.

Parameters:

rune_id (str) – The ID of the rune to check.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

get_rune_rssi(rune_id)

Get the RSSI of a rune.

Parameters:

rune_id (str) – The ID of the rune to check.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_clicked(rune_id)

Check if a rune has been clicked.

Parameters:

rune_id (str) – The ID of the rune to check.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_detected(rune_id)

Check if a rune has been detected.

Parameters:

rune_id (str) – The ID of the rune to check.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_double_clicked(rune_id)

Check if a rune has been double-clicked.

Parameters:

rune_id (str) – The ID of the rune to check.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_long_pressed(rune_id)

Check if a rune has been long-pressed.

Parameters:

rune_id (str) – The ID of the rune to check.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

is_seeing(rune_id=None)

Check whether rune(s) are currently seen.

This method keeps backward compatibility with the historical is_seeing(rune_id) usage. When rune_id is None, it queries global rune visibility. When rune_id is provided, it performs a rune-specific visibility check through the dedicated v2 route.

Parameters:

rune_id (str | None) – Optional rune identifier for a targeted query.

Return type:

dict[str, Any]

Returns:

Dict[str, Any] – The response from the REST API.

rune_association(rune_id, virtual_id='', label='', description='', rune_class='')

Associate metadata with a rune.

Parameters:
  • rune_id (str) – The unique ID of the rune.

  • virtual_id (str) – The virtual ID to assign.

  • label (str) – The display label for the rune.

  • description (str) – A brief description of the rune.

  • rune_class (str) – The classification of the rune.

Return type:

dict[str, str]

Returns:

dict[str, str] – The REST API response.

ECS Knowledge

Generic remote view onto the robot’s ECS Knowledge (world state).

class pymirokai.features.ecs_knowledge.ECSKnowledge(robot)

Bases: object

Generic, filterable remote view onto the robot’s ECS Knowledge.

Unlike the rest of the abilities, which are one bespoke REST command per fact, this queries ECS entities and components generically by name, so it supports any component type the robot knows about without pymirokai needing to know about it ahead of time. Exposed as Robot.ecs_knowledge.

Parameters:

robot (Any)

dump(path_prefix='', component_types=None, entities_only=False)

Snapshot ECS entities and their components.

Parameters:
  • path_prefix (str) – Only include entities whose identifier starts with this prefix.

  • component_types (list[str] | None) – Names of component classes an entity must ALL have to be included (intersection, not a union), e.g. ["IsVisible", "Human"]. Unknown names are ignored. Defaults to every known component type, in which case an entity is included as soon as it has any of them. Ignored when entities_only is set.

  • entities_only (bool) – List matching entities without reading any component, e.g. to watch for entity creation/destruction only.

Return type:

dict[str, Any]

Returns:

dict[str, Any] –

The response from the REST API. On success, result maps entity

identifier to a mapping of component type name to its string representation, e.g. {"human_0": {"IsVisible": "IsVisible(visible=True)"}}. In entities_only mode, each matching entity maps to {"exists": "True"}.

list_component_types()

List every component type name that can be passed to dump as a filter.

Return type:

dict[str, Any]

Returns:

dict[str, Any] – The response from the REST API; result is a sorted list of names.

PDDL Knowledge

Generic remote view onto the robot’s PDDL Knowledge (facts, fluents, entities).

class pymirokai.features.pddl_knowledge.PDDLKnowledge(robot)

Bases: object

Generic remote view onto the robot’s PDDL Knowledge.

Unlike the rest of the abilities, which are one bespoke REST command per fact, this exposes the whole current world state plus the full ontology (every predicate/function/entity-type name that COULD be used), with no fixed list of names on the client side. Exposed as Robot.pddl_knowledge.

Parameters:

robot (Any)

get_facts_and_fluents()

Get every currently-set fact and fluent, unfiltered.

Return type:

dict[str, Any]

Returns:

dict[str, Any] –

The response from the REST API; result is a list of

{"predicate": str, "args": list[str], "value": Any}.

list_entities()

List every entity known to the PDDL knowledge.

Return type:

dict[str, Any]

Returns:

dict[str, Any] –

The response from the REST API; result is a list of

{"identifier": str, "label": str, "type": str}.

list_ontology_names()

List every predicate/function and entity type name that could be used to filter.

Return type:

dict[str, Any]

Returns:

dict[str, Any] –

The response from the REST API; result is

{"predicates": list[str], "types": list[str]}.