Shortcuts

grutopia.core.robot

robot

class grutopia.core.robot.robot.BaseRobot(config: RobotUserConfig, robot_model: RobotModel, scene: Scene)[source]

Base class of robot.

apply_action(action: dict)[source]

Apply actions of controllers to robot.

Parameters:

action (dict) – action dict. key: controller name. value: corresponding action array.

get_obs() dict[source]

Get observation of robot, including controllers, sensors, and world pose.

Raises:

NotImplementedError – _description_

get_robot_articulation() Robot[source]

Get isaac robots instance (articulation).

Returns:

robot articulation.

Return type:

Robot

get_robot_base() RigidPrim[source]

Get base link of robot.

Returns:

rigid prim of robot base link.

Return type:

RigidPrim

get_robot_ik_base() RigidPrim[source]

Get base link of ik controlled parts.

Returns:

rigid prim of ik base link.

Return type:

RigidPrim

get_robot_scale() ndarray[source]

Get robot scale.

Returns:

robot scale in (x, y, z).

Return type:

np.ndarray

post_reset()[source]

Set up things that happen after the world resets.

classmethod register(name: str)[source]

Register a robot class with its name(decorator).

Parameters:

name (str) – name of the robot class.

set_up_to_scene(scene: Scene)[source]

Set up robot in the scene.

Parameters:

scene (Scene) – scene to setup.

grutopia.core.robot.robot.create_robots(config: TaskUserConfig, robot_models: RobotModels, scene: Scene) Dict[str, BaseRobot][source]

Create robot instances in config. :param config: user config. :type config: TaskUserConfig :param robot_models: robot models. :type robot_models: RobotModels :param scene: isaac scene. :type scene: Scene

Returns:

robot instances dictionary.

Return type:

Dict[str, BaseRobot]

controller

class grutopia.core.robot.controller.BaseController(config: ControllerModel, robot: BaseRobot, scene: Scene)[source]

Base class of controller.

abstract action_to_control(action: ndarray | List) ArticulationAction[source]

Convert input action (in 1d array format) to joint signals to apply.

Parameters:

action (Union[np.ndarray, List]) – input control action.

Returns:

joint signals to apply

Return type:

ArticulationAction

get_joint_subset() ArticulationSubset[source]

Get the joint subset controlled by the controller.

Returns:

joint subset.

Return type:

ArticulationSubset

get_obs() Dict[str, Any][source]

Get observation of controller.

Returns:

observation key and value.

Return type:

Dict[str, Any]

classmethod register(name: str)[source]

Register a controller with its name(decorator).

Parameters:

name (str) – name of the controller

grutopia.core.robot.controller.config_inject(user_config: ControllerParams, model: ControllerModel) ControllerModel[source]

Merge controller config from user config and robot model.

Parameters:
  • user_config (ControllerParams) – user config.

  • model (ControllerModel) – controller config from robot model.

Returns:

merged controller config.

Return type:

ControllerModel

grutopia.core.robot.controller.create_controllers(config: RobotUserConfig, robot_model: RobotModel, robot: BaseRobot, scene: Scene) Dict[str, BaseController][source]

Create all controllers of one robot.

Parameters:
  • config (RobotUserConfig) – user config of the robot.

  • robot_model (RobotModel) – model of the robot.

  • robot (BaseRobot) – robot instance.

  • scene (Scene) – scene from isaac sim.

Returns:

dict of controllers with controller name as key.

Return type:

Dict[str, BaseController]

grutopia.core.robot.controller.inject_sub_controllers(parent: BaseController, configs: List[ControllerParams], available: Dict[str, ControllerModel], robot: BaseRobot, scene: Scene)[source]

Recursively create and inject sub-controlllers into parent controller.

Parameters:
  • parent (BaseController) – parent controller instance.

  • configs (List[ControllerParams]) – user configs of sub-controllers.

  • available (Dict[str, ControllerModel]) – available controllers.

  • robot (BaseRobot) – robot instance.

  • scene (Scene) – scene from isaac sim.

sensor

class grutopia.core.robot.sensor.BaseSensor(config: SensorModel, robot: BaseRobot, scene: Scene)[source]

Base class of sensor.

abstract get_data() Dict[source]

Get data from sensor.

Returns:

data dict of sensor.

Return type:

Dict

classmethod register(name: str)[source]

Register a sensor class with the given name(decorator). :param name: name of the sensor class. :type name: str

grutopia.core.robot.sensor.config_inject(params: SensorParams, model: SensorModel) SensorModel[source]

Merge sensor config from user config and robot model.

Parameters:
  • params (SensorParams) – user config.

  • model (SensorModel) – sensor config from robot model.

Returns:

merged sensor config.

Return type:

SensorModel

grutopia.core.robot.sensor.create_sensors(config: RobotUserConfig, robot_model: RobotModel, robot: BaseRobot, scene: Scene) Dict[str, BaseSensor][source]

Create all sensors of one robot.

Parameters:
  • config (RobotUserConfig) – user config of the robot.

  • robot_model (RobotModel) – model of the robot.

  • robot (BaseRobot) – robot instance.

  • scene (Scene) – scene from isaac sim.

Returns:

dict of sensors with sensor name as key.

Return type:

Dict[str, BaseSensor]