Features
Behavior
Behavior-related features for managing robot state and known entities.
- class pymirokai.features.abilities.behavior.Behavior
Bases:
objectClass 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
Locationmodels.- 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:
objectGeneric 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_truecommand is not part of v2. This method now evaluates truthiness againstlist_facts_and_fluentsentries.- 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:
objectClass 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
levelis outside the[0, 100]range.
Runes
Rune interaction features for detecting and associating physical rune markers.
- class pymirokai.features.abilities.runes.Runes
Bases:
objectRune-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. Whenrune_idisNone, it queries global rune visibility. Whenrune_idis 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:
objectGeneric, 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,
resultmaps 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"}.
- The response from the REST API. On success,
- 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;
resultis 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:
objectGeneric 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;
resultis a list of {"predicate": str, "args": list[str], "value": Any}.
- The response from the REST API;
- 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;
resultis a list of {"identifier": str, "label": str, "type": str}.
- The response from the REST API;
- 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;
resultis {"predicates": list[str], "types": list[str]}.
- The response from the REST API;