internutopia.core.robot#

robot#

class internutopia.core.robot.robot.BaseRobot(config: RobotCfg, scene: IScene)[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.

clean_stale_rigid_bodies()[source]#

Removes stale rigid bodies from the scene.

cleanup()[source]#

Cleans up resources associated with the current instance by performing cleanup operations on controllers, sensors, and rigid bodies. Ensures that all associated objects are properly removed from the scene.

create_rigid_bodies()[source]#

Create rigid bodies.

get_obs() OrderedDict[source]#

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

Raises:

NotImplementedError – _description_

get_robot_articulation() IArticulation[source]#

Get isaac robots instance (articulation).

Returns:

robot articulation.

Return type:

Robot

get_robot_base() IRigidBody[source]#

Get the base link of this robot.

Returns:

rigid prim of the robot base link.

Return type:

IRigidBody

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 after the env resets.

classmethod register(name: str)[source]#

Register an robot class with the given name(decorator).

Parameters:

name (str) – name of the robot

restore_robot_info()[source]#

Restores the robot’s information and its state within the simulation environment.

save_robot_info()[source]#

Saves the current state of the robot’s articulation information.

set_up_to_scene(scene: IScene)[source]#

Set up robot in the scene.

Parameters:

scene (Scene) – scene to set up.

internutopia.core.robot.robot.create_robots(task_config: TaskCfg, scene: IScene) OrderedDict[str, BaseRobot][source]#

Create robot instances in task config.

Parameters:
  • task_config (TaskCfg) – task config.

  • scene (Scene) – isaac scene.

Returns:

robot instances dictionary.

Return type:

OrderedDict[str, BaseRobot]

controller#

class internutopia.core.robot.controller.BaseController(config: ControllerCfg, robot: BaseRobot, scene: IScene)[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

cleanup()[source]#

Operations that need to be cleaned up before switching scenes (or resetting)

get_joint_subset() ArticulationSubset | None[source]#

Get the joint subset controlled by the controller.

Returns:

joint subset.

Return type:

ArticulationSubset

get_obs() OrderedDict[str, Any][source]#

Get observation of controller.

Returns:

observation key and value.

Return type:

OrderedDict[str, Any]

classmethod register(name: str)[source]#

Register an controller class with the given name(decorator).

Parameters:

name (str) – name of the controller

internutopia.core.robot.controller.create_controllers(robot_cfg: RobotCfg, robot: BaseRobot, scene: IScene) OrderedDict[str, BaseController][source]#

Create all controllers of one robot.

Parameters:
  • robot_cfg (RobotCfg) – config 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]

internutopia.core.robot.controller.inject_sub_controllers(parent: BaseController, configs: List[ControllerCfg], robot: BaseRobot, scene: IScene)[source]#

Recursively create and inject sub-controllers into parent controller.

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

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

  • robot (BaseRobot) – robot instance.

  • scene (Scene) – scene from isaac sim.