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:ARISE Initiative Robosuite Robot Base

From Leeroopedia
Knowledge Sources
Domains Robotics, Simulation
Last Updated 2026-02-15 07:00 GMT

Overview

The Robot class is the abstract base class for all simulated robot agents in robosuite, providing the core interface for robot model loading, controller management, state observation, and simulation control.

Description

The Robot class serves as the foundational abstraction for all robot types in the robosuite framework. It encapsulates the complete lifecycle of a simulated robot including model loading from MJCF/XML definitions, gripper attachment, controller initialization, joint reference setup, and proprioceptive observable creation. The class manages robot state through MuJoCo simulation bindings and provides a standardized interface for action execution and sensor data retrieval.

At initialization, the class accepts a robot type identifier (e.g., "Panda"), an optional composite controller configuration, initial joint positions, initialization noise parameters, base type, gripper type, and control frequency. It maintains internal dictionaries keyed by arm identifiers ("right", "left") for gripper references, end-effector site IDs, rotation offsets, and recent force-torque/pose/velocity buffers. The class uses DeltaBuffer and RingBuffer objects to track recent proprioceptive values for each arm.

Key design patterns include the use of _input2dict to normalize single-value or list inputs into per-arm dictionaries, composite controller delegation for action splitting and execution, and a sensor/observable system that wraps MuJoCo state queries with the @sensor decorator for modular observation pipelines. Subclasses (e.g., FixedBaseRobot, MobileRobot) must implement _load_controller, control, and action_limits.

Usage

This class is not instantiated directly. Instead, use one of its concrete subclasses such as FixedBaseRobot, WheeledRobot, or LeggedRobot. It is used internally by robosuite environments when constructing robot instances through the environment's robot configuration. Extend this class when adding a new robot locomotion type.

Code Reference

Source Location

Signature

class Robot(object):
    def __init__(
        self,
        robot_type: str,
        idn=0,
        composite_controller_config=None,
        initial_qpos=None,
        initialization_noise=None,
        base_type="default",
        gripper_type="default",
        control_freq=20,
        lite_physics=True,
    ): ...

    def load_model(self): ...
    def reset(self, deterministic=False, rng=None): ...
    def setup_references(self): ...
    def setup_observables(self) -> OrderedDict: ...
    def control(self, action, policy_step=False): ...
    def check_q_limits(self) -> bool: ...
    def pose_in_base_from_name(self, name) -> np.array: ...
    def set_robot_joint_positions(self, jpos): ...
    def create_action_vector(self, action_dict) -> np.array: ...

Import

from robosuite.robots.robot import Robot

I/O Contract

Inputs

Name Type Required Description
robot_type str Yes Specification for the specific robot to instantiate (e.g., "Panda", "Sawyer")
idn int or str No Unique ID of this robot instance, used to distinguish multiple robots
composite_controller_config dict or None No Configuration dict for the composite controller. If None, loads default config for the robot type
initial_qpos sequence of float or None No Initial joint positions. If None, uses defaults from the robot model
initialization_noise dict or None No Dict with 'magnitude' (float) and 'type' ('gaussian' or 'uniform') keys for joint noise
base_type str No Type of base model. "default" uses the robot's default base; None means no base
gripper_type str or None No Type of gripper. "default" uses the robot's default; None means no gripper
control_freq float No Control frequency in Hz (default: 20)
lite_physics bool No Whether to use lite physics mode (default: True)

Outputs

Name Type Description
robot_model RobotModel The loaded robot model object with MJCF representation
action_dim int Dimensionality of the action space (property)
action_limits tuple of np.array Low and high action limits per dimension (property)
dof int Active degrees of freedom of the robot (property)
ee_force dict Per-arm end-effector force sensor readings (property)
ee_torque dict Per-arm end-effector torque sensor readings (property)
js_energy np.array Energy consumed by each joint between steps (property)

Usage Examples

# Robots are typically created through environment configuration, not directly.
# Example of how the robot is used within an environment:
import robosuite as suite

env = suite.make(
    "Lift",
    robots="Panda",                   # robot_type
    gripper_types="default",          # gripper_type
    controller_configs=None,          # uses default composite_controller_config
    control_freq=20,
)

# After environment creation, the robot object is accessible:
robot = env.robots[0]

# Query joint positions
joint_positions = robot.get_robot_joint_positions()

# Check if robot is near joint limits
near_limits = robot.check_q_limits()

# Get end-effector pose in base frame
eef_pose = robot.pose_in_base_from_name(robot.robot_model.eef_name["right"])

# Create an action vector from a dictionary
action = robot.create_action_vector({"right": np.zeros(7), "right_gripper": np.zeros(1)})

Related Pages

Page Connections

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