mani_skill.agents.multi_agent#

Attributes#

T

Classes#

MultiAgent

Base class for agents/robots, forming an interface of an articulated robot (SAPIEN's physx.PhysxArticulation).

Module Contents#

class mani_skill.agents.multi_agent.MultiAgent(agents)[source]#

Bases: mani_skill.agents.base_agent.BaseAgent, Generic[T]

Base class for agents/robots, forming an interface of an articulated robot (SAPIEN’s physx.PhysxArticulation). Users implementing their own agents/robots should inherit from this class. A tutorial on how to build your own agent can be found in its tutorial

Parameters:
  • scene (ManiSkillScene) – simulation scene instance.

  • control_freq (int) – control frequency (Hz).

  • control_mode (str | None) – uid of controller to use

  • fix_root_link (bool) – whether to fix the robot root link

  • agent_idx (str | None) – an index for this agent in a multi-agent task setup If None, the task should be single-agent

  • initial_pose (sapien.Pose | Pose | None) – the initial pose of the robot. Important to set for GPU simulation to ensure robot

  • called (does not collide with other objects in the scene during GPU initialization which occurs before env._initialize_episode is) –

  • agents (list[mani_skill.agents.base_agent.BaseAgent]) –

before_simulation_step()[source]#

Code that runs before each simulation step. By default it calls the controller’s before_simulation_step method.

get_controller_state()[source]#

Get the state of the controller.

get_proprioception()[source]#

Get the proprioceptive state of the agent, default is the qpos and qvel of the robot and any controller state.

reset(init_qpos=None)[source]#

Reset the robot to a rest position or a given q-position

set_action(action)[source]#

Set the agent’s action which is to be executed in the next environment timestep

set_control_mode(control_mode=None)[source]#

Set the controller, drive properties, and reset for each agent. If given control mode is None, will set defaults

Parameters:

control_mode (list[str]) –

set_controller_state(state)[source]#

Set the state of the controller.

Parameters:

state (dict) –

_sensor_config_agent_map: dict[str, int][source]#
property _sensor_configs: list[mani_skill.sensors.base_sensor.BaseSensorConfig][source]#

Returns a list of sensor configs for this agent. It contains the sensor configs of the individual agents.

Return type:

list[mani_skill.sensors.base_sensor.BaseSensorConfig]

property action_space[source]#
agents: T[source]#
agents_dict: dict[str, mani_skill.agents.base_agent.BaseAgent][source]#
property control_mode[source]#

Get the currently activated controller uid of each robot

property controller[source]#

Get currently activated controller.

scene[source]#
sensor_configs = [][source]#
property single_action_space[source]#
mani_skill.agents.multi_agent.T[source]#