embodichain.lab.sim.robots#
Robot-specific configuration presets (RobotCfg subclasses) ready to drop into a simulation scene, plus the build_dual_arm_cfg dual-arm assembly helper.
Overview#
Robot-specific configuration presets ready to drop into a simulation scene.
Each preset is a RobotCfg subclass that
fixes the URDF, control parts, drive properties, and IK solver configuration
for a particular robot. The package also exposes
build_dual_arm_cfg(), a helper for assembling two single-arm configs into
a synchronized dual-arm robot.
Classes
DexforceW1 specific configuration, inherits from RobotCfg and allows custom parameters. |
|
CobotMagicCfg(uid: 'str | None' = <factory>, init_pos: 'tuple[float, float, float]' = <factory>, init_rot: 'tuple[float, float, float]' = <factory>, init_local_pose: 'np.ndarray | None' = <factory>, fpath: 'str' = <factory>, drive_pros: 'JointDrivePropertiesCfg' = <factory>, body_scale: 'tuple | list' = <factory>, attrs: 'RigidBodyAttributesCfg' = <factory>, link_attrs: 'dict[str, LinkPhysicsOverrideCfg] | None' = <factory>, fix_base: 'bool' = <factory>, disable_self_collision: 'bool' = <factory>, enable_gravity: 'bool' = <factory>, init_qpos: 'torch.Tensor | np.ndarray | Sequence[float]' = <factory>, qpos_limits: 'torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None' = <factory>, sleep_threshold: 'float' = <factory>, min_position_iters: 'int' = <factory>, min_velocity_iters: 'int' = <factory>, build_pk_chain: 'bool' = <factory>, compute_uv: 'bool' = <factory>, use_usd_properties: 'bool' = <factory>, control_parts: 'Dict[str, List[str]] | None' = <factory>, urdf_cfg: 'URDFCfg' = <factory>, solver_cfg: "Dict[str, 'SolverCfg'] | None" = <factory>, workspace_cfg: 'Dict[str, RobotWorkspaceCfg] | None' = <factory>) |
|
Configuration for the Franka Emika Panda robot with Panda hand. |
|
Configuration for the UR family of robots. |
|
Configuration for a dual-manipulator composed from a single-arm robot. |
Functions
|
Build a dual-arm cfg from a single-arm robot cfg. |
- class embodichain.lab.sim.robots.DexforceW1Cfg[source]#
Bases:
RobotCfgDexforceW1 specific configuration, inherits from RobotCfg and allows custom parameters.
Classes:
Configuration for the kinematic solver used in the robot simulation.
Attributes:
Physical attributes for all links.
Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Control parts is the mapping from part name to joint names.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Override joint position limits of the articulation.
[0, max_float32]
Solver is used to compute forward and inverse kinematics for the robot.
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
Whether to use physical properties from USD file instead of config.
Runtime workspace cache configuration keyed by control-part name.
Methods:
build_pk_serial_chain([device])Build the serial chain from the URDF file.
from_dict(init_dict)Initialize DexforceW1Cfg from a dictionary.
save_to_file(filepath)Save config to a local file as JSON.
Return config as a JSON string.
- class SolverCfg#
Bases:
objectConfiguration for the kinematic solver used in the robot simulation.
Attributes:
The class type of the solver to be used.
The name of the end-effector link for the solver.
Weights for the inverse kinematics nearest calculation.
List of joint names for the solver.
The name of the root/base link for the solver.
The tool center point (TCP) position as a 4x4 homogeneous matrix.
The file path to the URDF model of the robot.
User defined Joint position limits [2, DOF] for the solver.
Methods:
from_dict(init_dict)Initialize the concrete solver configuration from a dictionary.
-
class_type:
str# The class type of the solver to be used.
-
end_link_name:
str# The name of the end-effector link for the solver.
This defines the target link for forward/inverse kinematics calculations. Must match a link name in the URDF file.
- classmethod from_dict(init_dict)#
Initialize the concrete solver configuration from a dictionary.
The concrete config receives all recognized dataclass init fields in its constructor so initialization and
__post_init__observe the final inputs exactly once. Legacy unannotated config attributes are applied afterward. Unknown fields preserve the historical behavior: they are ignored with a warning.- Return type:
-
ik_nearest_weight:
Optional[List[float]]# Weights for the inverse kinematics nearest calculation.
The weights influence how the solver prioritizes closeness to the seed position when multiple solutions are available.
-
joint_names:
list[str] |None# List of joint names for the solver.
If None, all joints in the URDF will be used. If specified, only these named joints will be included in the kinematic chain.
-
root_link_name:
str# The name of the root/base link for the solver.
This defines the starting point of the kinematic chain. Must match a link name in the URDF file.
-
tcp:
Tensor|ndarray# The tool center point (TCP) position as a 4x4 homogeneous matrix.
This represents the position and orientation of the tool in the robot’s end-effector frame.
-
urdf_path:
str|None# The file path to the URDF model of the robot.
-
user_qpos_limits:
Optional[List[float]]# User defined Joint position limits [2, DOF] for the solver. If not provided (None), this value will replace by joint limits defined in urdf when solver init from robot. If provided, the solver will use the intersection of user defined limits and urdf limits as the final joint limits.
-
class_type:
- attrs: RigidBodyAttributesCfg#
Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
- body_scale: tuple | list#
Scale of the articulation in the simulation world frame.
- build_pk_chain: bool#
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
- build_pk_serial_chain(device=device(type='cpu'), **kwargs)[source]#
Build the serial chain from the URDF file.
Note
This method is usually used in imitation dataset saving (compute eef pose from qpos using FK) and model training (provide a differentiable FK layer or loss computation).
- Parameters:
device (torch.device) – The device to which the chain will be moved. Defaults to CPU.
**kwargs – Additional arguments for building the serial chain.
- Returns:
The serial chain of the robot for specified control part.
- Return type:
Dict[str, pk.SerialChain]
- compute_uv: bool#
Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
- control_parts: Dict[str, List[str]] | None#
Control parts is the mapping from part name to joint names.
For example, {‘left_arm’: [‘joint1’, ‘joint2’], ‘right_arm’: [‘joint3’, ‘joint4’]} If no control part is specified, the robot will use all joints as a single control part.
Note
- control_parts can be used without solver_cfg. If solver_cfg is a
dictionary, its keys must correspond to control-part names.
- The joint names in the control parts support regular expressions, e.g., ‘joint[1-6]’.
After initialization of robot, the names will be expanded to a list of full joint names.
- Robot is a derived class of Articulation, with control parts support. So the drive_pros
in ArticulationCfg can use control part as key to specify the corresponding joint drive properties, which will be overridden if these joint names are already specified.
- disable_self_collision: bool#
Whether to enable or disable self-collisions.
- drive_pros: JointDrivePropertiesCfg#
Properties to define the drive mechanism of a joint.
- enable_gravity: bool#
Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
- fix_base: bool#
Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
- fpath: str#
Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize DexforceW1Cfg from a dictionary.
- Parameters:
init_dict (
Dict[str,str|float|tuple|dict]) – Dictionary of configuration parameters.- Return type:
- Returns:
A DexforceW1Cfg instance. Defaults are built via
_build_defaults(), theninit_dictoverrides are merged.
- init_local_pose: np.ndarray | None#
4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
- init_pos: tuple[float, float, float]#
Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- init_qpos: torch.Tensor | np.ndarray | Sequence[float]#
Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
- init_rot: tuple[float, float, float]#
Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- link_attrs: dict[str, LinkPhysicsOverrideCfg] | None#
Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
- min_position_iters: int#
[1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
- min_velocity_iters: int#
[0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
- qpos_limits: torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None#
Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
- save_to_file(filepath)#
Save config to a local file as JSON.
- sleep_threshold: float#
[0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
- solver_cfg: SolverCfg | Dict[str, SolverCfg] | None#
Solver is used to compute forward and inverse kinematics for the robot.
- to_string()#
Return config as a JSON string.
- urdf_cfg: URDFCfg | None#
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
- use_usd_properties: bool#
Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
- workspace_cfg: Dict[str, RobotWorkspaceCfg] | None#
Runtime workspace cache configuration keyed by control-part name.
- class embodichain.lab.sim.robots.CobotMagicCfg[source]#
Bases:
RobotCfgCobotMagicCfg(uid: ‘str | None’ = <factory>, init_pos: ‘tuple[float, float, float]’ = <factory>, init_rot: ‘tuple[float, float, float]’ = <factory>, init_local_pose: ‘np.ndarray | None’ = <factory>, fpath: ‘str’ = <factory>, drive_pros: ‘JointDrivePropertiesCfg’ = <factory>, body_scale: ‘tuple | list’ = <factory>, attrs: ‘RigidBodyAttributesCfg’ = <factory>, link_attrs: ‘dict[str, LinkPhysicsOverrideCfg] | None’ = <factory>, fix_base: ‘bool’ = <factory>, disable_self_collision: ‘bool’ = <factory>, enable_gravity: ‘bool’ = <factory>, init_qpos: ‘torch.Tensor | np.ndarray | Sequence[float]’ = <factory>, qpos_limits: ‘torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None’ = <factory>, sleep_threshold: ‘float’ = <factory>, min_position_iters: ‘int’ = <factory>, min_velocity_iters: ‘int’ = <factory>, build_pk_chain: ‘bool’ = <factory>, compute_uv: ‘bool’ = <factory>, use_usd_properties: ‘bool’ = <factory>, control_parts: ‘Dict[str, List[str]] | None’ = <factory>, urdf_cfg: ‘URDFCfg’ = <factory>, solver_cfg: “Dict[str, ‘SolverCfg’] | None” = <factory>, workspace_cfg: ‘Dict[str, RobotWorkspaceCfg] | None’ = <factory>)
Classes:
Configuration for the kinematic solver used in the robot simulation.
Attributes:
Physical attributes for all links.
Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Control parts is the mapping from part name to joint names.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Override joint position limits of the articulation.
[0, max_float32]
Solver is used to compute forward and inverse kinematics for the robot.
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
Whether to use physical properties from USD file instead of config.
Runtime workspace cache configuration keyed by control-part name.
Methods:
build_pk_serial_chain([device])Build the serial chain from the URDF file.
from_dict(init_dict)Initialize the configuration from a dictionary.
save_to_file(filepath)Save config to a local file as JSON.
Return config as a JSON string.
- class SolverCfg#
Bases:
objectConfiguration for the kinematic solver used in the robot simulation.
Attributes:
The class type of the solver to be used.
The name of the end-effector link for the solver.
Weights for the inverse kinematics nearest calculation.
List of joint names for the solver.
The name of the root/base link for the solver.
The tool center point (TCP) position as a 4x4 homogeneous matrix.
The file path to the URDF model of the robot.
User defined Joint position limits [2, DOF] for the solver.
Methods:
from_dict(init_dict)Initialize the concrete solver configuration from a dictionary.
-
class_type:
str# The class type of the solver to be used.
-
end_link_name:
str# The name of the end-effector link for the solver.
This defines the target link for forward/inverse kinematics calculations. Must match a link name in the URDF file.
- classmethod from_dict(init_dict)#
Initialize the concrete solver configuration from a dictionary.
The concrete config receives all recognized dataclass init fields in its constructor so initialization and
__post_init__observe the final inputs exactly once. Legacy unannotated config attributes are applied afterward. Unknown fields preserve the historical behavior: they are ignored with a warning.- Return type:
-
ik_nearest_weight:
Optional[List[float]]# Weights for the inverse kinematics nearest calculation.
The weights influence how the solver prioritizes closeness to the seed position when multiple solutions are available.
-
joint_names:
list[str] |None# List of joint names for the solver.
If None, all joints in the URDF will be used. If specified, only these named joints will be included in the kinematic chain.
-
root_link_name:
str# The name of the root/base link for the solver.
This defines the starting point of the kinematic chain. Must match a link name in the URDF file.
-
tcp:
Tensor|ndarray# The tool center point (TCP) position as a 4x4 homogeneous matrix.
This represents the position and orientation of the tool in the robot’s end-effector frame.
-
urdf_path:
str|None# The file path to the URDF model of the robot.
-
user_qpos_limits:
Optional[List[float]]# User defined Joint position limits [2, DOF] for the solver. If not provided (None), this value will replace by joint limits defined in urdf when solver init from robot. If provided, the solver will use the intersection of user defined limits and urdf limits as the final joint limits.
-
class_type:
- attrs: RigidBodyAttributesCfg#
Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
- body_scale: tuple | list#
Scale of the articulation in the simulation world frame.
- build_pk_chain: bool#
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
- build_pk_serial_chain(device=device(type='cpu'), **kwargs)[source]#
Build the serial chain from the URDF file.
Note
This method is usually used in imitation dataset saving (compute eef pose from qpos using FK) and model training (provide a differentiable FK layer or loss computation).
- Parameters:
device (torch.device) – The device to which the chain will be moved. Defaults to CPU.
**kwargs – Additional arguments for building the serial chain.
- Returns:
The serial chain of the robot for specified control part.
- Return type:
Dict[str, pk.SerialChain]
- compute_uv: bool#
Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
- control_parts: Dict[str, List[str]] | None#
Control parts is the mapping from part name to joint names.
For example, {‘left_arm’: [‘joint1’, ‘joint2’], ‘right_arm’: [‘joint3’, ‘joint4’]} If no control part is specified, the robot will use all joints as a single control part.
Note
- control_parts can be used without solver_cfg. If solver_cfg is a
dictionary, its keys must correspond to control-part names.
- The joint names in the control parts support regular expressions, e.g., ‘joint[1-6]’.
After initialization of robot, the names will be expanded to a list of full joint names.
- Robot is a derived class of Articulation, with control parts support. So the drive_pros
in ArticulationCfg can use control part as key to specify the corresponding joint drive properties, which will be overridden if these joint names are already specified.
- disable_self_collision: bool#
Whether to enable or disable self-collisions.
- drive_pros: JointDrivePropertiesCfg#
Properties to define the drive mechanism of a joint.
- enable_gravity: bool#
Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
- fix_base: bool#
Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
- fpath: str#
Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
- init_local_pose: np.ndarray | None#
4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
- init_pos: tuple[float, float, float]#
Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- init_qpos: torch.Tensor | np.ndarray | Sequence[float]#
Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
- init_rot: tuple[float, float, float]#
Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- link_attrs: dict[str, LinkPhysicsOverrideCfg] | None#
Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
- min_position_iters: int#
[1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
- min_velocity_iters: int#
[0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
- qpos_limits: torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None#
Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
- save_to_file(filepath)#
Save config to a local file as JSON.
- sleep_threshold: float#
[0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
- solver_cfg: Dict[str, 'SolverCfg'] | None#
Solver is used to compute forward and inverse kinematics for the robot.
- to_string()#
Return config as a JSON string.
- urdf_cfg: URDFCfg#
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
- use_usd_properties: bool#
Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
- workspace_cfg: Dict[str, RobotWorkspaceCfg] | None#
Runtime workspace cache configuration keyed by control-part name.
- class embodichain.lab.sim.robots.FrankaPandaCfg[source]#
Bases:
RobotCfgConfiguration for the Franka Emika Panda robot with Panda hand.
The PandaWithHand URDF includes both the 7-DOF arm and the parallel-jaw gripper in a single file. The solver defaults to
PytorchSolverCfg.Example
cfg = FrankaPandaCfg.from_dict({“robot_type”: “panda”}) robot = sim.add_robot(cfg=cfg)
Classes:
Configuration for the kinematic solver used in the robot simulation.
Attributes:
Physical attributes for all links.
Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Control parts is the mapping from part name to joint names.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Override joint position limits of the articulation.
[0, max_float32]
Solver is used to compute forward and inverse kinematics for the robot.
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
Whether to use physical properties from USD file instead of config.
Runtime workspace cache configuration keyed by control-part name.
Methods:
build_pk_serial_chain([device])Build the pytorch-kinematics serial chain for the arm.
from_dict(init_dict)Initialize
FrankaPandaCfgfrom a dictionary.save_to_file(filepath)Save config to a local file as JSON.
Return config as a JSON string.
- class SolverCfg#
Bases:
objectConfiguration for the kinematic solver used in the robot simulation.
Attributes:
The class type of the solver to be used.
The name of the end-effector link for the solver.
Weights for the inverse kinematics nearest calculation.
List of joint names for the solver.
The name of the root/base link for the solver.
The tool center point (TCP) position as a 4x4 homogeneous matrix.
The file path to the URDF model of the robot.
User defined Joint position limits [2, DOF] for the solver.
Methods:
from_dict(init_dict)Initialize the concrete solver configuration from a dictionary.
-
class_type:
str# The class type of the solver to be used.
-
end_link_name:
str# The name of the end-effector link for the solver.
This defines the target link for forward/inverse kinematics calculations. Must match a link name in the URDF file.
- classmethod from_dict(init_dict)#
Initialize the concrete solver configuration from a dictionary.
The concrete config receives all recognized dataclass init fields in its constructor so initialization and
__post_init__observe the final inputs exactly once. Legacy unannotated config attributes are applied afterward. Unknown fields preserve the historical behavior: they are ignored with a warning.- Return type:
-
ik_nearest_weight:
Optional[List[float]]# Weights for the inverse kinematics nearest calculation.
The weights influence how the solver prioritizes closeness to the seed position when multiple solutions are available.
-
joint_names:
list[str] |None# List of joint names for the solver.
If None, all joints in the URDF will be used. If specified, only these named joints will be included in the kinematic chain.
-
root_link_name:
str# The name of the root/base link for the solver.
This defines the starting point of the kinematic chain. Must match a link name in the URDF file.
-
tcp:
Tensor|ndarray# The tool center point (TCP) position as a 4x4 homogeneous matrix.
This represents the position and orientation of the tool in the robot’s end-effector frame.
-
urdf_path:
str|None# The file path to the URDF model of the robot.
-
user_qpos_limits:
Optional[List[float]]# User defined Joint position limits [2, DOF] for the solver. If not provided (None), this value will replace by joint limits defined in urdf when solver init from robot. If provided, the solver will use the intersection of user defined limits and urdf limits as the final joint limits.
-
class_type:
- attrs: RigidBodyAttributesCfg#
Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
- body_scale: tuple | list#
Scale of the articulation in the simulation world frame.
- build_pk_chain: bool#
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
- build_pk_serial_chain(device=device(type='cpu'), **kwargs)[source]#
Build the pytorch-kinematics serial chain for the arm.
- Parameters:
device (
device) – The device to which the chain will be moved. Defaults to CPU.**kwargs – Additional arguments for building the serial chain.
- Return type:
Dict[str,SerialChain]- Returns:
A
{"arm": pk.SerialChain}mapping.
- compute_uv: bool#
Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
- control_parts: Dict[str, List[str]] | None#
Control parts is the mapping from part name to joint names.
For example, {‘left_arm’: [‘joint1’, ‘joint2’], ‘right_arm’: [‘joint3’, ‘joint4’]} If no control part is specified, the robot will use all joints as a single control part.
Note
- control_parts can be used without solver_cfg. If solver_cfg is a
dictionary, its keys must correspond to control-part names.
- The joint names in the control parts support regular expressions, e.g., ‘joint[1-6]’.
After initialization of robot, the names will be expanded to a list of full joint names.
- Robot is a derived class of Articulation, with control parts support. So the drive_pros
in ArticulationCfg can use control part as key to specify the corresponding joint drive properties, which will be overridden if these joint names are already specified.
- disable_self_collision: bool#
Whether to enable or disable self-collisions.
- drive_pros: JointDrivePropertiesCfg#
Properties to define the drive mechanism of a joint.
- enable_gravity: bool#
Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
- fix_base: bool#
Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
- fpath: str#
Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize
FrankaPandaCfgfrom a dictionary.- Parameters:
init_dict – Dictionary of configuration parameters.
robot_typeselects the Franka variant (currently"panda"). All other keys are merged on top of the defaults viamerge_robot_cfg().- Returns:
A
FrankaPandaCfginstance.
- init_local_pose: np.ndarray | None#
4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
- init_pos: tuple[float, float, float]#
Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- init_qpos: torch.Tensor | np.ndarray | Sequence[float]#
Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
- init_rot: tuple[float, float, float]#
Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- link_attrs: dict[str, LinkPhysicsOverrideCfg] | None#
Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
- min_position_iters: int#
[1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
- min_velocity_iters: int#
[0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
- qpos_limits: torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None#
Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
- save_to_file(filepath)#
Save config to a local file as JSON.
- sleep_threshold: float#
[0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
- solver_cfg: SolverCfg | Dict[str, SolverCfg] | None#
Solver is used to compute forward and inverse kinematics for the robot.
- to_string()#
Return config as a JSON string.
- urdf_cfg: URDFCfg | None#
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
- use_usd_properties: bool#
Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
- workspace_cfg: Dict[str, RobotWorkspaceCfg] | None#
Runtime workspace cache configuration keyed by control-part name.
- class embodichain.lab.sim.robots.URRobotCfg[source]#
Bases:
RobotCfgConfiguration for the UR family of robots.
One config class covers UR3 / UR3e / UR5 / UR5e / UR10 / UR10e, selected via
robot_type. The kinematic (DH) parameters are owned byURSolverCfg; this config owns the URDF, control parts, drive properties and rigid-body attributes.Example
cfg = URRobotCfg.from_dict({“robot_type”: “ur5”}) robot = sim.add_robot(cfg=cfg)
Classes:
Configuration for the kinematic solver used in the robot simulation.
Attributes:
Physical attributes for all links.
Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Control parts is the mapping from part name to joint names.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Override joint position limits of the articulation.
[0, max_float32]
Solver is used to compute forward and inverse kinematics for the robot.
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
Whether to use physical properties from USD file instead of config.
Runtime workspace cache configuration keyed by control-part name.
Methods:
build_pk_serial_chain([device])Build the pytorch-kinematics serial chain for the arm.
from_dict(init_dict)Initialize
URRobotCfgfrom a dictionary.save_to_file(filepath)Save config to a local file as JSON.
Return config as a JSON string.
- class SolverCfg#
Bases:
objectConfiguration for the kinematic solver used in the robot simulation.
Attributes:
The class type of the solver to be used.
The name of the end-effector link for the solver.
Weights for the inverse kinematics nearest calculation.
List of joint names for the solver.
The name of the root/base link for the solver.
The tool center point (TCP) position as a 4x4 homogeneous matrix.
The file path to the URDF model of the robot.
User defined Joint position limits [2, DOF] for the solver.
Methods:
from_dict(init_dict)Initialize the concrete solver configuration from a dictionary.
-
class_type:
str# The class type of the solver to be used.
-
end_link_name:
str# The name of the end-effector link for the solver.
This defines the target link for forward/inverse kinematics calculations. Must match a link name in the URDF file.
- classmethod from_dict(init_dict)#
Initialize the concrete solver configuration from a dictionary.
The concrete config receives all recognized dataclass init fields in its constructor so initialization and
__post_init__observe the final inputs exactly once. Legacy unannotated config attributes are applied afterward. Unknown fields preserve the historical behavior: they are ignored with a warning.- Return type:
-
ik_nearest_weight:
Optional[List[float]]# Weights for the inverse kinematics nearest calculation.
The weights influence how the solver prioritizes closeness to the seed position when multiple solutions are available.
-
joint_names:
list[str] |None# List of joint names for the solver.
If None, all joints in the URDF will be used. If specified, only these named joints will be included in the kinematic chain.
-
root_link_name:
str# The name of the root/base link for the solver.
This defines the starting point of the kinematic chain. Must match a link name in the URDF file.
-
tcp:
Tensor|ndarray# The tool center point (TCP) position as a 4x4 homogeneous matrix.
This represents the position and orientation of the tool in the robot’s end-effector frame.
-
urdf_path:
str|None# The file path to the URDF model of the robot.
-
user_qpos_limits:
Optional[List[float]]# User defined Joint position limits [2, DOF] for the solver. If not provided (None), this value will replace by joint limits defined in urdf when solver init from robot. If provided, the solver will use the intersection of user defined limits and urdf limits as the final joint limits.
-
class_type:
- attrs: RigidBodyAttributesCfg#
Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
- body_scale: tuple | list#
Scale of the articulation in the simulation world frame.
- build_pk_chain: bool#
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
- build_pk_serial_chain(device=device(type='cpu'), **kwargs)[source]#
Build the pytorch-kinematics serial chain for the arm.
- Parameters:
device (
device) – The device to which the chain will be moved. Defaults to CPU.**kwargs – Additional arguments for building the serial chain.
- Return type:
Dict[str,SerialChain]- Returns:
A
{"arm": pk.SerialChain}mapping.
- compute_uv: bool#
Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
- control_parts: Dict[str, List[str]] | None#
Control parts is the mapping from part name to joint names.
For example, {‘left_arm’: [‘joint1’, ‘joint2’], ‘right_arm’: [‘joint3’, ‘joint4’]} If no control part is specified, the robot will use all joints as a single control part.
Note
- control_parts can be used without solver_cfg. If solver_cfg is a
dictionary, its keys must correspond to control-part names.
- The joint names in the control parts support regular expressions, e.g., ‘joint[1-6]’.
After initialization of robot, the names will be expanded to a list of full joint names.
- Robot is a derived class of Articulation, with control parts support. So the drive_pros
in ArticulationCfg can use control part as key to specify the corresponding joint drive properties, which will be overridden if these joint names are already specified.
- disable_self_collision: bool#
Whether to enable or disable self-collisions.
- drive_pros: JointDrivePropertiesCfg#
Properties to define the drive mechanism of a joint.
- enable_gravity: bool#
Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
- fix_base: bool#
Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
- fpath: str#
Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize
URRobotCfgfrom a dictionary.- Parameters:
init_dict – Dictionary of configuration parameters.
robot_typeselects the UR variant (ur3/ur3e/ur5/ur5e/ur10/ur10e); all other keys are merged on top of the defaults viamerge_robot_cfg().- Returns:
A
URRobotCfginstance.
- init_local_pose: np.ndarray | None#
4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
- init_pos: tuple[float, float, float]#
Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- init_qpos: torch.Tensor | np.ndarray | Sequence[float]#
Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
- init_rot: tuple[float, float, float]#
Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- link_attrs: dict[str, LinkPhysicsOverrideCfg] | None#
Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
- min_position_iters: int#
[1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
- min_velocity_iters: int#
[0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
- qpos_limits: torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None#
Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
- save_to_file(filepath)#
Save config to a local file as JSON.
- sleep_threshold: float#
[0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
- solver_cfg: SolverCfg | Dict[str, SolverCfg] | None#
Solver is used to compute forward and inverse kinematics for the robot.
- to_string()#
Return config as a JSON string.
- urdf_cfg: URDFCfg | None#
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
- use_usd_properties: bool#
Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
- workspace_cfg: Dict[str, RobotWorkspaceCfg] | None#
Runtime workspace cache configuration keyed by control-part name.
- class embodichain.lab.sim.robots.DualArmRobotCfg[source]#
Bases:
RobotCfgConfiguration for a dual-manipulator composed from a single-arm robot.
Two identical arms (the
base_robot) are mounted on a shared syntheticbase_link. The left/rightcontrol_parts, per-armsolver_cfgand mirroreddrive_prosare derived automatically bybuild_dual_arm_cfg().Example
- cfg = DualArmRobotCfg.from_dict(
- {“base_robot”: “ur5”,
“mount”: {“preset”: “side_by_side”, “separation”: 0.6}}
) robot = sim.add_robot(cfg=cfg)
Classes:
Configuration for the kinematic solver used in the robot simulation.
Attributes:
Name of the base robot's manipulator control part.
Physical attributes for all links.
Registry key (e.g.
"ur5") or{"type": ..., "init": {...}}.Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Control parts is the mapping from part name to joint names.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether to emit a
"dual_arm"composite control part.Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Mount configuration consumed by
resolve_mounts().Override joint position limits of the articulation.
[0, max_float32]
Solver is used to compute forward and inverse kinematics for the robot.
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
Whether to use physical properties from USD file instead of config.
Runtime workspace cache configuration keyed by control-part name.
Methods:
build_pk_serial_chain([device])Build the per-arm pytorch-kinematics serial chains.
from_dict(init_dict)Initialize from a dictionary.
save_to_file(filepath)Save config to a local file as JSON.
Return config as a JSON string.
- class SolverCfg#
Bases:
objectConfiguration for the kinematic solver used in the robot simulation.
Attributes:
The class type of the solver to be used.
The name of the end-effector link for the solver.
Weights for the inverse kinematics nearest calculation.
List of joint names for the solver.
The name of the root/base link for the solver.
The tool center point (TCP) position as a 4x4 homogeneous matrix.
The file path to the URDF model of the robot.
User defined Joint position limits [2, DOF] for the solver.
Methods:
from_dict(init_dict)Initialize the concrete solver configuration from a dictionary.
-
class_type:
str# The class type of the solver to be used.
-
end_link_name:
str# The name of the end-effector link for the solver.
This defines the target link for forward/inverse kinematics calculations. Must match a link name in the URDF file.
- classmethod from_dict(init_dict)#
Initialize the concrete solver configuration from a dictionary.
The concrete config receives all recognized dataclass init fields in its constructor so initialization and
__post_init__observe the final inputs exactly once. Legacy unannotated config attributes are applied afterward. Unknown fields preserve the historical behavior: they are ignored with a warning.- Return type:
-
ik_nearest_weight:
Optional[List[float]]# Weights for the inverse kinematics nearest calculation.
The weights influence how the solver prioritizes closeness to the seed position when multiple solutions are available.
-
joint_names:
list[str] |None# List of joint names for the solver.
If None, all joints in the URDF will be used. If specified, only these named joints will be included in the kinematic chain.
-
root_link_name:
str# The name of the root/base link for the solver.
This defines the starting point of the kinematic chain. Must match a link name in the URDF file.
-
tcp:
Tensor|ndarray# The tool center point (TCP) position as a 4x4 homogeneous matrix.
This represents the position and orientation of the tool in the robot’s end-effector frame.
-
urdf_path:
str|None# The file path to the URDF model of the robot.
-
user_qpos_limits:
Optional[List[float]]# User defined Joint position limits [2, DOF] for the solver. If not provided (None), this value will replace by joint limits defined in urdf when solver init from robot. If provided, the solver will use the intersection of user defined limits and urdf limits as the final joint limits.
-
class_type:
- arm_part: str#
Name of the base robot’s manipulator control part.
- attrs: RigidBodyAttributesCfg#
Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
- base_robot: Union[str, dict]#
Registry key (e.g.
"ur5") or{"type": ..., "init": {...}}.
- body_scale: tuple | list#
Scale of the articulation in the simulation world frame.
- build_pk_chain: bool#
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
- build_pk_serial_chain(device=device(type='cpu'), **kwargs)[source]#
Build the per-arm pytorch-kinematics serial chains.
Each chain is built from the single-arm URDF with the (arm-local) root and end link names taken from the left-arm solver, mirroring the
CobotMagicCfgpattern. Both arms share one URDF; the chains are keyed"left_arm"/"right_arm"for API symmetry.- Parameters:
device (
device) – The device to move the chains to. Defaults to CPU.**kwargs – Additional arguments for building the serial chains.
- Return type:
Dict[str,SerialChain]- Returns:
A
{"left_arm": chain, "right_arm": chain}mapping.
- compute_uv: bool#
Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
- control_parts: Dict[str, List[str]] | None#
Control parts is the mapping from part name to joint names.
For example, {‘left_arm’: [‘joint1’, ‘joint2’], ‘right_arm’: [‘joint3’, ‘joint4’]} If no control part is specified, the robot will use all joints as a single control part.
Note
- control_parts can be used without solver_cfg. If solver_cfg is a
dictionary, its keys must correspond to control-part names.
- The joint names in the control parts support regular expressions, e.g., ‘joint[1-6]’.
After initialization of robot, the names will be expanded to a list of full joint names.
- Robot is a derived class of Articulation, with control parts support. So the drive_pros
in ArticulationCfg can use control part as key to specify the corresponding joint drive properties, which will be overridden if these joint names are already specified.
- disable_self_collision: bool#
Whether to enable or disable self-collisions.
- drive_pros: JointDrivePropertiesCfg#
Properties to define the drive mechanism of a joint.
- dual_part: bool#
Whether to emit a
"dual_arm"composite control part.
- enable_gravity: bool#
Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
- fix_base: bool#
Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
- fpath: str#
Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize from a dictionary.
- Parameters:
init_dict (
dict) – Configuration dict.base_robot,mount,arm_partanddual_partdrive the dual-arm derivation; all other recognizedRobotCfgkeys are merged on top viamerge_robot_cfg().- Return type:
- Returns:
A
DualArmRobotCfginstance.
- init_local_pose: np.ndarray | None#
4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
- init_pos: tuple[float, float, float]#
Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- init_qpos: torch.Tensor | np.ndarray | Sequence[float]#
Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
- init_rot: tuple[float, float, float]#
Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- link_attrs: dict[str, LinkPhysicsOverrideCfg] | None#
Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
- min_position_iters: int#
[1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
- min_velocity_iters: int#
[0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
- mount: dict#
Mount configuration consumed by
resolve_mounts().
- qpos_limits: torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None#
Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
- save_to_file(filepath)#
Save config to a local file as JSON.
- sleep_threshold: float#
[0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
- solver_cfg: SolverCfg | Dict[str, SolverCfg] | None#
Solver is used to compute forward and inverse kinematics for the robot.
- to_string()#
Return config as a JSON string.
- urdf_cfg: URDFCfg | None#
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
- use_usd_properties: bool#
Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
- workspace_cfg: Dict[str, RobotWorkspaceCfg] | None#
Runtime workspace cache configuration keyed by control-part name.
- embodichain.lab.sim.robots.build_dual_arm_cfg(base_cfg, mounts, *, dual_part=True, arm_part='arm')[source]#
Build a dual-arm cfg from a single-arm robot cfg.
- Parameters:
base_cfg (
RobotCfg) – A constructed single-armRobotCfgfollowing the"arm"convention.mounts (
Dict[str,ndarray]) –{"left": T, "right": T}4x4 mount transforms fromresolve_mounts().dual_part (
bool) – Whether to include a"dual_arm"composite control part.arm_part (
str) – The base cfg’s manipulator part name.
- Return type:
- Returns:
A populated
DualArmRobotCfg.
Example
base = URRobotCfg.from_dict({“robot_type”: “ur5”}) mounts = resolve_mounts({“preset”: “side_by_side”, “separation”: 0.6}) cfg = build_dual_arm_cfg(base, mounts)