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, scene, control_freq, sim_freq=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])
- reset()[source]#
Resets the controller to an initial state. This is called upon environment creation and each environment reset
- abstractmethod 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.Box[source]#
The unbatched, original action space without any additional processing like normalization
- action_space: gymnasium.spaces.Box[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.Box[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, scene, control_freq, sim_freq=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 (Optional[int])
- from_action_dict(action_dict)[source]#
Convert a dict of actions to a flat action.
- Parameters:
action_dict (dict)
- set_action(action)[source]#
Set the action to execute. The action can be low-level control signals or high-level abstract commands.
- Parameters:
action (numpy.ndarray)
- to_action_dict(action)[source]#
Convert a flat action to a dict of actions.
- Parameters:
action (numpy.ndarray)
- action_space: gymnasium.spaces.Box[source]#
the action space of the controller, which by default has a batch dimension. This is typically already normalized as well.
- single_action_space: gymnasium.spaces.Box[source]#
The unbatched version of the action space which is also typically already normalized by this class
- class mani_skill.agents.controllers.base_controller.DictController(configs, articulation, scene, control_freq, sim_freq=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 (Optional[int])
- 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: gymnasium.spaces.Dict[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]#
- single_action_space: gymnasium.spaces.Dict[source]#
The unbatched version of the action space which is also typically already normalized by this class