mani_skill.agents.controllers.pd_joint_pos#

Classes#

PDJointPosController

Base class for controllers.

PDJointPosControllerConfig

PDJointPosMimicController

Base class for controllers.

PDJointPosMimicControllerConfig

PD Joint Position mimic controller configuration. This kind of controller is used to emuluate a mimic joint. For some simulation backends mimic joints are not

Module Contents#

class mani_skill.agents.controllers.pd_joint_pos.PDJointPosController(config, articulation, control_freq, sim_freq=None, scene=None)[source]#

Bases: mani_skill.agents.controllers.base_controller.BaseController

Base class for controllers. The controller is an interface for the robot to interact with the environment.

Parameters:
_get_joint_limits()[source]#
_initialize_action_space()[source]#
before_simulation_step()[source]#

Called before each simulation step in one control step.

get_state()[source]#

Get the controller state.

Return type:

dict

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 (mani_skill.utils.structs.types.Array) –

set_drive_property()[source]#

Set the joint drive property according to the config.

set_drive_targets(targets)[source]#
set_state(state)[source]#
Parameters:

state (dict) –

_start_qpos = None[source]#
_target_qpos = None[source]#
config: PDJointPosControllerConfig[source]#
sets_target_qpos = True[source]#

Whether the controller sets the target qpos of the articulation

sets_target_qvel = False[source]#

Whether the controller sets the target qvel of the articulation

class mani_skill.agents.controllers.pd_joint_pos.PDJointPosControllerConfig[source]#

Bases: mani_skill.agents.controllers.base_controller.ControllerConfig

controller_cls[source]#
damping: float | Sequence[float][source]#
drive_mode: Sequence[mani_skill.utils.structs.types.DriveMode] | mani_skill.utils.structs.types.DriveMode = 'force'[source]#
force_limit: float | Sequence[float] = 10000000000.0[source]#
friction: float | Sequence[float] = 0.0[source]#
interpolate: bool = False[source]#
lower: None | float | Sequence[float][source]#
normalize_action: bool = True[source]#
stiffness: float | Sequence[float][source]#
upper: None | float | Sequence[float][source]#
use_delta: bool = False[source]#
use_target: bool = False[source]#
class mani_skill.agents.controllers.pd_joint_pos.PDJointPosMimicController(config, articulation, control_freq, sim_freq=None, scene=None)[source]#

Bases: PDJointPosController

Base class for controllers. The controller is an interface for the robot to interact with the environment.

Parameters:
__repr__()[source]#
_get_joint_limits()[source]#
_initialize_joints()[source]#
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) –

config: PDJointPosMimicControllerConfig[source]#
class mani_skill.agents.controllers.pd_joint_pos.PDJointPosMimicControllerConfig[source]#

Bases: PDJointPosControllerConfig

PD Joint Position mimic controller configuration. This kind of controller is used to emuluate a mimic joint. For some simulation backends mimic joints are not well simulated and/or are hard to tune and so a mimic controller can be used for better stability as well as alignment with a real robot.

The joint_names field is expected to be a list of all the joints, whether they are the joints to be controlled or the joints that are controlled via mimicing.

mimic is a dictionary that maps the mimic joint name to a dictionary of the format dict(joint: str, multiplier: float, offset: float). joint is the controlling joint name and is required. All given joints in joint_names must be in the mimic dictionary as either a key or a value. The ones that are keys are referred to as the mimic joints and the ones that are values are referred to as the control joints. Mimic joints are the ones directly controlled by the agent/user and control joints are implicitly controlled by following the mimic joints via the following equation:

q_mimic = q_controlling * multiplier + offset

By default, the multiplier is 1.0 and the offset is 0.0.

controller_cls[source]#
mimic: dict[str, dict[str, float]][source]#

float, offset: float)

Type:

the mimic targets. Maps the actual mimic joint name to a dictionary of the format dict(joint

Type:

str, multiplier