|
| 1 | +# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: BSD-3-Clause |
| 5 | + |
| 6 | +from dataclasses import MISSING |
| 7 | + |
| 8 | +from isaaclab.utils import configclass |
| 9 | + |
| 10 | + |
| 11 | +@configclass |
| 12 | +class ActuatorBaseCfg: |
| 13 | + """Configuration for default actuators in an articulation.""" |
| 14 | + |
| 15 | + class_type: type = MISSING |
| 16 | + """The associated actuator class. |
| 17 | +
|
| 18 | + The class should inherit from :class:`isaaclab.actuators.ActuatorBase`. |
| 19 | + """ |
| 20 | + |
| 21 | + joint_names_expr: list[str] = MISSING |
| 22 | + """Articulation's joint names that are part of the group. |
| 23 | +
|
| 24 | + Note: |
| 25 | + This can be a list of joint names or a list of regex expressions (e.g. ".*"). |
| 26 | + """ |
| 27 | + |
| 28 | + effort_limit: dict[str, float] | float | None = None |
| 29 | + """Force/Torque limit of the joints in the group. Defaults to None. |
| 30 | +
|
| 31 | + This limit is used to clip the computed torque sent to the simulation. If None, the |
| 32 | + limit is set to the value specified in the USD joint prim. |
| 33 | +
|
| 34 | + .. attention:: |
| 35 | +
|
| 36 | + The :attr:`effort_limit_sim` attribute should be used to set the effort limit for |
| 37 | + the simulation physics solver. |
| 38 | +
|
| 39 | + The :attr:`effort_limit` attribute is used for clipping the effort output of the |
| 40 | + actuator model **only** in the case of explicit actuators, such as the |
| 41 | + :class:`~isaaclab.actuators.IdealPDActuator`. |
| 42 | +
|
| 43 | + .. note:: |
| 44 | +
|
| 45 | + For implicit actuators, the attributes :attr:`effort_limit` and :attr:`effort_limit_sim` |
| 46 | + are equivalent. However, we suggest using the :attr:`effort_limit_sim` attribute because |
| 47 | + it is more intuitive. |
| 48 | +
|
| 49 | + """ |
| 50 | + |
| 51 | + velocity_limit: dict[str, float] | float | None = None |
| 52 | + """Velocity limit of the joints in the group. Defaults to None. |
| 53 | +
|
| 54 | + This limit is used by the actuator model. If None, the limit is set to the value specified |
| 55 | + in the USD joint prim. |
| 56 | +
|
| 57 | + .. attention:: |
| 58 | +
|
| 59 | + The :attr:`velocity_limit_sim` attribute should be used to set the velocity limit for |
| 60 | + the simulation physics solver. |
| 61 | +
|
| 62 | + The :attr:`velocity_limit` attribute is used for clipping the effort output of the |
| 63 | + actuator model **only** in the case of explicit actuators, such as the |
| 64 | + :class:`~isaaclab.actuators.IdealPDActuator`. |
| 65 | +
|
| 66 | + .. note:: |
| 67 | +
|
| 68 | + For implicit actuators, the attribute :attr:`velocity_limit` is not used. This is to stay |
| 69 | + backwards compatible with previous versions of the Isaac Lab, where this parameter was |
| 70 | + unused since PhysX did not support setting the velocity limit for the joints using the |
| 71 | + PhysX Tensor API. |
| 72 | + """ |
| 73 | + |
| 74 | + effort_limit_sim: dict[str, float] | float | None = None |
| 75 | + """Effort limit of the joints in the group applied to the simulation physics solver. Defaults to None. |
| 76 | +
|
| 77 | + The effort limit is used to constrain the computed joint efforts in the physics engine. If the |
| 78 | + computed effort exceeds this limit, the physics engine will clip the effort to this value. |
| 79 | +
|
| 80 | + Since explicit actuators (e.g. DC motor), compute and clip the effort in the actuator model, this |
| 81 | + limit is by default set to a large value to prevent the physics engine from any additional clipping. |
| 82 | + However, at times, it may be necessary to set this limit to a smaller value as a safety measure. |
| 83 | +
|
| 84 | + If None, the limit is resolved based on the type of actuator model: |
| 85 | +
|
| 86 | + * For implicit actuators, the limit is set to the value specified in the USD joint prim. |
| 87 | + * For explicit actuators, the limit is set to 1.0e9. |
| 88 | +
|
| 89 | + """ |
| 90 | + |
| 91 | + velocity_limit_sim: dict[str, float] | float | None = None |
| 92 | + """Velocity limit of the joints in the group applied to the simulation physics solver. Defaults to None. |
| 93 | +
|
| 94 | + The velocity limit is used to constrain the joint velocities in the physics engine. The joint will only |
| 95 | + be able to reach this velocity if the joint's effort limit is sufficiently large. If the joint is moving |
| 96 | + faster than this velocity, the physics engine will actually try to brake the joint to reach this velocity. |
| 97 | +
|
| 98 | + If None, the limit is set to the value specified in the USD joint prim for both implicit and explicit actuators. |
| 99 | +
|
| 100 | + .. tip:: |
| 101 | + If the velocity limit is too tight, the physics engine may have trouble converging to a solution. |
| 102 | + In such cases, we recommend either keeping this value sufficiently large or tuning the stiffness and |
| 103 | + damping parameters of the joint to ensure the limits are not violated. |
| 104 | +
|
| 105 | + """ |
| 106 | + |
| 107 | + stiffness: dict[str, float] | float | None = MISSING |
| 108 | + """Stiffness gains (also known as p-gain) of the joints in the group. |
| 109 | +
|
| 110 | + The behavior of the stiffness is different for implicit and explicit actuators. For implicit actuators, |
| 111 | + the stiffness gets set into the physics engine directly. For explicit actuators, the stiffness is used |
| 112 | + by the actuator model to compute the joint efforts. |
| 113 | +
|
| 114 | + If None, the stiffness is set to the value from the USD joint prim. |
| 115 | + """ |
| 116 | + |
| 117 | + damping: dict[str, float] | float | None = MISSING |
| 118 | + """Damping gains (also known as d-gain) of the joints in the group. |
| 119 | +
|
| 120 | + The behavior of the damping is different for implicit and explicit actuators. For implicit actuators, |
| 121 | + the damping gets set into the physics engine directly. For explicit actuators, the damping gain is used |
| 122 | + by the actuator model to compute the joint efforts. |
| 123 | +
|
| 124 | + If None, the damping is set to the value from the USD joint prim. |
| 125 | + """ |
| 126 | + |
| 127 | + armature: dict[str, float] | float | None = None |
| 128 | + """Armature of the joints in the group. Defaults to None. |
| 129 | +
|
| 130 | + The armature is directly added to the corresponding joint-space inertia. It helps improve the |
| 131 | + simulation stability by reducing the joint velocities. |
| 132 | +
|
| 133 | + It is a physics engine solver parameter that gets set into the simulation. |
| 134 | +
|
| 135 | + If None, the armature is set to the value from the USD joint prim. |
| 136 | + """ |
| 137 | + |
| 138 | + friction: dict[str, float] | float | None = None |
| 139 | + r"""The static friction coefficient of the joints in the group. Defaults to None. |
| 140 | +
|
| 141 | + The joint static friction is a unitless quantity. It relates the magnitude of the spatial force transmitted |
| 142 | + from the parent body to the child body to the maximal static friction force that may be applied by the solver |
| 143 | + to resist the joint motion. |
| 144 | +
|
| 145 | + Mathematically, this means that: :math:`F_{resist} \leq \mu F_{spatial}`, where :math:`F_{resist}` |
| 146 | + is the resisting force applied by the solver and :math:`F_{spatial}` is the spatial force |
| 147 | + transmitted from the parent body to the child body. The simulated static friction effect is therefore |
| 148 | + similar to static and Coulomb static friction. |
| 149 | +
|
| 150 | + If None, the joint static friction is set to the value from the USD joint prim. |
| 151 | +
|
| 152 | + Note: In Isaac Sim 4.5, this parameter is modeled as a coefficient. In Isaac Sim 5.0 and later, |
| 153 | + it is modeled as an effort (torque or force). |
| 154 | + """ |
| 155 | + |
| 156 | + dynamic_friction: dict[str, float] | float | None = None |
| 157 | + """The dynamic friction coefficient of the joints in the group. Defaults to None. |
| 158 | +
|
| 159 | + Note: In Isaac Sim 4.5, this parameter is modeled as a coefficient. In Isaac Sim 5.0 and later, |
| 160 | + it is modeled as an effort (torque or force). |
| 161 | + """ |
| 162 | + |
| 163 | + viscous_friction: dict[str, float] | float | None = None |
| 164 | + """The viscous friction coefficient of the joints in the group. Defaults to None. |
| 165 | + """ |
0 commit comments