Implementation:Facebookresearch Habitat lab ArticulatedAgentInterface
| Knowledge Sources | |
|---|---|
| Domains | Embodied_AI, Robot_Control |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
ArticulatedAgentInterface is an abstract base class that defines the standard API for all articulated robot agents in Habitat, including methods for update, reset, reconfigure, and motor management.
Description
ArticulatedAgentInterface serves as the top-level abstract interface for all robot types in Habitat's articulated agent system. It inherits from Python's ABC (Abstract Base Class) and establishes the contract that all robot implementations must follow.
The interface provides:
- Abstract methods --
update(),reset(), andreconfigure()are declared as abstract methods that subclasses must implement. These handle runtime state updates, joint/motor resets, and scene instantiation respectively.
- Concrete utility methods:
get_robot_sim_id()-- Returns the unique simulator object ID for the robot.get_link_and_joint_names()-- Returns a formatted string listing all robot link and joint names with their types, useful for debugging._update_motor_settings_cache()-- Caches joint motor settings from the simulator for efficient future access._validate_joint_idx(joint)-- Validates that a joint index exists in the motor cache._get_motor_pos(joint)/_set_motor_pos(joint, ctrl)-- Gets or sets a motor's position target._capture_articulated_agent_state()-- Captures the current forces, velocities, and positions of all joints.
The class wraps a ManagedBulletArticulatedObject from Habitat-Sim, initialized to None and set during reconfiguration.
Usage
Use ArticulatedAgentInterface as the base class when creating new types of articulated agents. All concrete robot classes (ArticulatedAgentBase, Manipulator, MobileManipulator, StaticManipulator) ultimately implement this interface.
Code Reference
Source Location
- Repository: Facebookresearch_Habitat_lab
- File: habitat-lab/habitat/articulated_agents/articulated_agent_interface.py
- Lines: 1-76
Signature
class ArticulatedAgentInterface(ABC):
def __init__(self):
Import
from habitat.articulated_agents.articulated_agent_interface import (
ArticulatedAgentInterface,
)
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | -- | -- | The constructor takes no parameters; sim_obj is set during reconfiguration |
Outputs
| Name | Type | Description |
|---|---|---|
| get_robot_sim_id() | int | The unique simulator object ID for this robot |
| get_link_and_joint_names() | str | Formatted string of all link IDs, names, joint names, and joint types |
| _capture_articulated_agent_state() | Dict | Dictionary with keys "forces", "vel", "pos" containing joint state arrays |
Abstract Methods
| Method | Description |
|---|---|
update() |
Updates internal properties such as camera transforms, joint limits, and sleep states |
reset() |
Resets joint and motor states of the robot |
reconfigure() |
Instantiates the robot in the scene by loading URDF and setting initial state |
Usage Examples
Basic Usage
from habitat.articulated_agents.articulated_agent_interface import (
ArticulatedAgentInterface,
)
# ArticulatedAgentInterface is an abstract class.
# Implement it by subclassing:
class MyRobot(ArticulatedAgentInterface):
def update(self):
# Update camera transforms, check joint limits
pass
def reset(self):
# Reset joints and motors to initial state
pass
def reconfigure(self):
# Load URDF and configure the robot in the scene
pass
# After instantiation and reconfiguration:
# robot = MyRobot()
# robot.reconfigure()
# sim_id = robot.get_robot_sim_id()
# debug_info = robot.get_link_and_joint_names()