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.
- 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.
- 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:
- get_robot_scale() ndarray [source]#
Get robot scale.
- Returns:
robot scale in (x, y, z).
- Return type:
np.ndarray
- classmethod register(name: str)[source]#
Register an robot class with the given name(decorator).
- Parameters:
name (str) – name of the robot
- 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
- get_joint_subset() ArticulationSubset | None [source]#
Get the joint subset controlled by the controller.
- Returns:
joint subset.
- Return type:
ArticulationSubset
- 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.