Implementation:ARISE Initiative Robosuite CheckCustomRobotModel
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Robot Configuration, Validation |
| Last Updated | 2026-02-15 07:00 GMT |
Overview
The check_custom_robot_model script validates a custom robot model's XML definition and registration against robosuite conventions, checking joint naming, body part detection, and gripper mount points.
Description
This script provides validation utilities for custom robot models being integrated into robosuite. It operates in two modes: checking a registered robot by name (using --robot) or checking a raw MuJoCo XML file (using --robot-xml-file).
The check_xml_definition function parses the robot's XML to identify and categorize joints by body part based on naming conventions. It looks for joints containing keywords "torso", "head", "leg", "gripper", and "base", with all remaining joints classified as "arm" joints. It verifies that the total count of categorized joints matches the actual number of joints in the XML, reports which body parts were detected, and lists the joints for each part.
The check_registered_robot function goes further by loading the robot through robosuite's Robot class with a BASIC controller configuration, verifying the model loads successfully, checking the order of arm joints (right arm joints must be defined before left arm joints), and verifying that the gripper mounting bodies exist in the worldbody. It issues warnings if arm joints appear to be defined in the wrong order (left before right).
Usage
Use this script when developing a custom robot model for robosuite to validate that joint naming conventions are correct, body parts are properly detected, and gripper mount points are defined. Run it before attempting to use the robot in simulation environments.
Code Reference
Source Location
- Repository: ARISE_Initiative_Robosuite
- File: robosuite/scripts/check_custom_robot_model.py
Signature
def check_xml_definition(root) -> dict
def check_registered_robot(robot_name) -> None
Import
# This is a standalone script, typically run from the command line:
# python robosuite/scripts/check_custom_robot_model.py --robot MyCustomRobot
# python robosuite/scripts/check_custom_robot_model.py --robot-xml-file path/to/robot.xml
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| --robot | str | No | Name of a registered robot to validate |
| --robot-xml-file | str | No | Path to a robot XML file to validate (at least one of --robot or --robot-xml-file is required) |
Outputs
| Name | Type | Description |
|---|---|---|
| parts_dict | dict | Dictionary mapping body part names to lists of joint names |
| Console output | str | Validation results including detected body parts, joint counts, and any warnings |
Usage Examples
# Validate a registered robot
# python robosuite/scripts/check_custom_robot_model.py --robot GR1
# Validate a robot XML file
# python robosuite/scripts/check_custom_robot_model.py --robot-xml-file robots/my_robot/robot.xml
# Expected output:
# Loading GR1 ...
# Successfully found the defined robot
# Successfully loaded the xml file of robot model.
# Your joint definition aligns with robosuite convention.
# Robosuite will be able to detect the following body parts: ['torso', 'head', 'leg', 'arm']
# For each body part, you have defined the following joints:
# torso - 3 joints: [...]
# head - 2 joints: [...]