robosuite.models.robots package#

Subpackages#

Submodules#

robosuite.models.robots.compositional module#

class robosuite.models.robots.compositional.PandaDexLH(idn=0)#

Bases: Panda

property default_gripper#

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

Returns:

(Default is no gripper; i.e.: empty dict)

Return type:

dict

property gripper_mount_pos_offset#

Define the custom offset of the gripper that is different from the one defined in xml. The offset will applied to the first body in the gripper definition file.

Returns:

Empty dictionary unless specified.

property gripper_mount_quat_offset#

Define the custom orientation offset of the gripper with respect to the arm. The offset will applied to the first body in the gripper definition file. Return empty dict by default unless specified. The quaternion is in the (w, x, y, z) format to match the mjcf format.

class robosuite.models.robots.compositional.PandaDexRH(idn=0)#

Bases: Panda

property default_gripper#

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

Returns:

(Default is no gripper; i.e.: empty dict)

Return type:

dict

property gripper_mount_pos_offset#

Define the custom offset of the gripper that is different from the one defined in xml. The offset will applied to the first body in the gripper definition file.

Returns:

Empty dictionary unless specified.

property gripper_mount_quat_offset#

Define the custom orientation offset of the gripper with respect to the arm. The offset will applied to the first body in the gripper definition file. Return empty dict by default unless specified. The quaternion is in the (w, x, y, z) format to match the mjcf format.

class robosuite.models.robots.compositional.PandaOmron(idn=0)#

Bases: Panda

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 manipulator 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 default_arms#
property default_base#

Defines the default mount type for this robot that gets added to root body (base)

Returns:

Default base name to add to 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 init_torso_qpos#
class robosuite.models.robots.compositional.SpotWithArm(idn=0)#

Bases: SpotArm

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 manipulator 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 default_arms#
property default_base#

Defines the default mount type for this robot that gets added to root body (base)

Returns:

Default base name to add to 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

class robosuite.models.robots.compositional.SpotWithArmFloating(idn=0)#

Bases: SpotArm

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 manipulator 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 default_arms#
property default_base#

Defines the default mount type for this robot that gets added to root body (base)

Returns:

Default base name to add to 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

robosuite.models.robots.robot_model module#

class robosuite.models.robots.robot_model.RobotModel(fname: str, idn=0)#

Bases: MujocoXMLModel

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

add_base(base: RobotBaseModel)#

Mounts a base to the robot. Bases are defined in robosuite.models.bases

add_leg_base(leg_base: LegBaseModel)#

Mounts @mobile_base to arm.

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

Parameters:

base (mobile) – mount MJCF model

Raises:

ValueError – [mobile base already added]

add_mobile_base(mobile_base: MobileBaseModel)#

Mounts @mobile_base to arm.

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

Parameters:

base (mobile) – mount MJCF model

Raises:

ValueError – [mobile base already added]

add_mount(mount: MountModel)#

Mounts @mount to arm.

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

Parameters:

mount (MountModel) – mount MJCF model

Raises:

ValueError – [mount already added]

property all_actuators: List#

Returns: list: (Default is no actuators; i.e.: empty list)

property all_joints: List#

Returns: list: (Default is no joints; i.e.: empty list)

property base_xpos_offset: Dict[str, ndarray]#

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:

Dict mapping arena names to robot offsets from the global origin (dict entries may also be lambdas

for variable offsets)

Return type:

dict

property bottom_offset: ndarray#

Returns vector from model root body to model bottom. By default, this is equivalent to this robot’s mount’s (bottom_offset - top_offset) + this robot’s base offset

Returns:

(dx, dy, dz) offset vector

Return type:

np.array

property contact_geom_rgba#

RGBA color to assign to all contact geoms for this model

Returns:

(r,g,b,a) values from 0 to 1 for this model’s set of contact geoms

Return type:

4-array

property default_base: str#

Defines the default mount type for this robot that gets added to root body (base)

Returns:

Default base name to add to this robot

Return type:

str

property default_controller_config: Dict[str, str]#

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

Returns:

Dictionary containing arm-specific default controller config names

e.g.: {“right”: “default_panda”, “left”: “default_panda”}

Return type:

dict

property dof: int#

Defines the number of DOF of the robot

Returns:

robot DOF

Return type:

int

property horizontal_radius: float#

Returns maximum distance from model root body to any radial point of the model. This method takes into account the mount horizontal radius as well

Returns:

radius

Return type:

float

property init_qpos: ndarray#

Defines the default rest qpos of this robot

Returns:

Default init qpos of this robot

Return type:

np.array

property models: List[MujocoXMLModel]#

Returns a list of all m(sub-)models owned by this robot model. By default, this includes the mount model, if specified

Returns:

models owned by this object

Return type:

list

property naming_prefix: str#

Generates a standardized prefix to prevent naming collisions

Returns:

Prefix unique to this model.

Return type:

str

set_base_ori(rot: ndarray)#

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_base_xpos(pos: ndarray)#

Places the robot on position @pos.

Parameters:

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

set_joint_attribute(attrib: str, values: ndarray, force=True)#

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

  • force (bool) – If True, will automatically override any pre-existing value. Otherwise, if a value already exists for this value, it will be skipped

Raises:

AssertionError – [Inconsistent dimension sizes]

set_mujoco_model(mujoco_model: MjModel | None = None)#
property top_offset: ndarray#

Returns vector from model root body to model top. Useful for, e.g. placing models on a surface. Must be defined by subclass.

Returns:

(dx, dy, dz) offset vector

Return type:

np.array

class robosuite.models.robots.robot_model.RobotModelMeta(name, bases, class_dict)#

Bases: type

Metaclass for registering robot arms

robosuite.models.robots.robot_model.create_robot(robot_name, *args, **kwargs)#

Instantiates a Robot object.

Parameters:
  • robot_name (str) – Name of the robot to initialize

  • *args – Additional arguments to pass to the specific Robot class initializer

  • **kwargs – Additional arguments to pass to the specific Robot class initializer

Returns:

Desired robot

Return type:

Robot

Raises:

Exception – [Invalid robot name]

robosuite.models.robots.robot_model.register_robot(target_class)#

Module contents#

robosuite.models.robots.is_robosuite_robot(robot: str) bool#

robot is robosuite repo robot if can import robot class from robosuite.models.robots