Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Facebookresearch Habitat lab ArticulatedAgentBase

From Leeroopedia
Knowledge Sources
Domains Embodied_AI, Robot_Control
Last Updated 2026-02-15 00:00 GMT

Overview

ArticulatedAgentBase provides a generic base implementation for robots with a controllable base, handling URDF loading, joint motor management, base position/rotation control, and leg joint control.

Description

ArticulatedAgentBase extends ArticulatedAgentInterface to provide a concrete implementation for articulated robots in Habitat-Sim. It manages the full lifecycle of a simulated robot with a controllable base, including:

  • URDF Loading -- The reconfigure() method loads the robot from a URDF file via the simulator's articulated object manager, setting up the fixed/free base configuration and link order preservation for PyBullet compatibility.
  • Motor Management -- Configures joint motor settings for wheels and legs with specific position gains, velocity gains, and maximum impulse values. The motor settings cache is updated after reconfiguration for efficient future lookups.
  • Base Position/Rotation -- Properties base_pos and base_rot provide get/set access to the robot's ground position and Y-axis rotation angle. The position is computed using a configurable local offset from the origin, and rotation is represented as a scalar angle in the range (-pi, pi).
  • Leg Joint Control -- For leg-type robots, provides leg_motor_pos and leg_joint_pos properties for reading and writing leg motor targets and joint positions, with both kinematic and dynamic motor control support.
  • Input Validation -- The _validate_ctrl_input method ensures control inputs match joint dimensions and are not NaN.

The class supports two base types: "mobile" and "leg", with assertions enforcing valid type selection.

Usage

Use ArticulatedAgentBase as a parent class for specific robot implementations. It is inherited by MobileManipulator (combined with Manipulator) to create robots with both controllable bases and arms. It should not typically be instantiated directly.

Code Reference

Source Location

Signature

class ArticulatedAgentBase(ArticulatedAgentInterface):
    def __init__(
        self,
        params,
        urdf_path: str,
        sim: Simulator,
        limit_robo_joints: bool = True,
        fixed_based: bool = True,
        maintain_link_order=False,
        base_type="mobile",
        sim_obj=None,
        **kwargs,
    ):

Import

from habitat.articulated_agents.articulated_agent_base import (
    ArticulatedAgentBase,
)

I/O Contract

Inputs

Name Type Required Description
params object Yes Parameter object for the articulated agent (e.g., MobileManipulatorParams)
urdf_path str Yes Path to the articulated agent's URDF file
sim Simulator Yes The Habitat-Sim simulator instance
limit_robo_joints bool No (default=True) Whether to enforce joint limits
fixed_based bool No (default=True) Whether the robot's base is fixed
maintain_link_order bool No (default=False) Whether to preserve URDF link order for PyBullet compatibility
base_type str No (default="mobile") Base type, must be "mobile" or "leg"
sim_obj object No (default=None) Pointer to an existing simulated articulated object

Outputs

Name Type Description
base_pos mn.Vector3 The robot base ground position (property)
base_rot float Scalar rotation angle around Y axis in radians (property)
base_transformation mn.Matrix4 The full 4x4 transformation matrix of the sim object (property)
leg_joint_pos List[float] Current leg joint positions (property, leg-type only)
leg_motor_pos np.ndarray Current leg motor target positions (property, leg-type only)

Usage Examples

Basic Usage

import magnum as mn
from habitat.articulated_agents.articulated_agent_base import ArticulatedAgentBase

# ArticulatedAgentBase is typically used as a parent class.
# In MobileManipulator, it is initialized as:
ArticulatedAgentBase.__init__(
    self,
    urdf_path=agent_cfg.articulated_agent_urdf,
    params=params,
    sim=sim,
    limit_robo_joints=True,
    fixed_based=True,
    sim_obj=self.sim_obj,
    base_type="mobile",
)

# After reconfigure(), access base properties:
# position = agent.base_pos
# agent.base_pos = mn.Vector3(1.0, 0.0, 2.0)
# rotation = agent.base_rot
# agent.base_rot = 1.57  # radians

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment