habitat.sims.habitat_simulator.object_state_machine module

This module implements a singleton state-machine architecture for representing and managing non-geometric object states via metadata manipulation. For example, tracking and manipulating state such as “powered on” or “clean vs dirty”. This interface is intended to provide a foundation which can be extended for downstream applications.

Classes

class BooleanObjectState
Abstract ObjectStateSpec base class for boolean type states. Defines some standard handling for boolean states.
class ObjectIsClean
ObjectIsClean state specifies whether an object is clean or dirty.
class ObjectIsPoweredOn
State specifies whether an appliance object is powered on or off.
class ObjectStateMachine
Defines the logic for managing multiple states across all objects in the scene.
class ObjectStateSpec
Abstract base class for object states specifications. Defines the API for inherited and extended states.

Functions

def get_state_of_obj(obj: typing.Union[habitat_sim._ext.habitat_sim_bindings.ManagedArticulatedObject, habitat_sim._ext.habitat_sim_bindings.ManagedRigidObject], state_name: str) -> typing.Any
Try to get the specified state from an object’s “object_states” user_defined metadata.
def set_state_of_obj(obj: typing.Union[habitat_sim._ext.habitat_sim_bindings.ManagedArticulatedObject, habitat_sim._ext.habitat_sim_bindings.ManagedRigidObject], state_name: str, state_val: typing.Any) -> None
Set the specified state in an object’s “object_states” user_defined metadata.

Function documentation

def habitat.sims.habitat_simulator.object_state_machine.get_state_of_obj(obj: typing.Union[habitat_sim._ext.habitat_sim_bindings.ManagedArticulatedObject, habitat_sim._ext.habitat_sim_bindings.ManagedRigidObject], state_name: str) -> typing.Any

Try to get the specified state from an object’s “object_states” user_defined metadata.

Parameters
obj The ManagedObject.
state_name The name/key of the object state property to query.
Returns The state value (variable type) or None if not found.

def habitat.sims.habitat_simulator.object_state_machine.set_state_of_obj(obj: typing.Union[habitat_sim._ext.habitat_sim_bindings.ManagedArticulatedObject, habitat_sim._ext.habitat_sim_bindings.ManagedRigidObject], state_name: str, state_val: typing.Any) -> None

Set the specified state in an object’s “object_states” user_defined metadata.

Parameters
obj The ManagedObject.
state_name The name/key of the object state property to set.
state_val The value of the object state property to set.