mani_skill.agents.controllers.base_controller#
Classes#
Base class for controllers. |
|
A flat/combined view of multiple controllers. |
|
Base class for controllers. |
Module Contents#
- class mani_skill.agents.controllers.base_controller.BaseController(config, articulation, control_freq, sim_freq=None, scene=None)[source]#
Base class for controllers. The controller is an interface for the robot to interact with the environment.
- Parameters:
config (ControllerConfig) –
articulation (mani_skill.utils.structs.Articulation) –
control_freq (int) –
sim_freq (Optional[int]) –
scene (mani_skill.envs.scene.ManiSkillScene) –
- reset()[source]#
Resets the controller to an initial state. This is called upon environment creation and each environment reset
- abstract set_action(action)[source]#
Set the action to execute. The action can be low-level control signals or high-level abstract commands.
- Parameters:
action (mani_skill.utils.structs.types.Array) –
- _original_single_action_space: gymnasium.spaces.Space[source]#
The unbatched, original action space without any additional processing like normalization
- action_space: gymnasium.spaces.Space[source]#
the action space of the controller, which by default has a batch dimension. This is typically already normalized as well.
- active_joint_indices: torch.Tensor[source]#
indices of active joints controlled. Equivalent to [x.active_index for x in self.joints]
- joints: list[mani_skill.utils.structs.ArticulationJoint][source]#
active joints controlled
- single_action_space: gymnasium.spaces.Space[source]#
The unbatched version of the action space which is also typically already normalized by this class
- class mani_skill.agents.controllers.base_controller.CombinedController(configs, articulation, control_freq, sim_freq=None, scene=None)[source]#
Bases:
DictControllerA flat/combined view of multiple controllers.
- Parameters:
configs (dict[str, ControllerConfig]) –
articulation (mani_skill.utils.structs.Articulation) –
control_freq (int) –
sim_freq (int) –
scene (mani_skill.envs.scene.ManiSkillScene) –
- from_action_dict(action_dict)[source]#
Convert a dict of actions to a flat action.
- Parameters:
action_dict (dict) –
- class mani_skill.agents.controllers.base_controller.DictController(configs, articulation, control_freq, sim_freq=None, scene=None)[source]#
Bases:
BaseControllerBase class for controllers. The controller is an interface for the robot to interact with the environment.
- Parameters:
configs (dict[str, ControllerConfig]) –
articulation (mani_skill.utils.structs.Articulation) –
control_freq (int) –
sim_freq (int) –
scene (mani_skill.envs.scene.ManiSkillScene) –
- from_qpos(qpos)[source]#
Tries to generate the corresponding action given a full robot qpos. This can be useful for joint position control when setting a desired qposition even if some controllers merge some joints together like the mimic controller
- Parameters:
qpos (mani_skill.utils.structs.types.Array) –
- reset()[source]#
Resets the controller to an initial state. This is called upon environment creation and each environment reset
- set_action(action)[source]#
Set the action to execute. The action can be low-level control signals or high-level abstract commands.
- Parameters:
action (dict[str, numpy.ndarray]) –
- action_space[source]#
the action space of the controller, which by default has a batch dimension. This is typically already normalized as well.
- controllers: dict[str, BaseController][source]#