Add <damper> actuator shortcut and related mjGAIN_AFFINE.
**Rationale** A general `mjGAIN_AFFINE` actuator adds the term `force = (c + kp * length + kv * velocity) * ctrl`. The damper shortcut restricts it to `kv * velocity * ctrl` and sets the `ctrllimited` attribute to true. **API** ```xml <actuator> <damper ctrlrange="0 1" kv="1"/> </actuator> ``` * Required attributes: `ctrlrange` (>=0) * Optional attributes: `kv` (>=0) PiperOrigin-RevId: 455366866 Change-Id: I88773abbeccabb6442f215c9fc05e205df63f692
This commit is contained in:
committed by
Copybara-Service
parent
e0b6ba4a13
commit
307cf692e5
@@ -403,6 +403,7 @@ mjtGain
|
||||
typedef enum _mjtGain
|
||||
{
|
||||
mjGAIN_FIXED = 0, // fixed gain
|
||||
mjGAIN_AFFINE, // const + kp*length + kv*velocity
|
||||
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
|
||||
mjGAIN_USER // user-defined gain type
|
||||
} mjtGain;
|
||||
|
||||
+71
-8
@@ -412,6 +412,17 @@ if present, the parser ignores it. The symbols in the second column of the table
|
||||
| | | | :at:`actrange` | | | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
+--------------------------+----+------------------------------------------------------------------------------------+
|
||||
| |_2|:el:`damper` | ? | .. table:: |
|
||||
| | | :class: mjcf-attributes |
|
||||
| | | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`ctrllimited` | :at:`forcelimited` | :at:`ctrlrange` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`forcerange` | :at:`gear` | :at:`cranklength` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`user` | :at:`group` | :at:`kv` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
+--------------------------+----+------------------------------------------------------------------------------------+
|
||||
| |_2|:el:`cylinder` | ? | .. table:: |
|
||||
| | | :class: mjcf-attributes |
|
||||
| | | |
|
||||
@@ -991,6 +1002,23 @@ if present, the parser ignores it. The symbols in the second column of the table
|
||||
| | | | :at:`kp` | | | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
+--------------------------+----+------------------------------------------------------------------------------------+
|
||||
| |_2|:el:`damper` | \* | .. table:: |
|
||||
| | | :class: mjcf-attributes |
|
||||
| | | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`name` | :at:`class` | :at:`group` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`ctrllimited` | :at:`forcelimited` | :at:`ctrlrange` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`forcerange` | :at:`lengthrange` | :at:`gear` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`cranklength` | :at:`user` | :at:`joint` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`jointinparent` | :at:`tendon` | :at:`slidersite` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
| | | | :at:`cranksite` | :at:`site` | :at:`kv` | |
|
||||
| | | +-------------------------+-------------------------+-------------------------+ |
|
||||
+--------------------------+----+------------------------------------------------------------------------------------+
|
||||
| |_2|:el:`cylinder` | \* | .. table:: |
|
||||
| | | :class: mjcf-attributes |
|
||||
| | | |
|
||||
@@ -2328,6 +2356,14 @@ slidersite, cranksite.
|
||||
All :ref:`intvelocity <intvelocity>` attributes are available here except: name, class, joint, jointinparent, site, tendon,
|
||||
slidersite, cranksite.
|
||||
|
||||
.. _default-damper:
|
||||
|
||||
:el-prefix:`default/` **damper** (?)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
All :ref:`damper <damper>` attributes are available here except: name, class, joint, jointinparent, site, tendon,
|
||||
slidersite, cranksite.
|
||||
|
||||
.. _default-cylinder:
|
||||
|
||||
:el-prefix:`default/` **cylinder** (?)
|
||||
@@ -4401,7 +4437,6 @@ gaintype fixed gainprm kv 0 0
|
||||
biastype affine biasprm 0 0 -kv
|
||||
========= ======= ========= =======
|
||||
|
||||
|
||||
This element has one custom attribute in addition to the common attributes:
|
||||
|
||||
.. |actuator/velocity attrib list| replace::
|
||||
@@ -4423,13 +4458,14 @@ This element creates an integrated-velocity servo. For more information, see the
|
||||
:ref:`Activation clamping <CActRange>` section of the Modeling chapter. The underlying
|
||||
:el:`general` attributes are set as follows:
|
||||
|
||||
========= =========== ========= =======
|
||||
Attribute Setting Attribute Setting
|
||||
========= =========== ========= =======
|
||||
dyntype integrator dynprm 1 0 0
|
||||
gaintype fixed gainprm kp 0 0
|
||||
biastype affine biasprm 0 -kp 0
|
||||
========= =========== ========= =======
|
||||
========== =========== ========= =======
|
||||
Attribute Setting Attribute Setting
|
||||
========== =========== ========= =======
|
||||
dyntype integrator dynprm 1 0 0
|
||||
gaintype fixed gainprm kp 0 0
|
||||
biastype affine biasprm 0 -kp 0
|
||||
actlimited true
|
||||
========== =========== ========= =======
|
||||
|
||||
This element has one custom attribute in addition to the common attributes:
|
||||
|
||||
@@ -4443,6 +4479,33 @@ This element has one custom attribute in addition to the common attributes:
|
||||
:at:`kp`: :at-val:`real, "1"`
|
||||
Position feedback gain.
|
||||
|
||||
.. _damper:
|
||||
|
||||
:el-prefix:`actuator/` **damper** (*)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This element is an active damper which produces a force proportional to both velocity and control: ``F = - kv * velocity * control``, where ``kv`` must be nonnegative. :at:`ctrlrange` is required and must also be nonnegative. The underlying :el:`general` attributes are set as follows:
|
||||
|
||||
=========== ======= ========= =======
|
||||
Attribute Setting Attribute Setting
|
||||
=========== ======= ========= =======
|
||||
dyntype none dynprm 1 0 0
|
||||
gaintype affine gainprm 0 0 kv
|
||||
biastype none biasprm 0 0 0
|
||||
ctrllimited true
|
||||
=========== ======= ========= =======
|
||||
|
||||
|
||||
This element has one custom attribute in addition to the common attributes:
|
||||
|
||||
.. |actuator/damper attrib list| replace::
|
||||
:at:`name`, :at:`class`, :at:`group`, :at:`ctrllimited`, :at:`forcelimited`, :at:`ctrlrange`, :at:`forcerange`, :at:`lengthrange`, :at:`gear`, :at:`cranklength`, :at:`joint`, :at:`jointinparent`, :at:`tendon`, :at:`cranksite`, :at:`slidersite`, :at:`site`, :at:`user`
|
||||
|
||||
|actuator/damper attrib list|
|
||||
Same as in actuator/ :ref:`general <general>`.
|
||||
:at:`kv`: :at-val:`real, "1"`
|
||||
Velocity feedback gain.
|
||||
|
||||
.. _cylinder:
|
||||
|
||||
:el-prefix:`actuator/` **cylinder** (*)
|
||||
|
||||
+2
-11
@@ -545,18 +545,9 @@ Actuator shortcuts
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
As explained in the :ref:`Actuation model <geActuation>` section of the Computation chapter, MuJoCo offers a flexible
|
||||
actuator model with transmission, activation dynamics and force generation components that can be specified
|
||||
independently. The full functionality can be accessed via the XML element :ref:`general <general>` which allows the user
|
||||
actuator model with transmission, activation dynamics and force generation components that can be specified independently. The full functionality can be accessed via the XML element :ref:`general <general>` which allows the user
|
||||
to create a variety of custom actuators. In addition, MJCF provides shortcuts for configuring common actuators. This is
|
||||
done via the XML elements :ref:`motor <motor>`, :ref:`position <position>`, :ref:`velocity <velocity>`,
|
||||
:ref:`intvelocity <intvelocity>`, :ref:`cylinder<cylinder>`, and :ref:`muscle <muscle>`. These are *not* separate model
|
||||
elements. Internally MuJoCo supports only one actuator type - which is why when an MJCF model is saved all actuators are
|
||||
written as :el:`general`. Shortcuts create general actuators implicitly, set their attributes to suitable values, and
|
||||
expose a subset of attributes with possibly different names. For example, :el:`position` creates a position servo with
|
||||
attribute :at:`kp` which is the servo gain. However :el:`general` does not have an attribute :at:`kp`. Instead the parser
|
||||
adjusts the gain and bias parameters of the general actuator in a coordinated way so as to mimic a position servo. The
|
||||
same effect could have been achieved by using :el:`general` directly, and setting its attributes to certain values as
|
||||
described below.
|
||||
done via the XML elements :ref:`motor <motor>`, :ref:`position <position>`, :ref:`velocity <velocity>`, :ref:`intvelocity <intvelocity>`, :ref:`damper<damper>`, :ref:`cylinder<cylinder>`, and :ref:`muscle <muscle>`. These are *not* separate model elements. Internally MuJoCo supports only one actuator type - which is why when an MJCF model is saved all actuators are written as :el:`general`. Shortcuts create general actuators implicitly, set their attributes to suitable values, and expose a subset of attributes with possibly different names. For example, :el:`position` creates a position servo with attribute :at:`kp` which is the servo gain. However :el:`general` does not have an attribute :at:`kp`. Instead the parser adjusts the gain and bias parameters of the general actuator in a coordinated way so as to mimic a position servo. The same effect could have been achieved by using :el:`general` directly, and setting its attributes to certain values as described below.
|
||||
|
||||
Actuator shortcuts also interact with defaults. Recall that the :ref:`default setting <CDefault>` mechanism involves
|
||||
classes, each of which has a complete collection of dummy elements (one of each element type) used to initialize the
|
||||
|
||||
Reference in New Issue
Block a user