Robot Model

The RobotModel class serves as a direct intermediary class that reads in information from a corresponding robot XML file and also contains relevant hard-coded information from that XML. In conjunction with the GripperModel class, this serves as the core modeling component of the higher-level Robot class used in simulation.

Base Robot Model

class robosuite.models.robots.robot_model.RobotModel(fname, idn=0, bottom_offset=0, 0, 0)

Base class for all robot models.

Parameters
  • fname (str) – Path to relevant xml file from which to create this robot instance

  • idn (int or str) – Number or some other unique identification string for this robot instance

  • bottom_offset (3-array of float) – x,y,z offset desired from initial coordinates

add_gripper(gripper, arm_name=None)

Mounts gripper to arm.

Throws error if robot already has a gripper or gripper type is incorrect.

Parameters
  • gripper (MujocoGripper) – gripper MJCF model

  • arm_name (str) – name of arm mount – defaults to self.eef_name if not specified

Raises
  • ValueError – [Multiple grippers]

  • XMLError – [No / invalid actuator]

set_base_xpos(pos)

Places the robot on position @pos.

Parameters

pos (3-array) – (x,y,z) position to place robot base

set_base_ori(rot)

Rotates robot by rotation @rot from its original orientation.

Parameters

rot (3-array) – (r,p,y) euler angles specifying the orientation for the robot base

set_joint_attribute(attrib, values)

Sets joint attributes, e.g.: friction loss, damping, etc.

Parameters
  • attrib (str) – Attribute to set for all joints

  • values (n-array) – Values to set for each joint

Raises

AssertionError – [Inconsistent dimension sizes]

correct_naming(names)

Corrects all xml names by adding the naming prefix to it and returns the name-corrected values

Parameters

names (str, list, or dict) – Name(s) to be corrected

Raises

TypeError – [Invalid input type]

property naming_prefix

Generates a standardized prefix to append to all xml names to prevent naming collisions

Returns

Prefix unique to this robot based on its ID

Return type

str

property joints

Returns: list: Prefix-adjusted joint names for this robot

property eef_name

Returns: str: Prefix-adjusted eef name for this robot

property robot_base

Returns: str: Prefix-adjusted base name for this robot

property actuators

Returns: list: Prefix-adjusted actuator names for this robot

property contact_geoms

Returns: list: Prefix-adjusted contact geom names for this robot

property dof

Defines the number of DOF of the robot

Returns

robot DOF

Return type

int

property gripper

Defines the default gripper type for this robot that gets added to end effector

Returns

Default gripper name to add to this robot

Return type

str

property default_controller_config

Defines the name of default controller config file in the controllers/config directory for this robot.

Returns

filename of default controller config for this robot

Return type

str

property init_qpos

Defines the default rest qpos of this robot

Returns

Default init qpos of this robot

Return type

np.array

property base_xpos_offset

Defines the dict of various (x,y,z) tuple offsets relative to specific arenas placed at (0,0,0) Assumes robot is facing forwards (in the +x direction) when determining offset. Should have entries for each arena case; i.e.: “bins”, “empty”, and “table”)

Returns

‘bins’

(x,y,z) robot offset if placed in bins arena

’empty’

(x,y,z) robot offset if placed in the empty arena

’table’

lambda function that takes in table_length and returns corresponding (x,y,z) offset if placed in the table arena

Return type

dict

property arm_type

Type of robot arm. Should be either “bimanual” or “single” (or something else if it gets added in the future)

Returns

Type of robot

Return type

str

property _root

Root name of the mujoco xml body. Note that these are the raw string names directly pulled from a robot’s corresponding XML file, NOT the adjusted name with an auto-generated naming prefix

Returns

Raw XML root name for this robot

Return type

str

List of xml link names for this robot. Note that these are the raw string names directly pulled from a robot’s corresponding XML file, NOT the adjusted name with an auto-generated naming prefix

Returns

Raw XML link names for this robot

Return type

list