grutopia.core.robot¶
robot¶
- class grutopia.core.robot.robot.BaseRobot(config: RobotCfg, 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_scale() ndarray [source]¶
Get robot scale.
- Returns:
robot scale in (x, y, z).
- Return type:
np.ndarray
controller¶
- class grutopia.core.robot.controller.BaseController(config: ControllerCfg, 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 | None [source]¶
Get the joint subset controlled by the controller.
- Returns:
joint subset.
- Return type:
ArticulationSubset
- grutopia.core.robot.controller.create_controllers(robot_cfg: RobotCfg, robot: BaseRobot, scene: Scene) Dict[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]
- grutopia.core.robot.controller.inject_sub_controllers(parent: BaseController, configs: List[ControllerCfg], robot: BaseRobot, scene: Scene)[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.
sensor¶
- class grutopia.core.robot.sensor.BaseSensor(config: SensorCfg, robot: BaseRobot, scene: Scene)[source]¶
Base class of sensor.
- grutopia.core.robot.sensor.create_sensors(robot_cfg: RobotCfg, robot: BaseRobot, scene: Scene) Dict[str, BaseSensor] [source]¶
Create all sensors of one robot.
- Parameters:
robot_cfg (RobotCfg) – config 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]