Implementation:ARISE Initiative Robosuite Load Composite Controller Config
Metadata
| Property | Value |
|---|---|
| sources | robosuite |
| domains | Robotics_Simulation, Control_Systems |
| last_updated | 2026-02-15 12:00 GMT |
Overview
Concrete tool for loading composite controller configurations from JSON files provided by the robosuite controller factory module.
Description
The load_composite_controller_config function is the primary utility for loading controller configuration dictionaries from JSON files in the robosuite framework. It provides two modes of operation:
Controller Name Mode: Load a predefined composite controller configuration by name (e.g., "BASIC", "WHOLE_BODY_IK", "HYBRID_MOBILE_BASE"). These configurations are stored in robosuite/controllers/config/default/composite/ and represent standard control strategies.
Robot Name Mode: Load the default controller configuration for a specific robot (e.g., "Panda", "UR5e", "Tiago"). These robot-specific configurations are stored in robosuite/controllers/config/robots/ and are tailored to each robot's physical structure.
The function handles both absolute file paths and relative names, automatically resolving paths within the robosuite package structure. It returns a dictionary containing the controller type, part controller specifications, and all necessary parameters for controller instantiation.
Usage
Import this function when configuring a robot's control strategy before environment creation. The returned configuration dictionary is passed as the controller_configs keyword argument to robosuite.make().
This function should be called during the environment setup phase, before any simulation steps are executed. The loaded configuration determines how the robot interprets actions and computes control signals throughout the episode.
Code Reference
| Property | Value |
|---|---|
| Source | robosuite (https://github.com/ARISE-Initiative/robosuite) |
| File | robosuite/controllers/composite/composite_controller_factory.py |
| Lines | L73-138 |
Signature
def load_composite_controller_config(controller: Optional[str] = None, robot: Optional[str] = None) -> Optional[Dict]:
"""
Utility function that loads the desired composite controller and returns the loaded configuration as a dict
Args:
controller: Name or path of the controller to load. If specified, will load the composite controller
configuration from the default composite controller config directory. Can be either:
- Controller name (e.g., "BASIC", "WHOLE_BODY_IK")
- Absolute path to a JSON config file
- Relative path within the robosuite package
robot: Name of the robot to load the controller for. If specified, will load the default controller
configuration for this specific robot from the robots config directory.
Returns:
dict: Controller configuration dictionary containing:
- "type": Composite controller type (e.g., "BASIC")
- "body_parts": Dict mapping part names to part controller configs
- Additional controller-specific parameters
None: If neither controller nor robot is specified
Raises:
FileNotFoundError: If the specified controller configuration file is not found
ValueError: If both controller and robot are specified (mutually exclusive)
"""
Import
from robosuite.controllers.composite.composite_controller_factory import load_composite_controller_config
I/O Contract
| Parameter | Type | Required | Description |
|---|---|---|---|
| controller | Optional[str] | No | Controller name (e.g., "BASIC", "WHOLE_BODY_IK") or path to controller configuration file |
| robot | Optional[str] | No | Robot name (e.g., "Panda", "UR5e", "Tiago") for default controller lookup |
Outputs:
| Return Type | Description |
|---|---|
| Optional[Dict] | Controller configuration dictionary containing composite controller type, body part mappings, and controller parameters. Returns None if neither controller nor robot is specified. |
Usage Examples
Example 1: Load by Controller Name
Load a predefined composite controller configuration by name.
from robosuite.controllers.composite.composite_controller_factory import load_composite_controller_config
# Load the BASIC composite controller configuration
config = load_composite_controller_config(controller="BASIC")
print(f"Controller type: {config['type']}")
print(f"Body parts: {list(config['body_parts'].keys())}")
# Output:
# Controller type: BASIC
# Body parts: ['arm_0', 'gripper_0']
Example 2: Load by Robot Name
Load the default controller configuration for a specific robot.
from robosuite.controllers.composite.composite_controller_factory import load_composite_controller_config
# Load the default controller configuration for the Panda robot
config = load_composite_controller_config(robot="Panda")
print(f"Controller type: {config['type']}")
# Examine arm controller settings
arm_config = config['body_parts']['arm_0']
print(f"Arm controller type: {arm_config['controller_type']}")
print(f"Arm control dimensions: {arm_config['controller_config']['control_dim']}")
# Output:
# Controller type: BASIC
# Arm controller type: OSC_POSE
# Arm control dimensions: 6
Example 3: Load and Pass to robosuite.make
Complete workflow demonstrating how to load a controller configuration and use it to create an environment.
import robosuite as suite
from robosuite.controllers.composite.composite_controller_factory import load_composite_controller_config
# Load controller configuration
controller_config = load_composite_controller_config(controller="WHOLE_BODY_IK")
# Optionally modify controller parameters
controller_config['body_parts']['arm_0']['controller_config']['kp'] = 150 # Adjust position gain
# Create environment with configured controller
env = suite.make(
env_name="Lift",
robots="Panda",
controller_configs=controller_config,
has_renderer=True,
has_offscreen_renderer=False,
use_camera_obs=False,
)
# Reset environment and run simulation
env.reset()
for i in range(1000):
action = env.action_spec[0].sample() # Sample random action
obs, reward, done, info = env.step(action)
env.render()
if done:
env.reset()
env.close()