robosuite.models.robots package

Subpackages

Submodules

robosuite.models.robots.robot_model module

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

Bases: robosuite.models.base.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_mount(mount)

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 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

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

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_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 default_mount

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

Returns

Default mount name to add to this robot

Return type

str

property dof

Defines the number of DOF of the robot

Returns

robot DOF

Return type

int

property horizontal_radius

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

Defines the default rest qpos of this robot

Returns

Default init qpos of this robot

Return type

np.array

property models

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

Generates a standardized prefix to prevent naming collisions

Returns

Prefix unique to this model.

Return type

str

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

Places the robot on position @pos.

Parameters

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

set_joint_attribute(attrib, values, 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]

property top_offset

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