Skip to content

Commit deab8e1

Browse files
DeepMindcopybara-github
authored andcommitted
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: Idba7ad95007405d5c7190437c291d6e7644d8615
1 parent 86dbf93 commit deab8e1

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

dm_control/mjcf/schema.xml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,18 @@
446446
<attribute name="kp" type="float"/>
447447
</attributes>
448448
</element>
449+
<element name="damper">
450+
<attributes>
451+
<attribute name="group" type="int"/>
452+
<attribute name="forcelimited" type="keyword" valid_values="false true"/>
453+
<attribute name="ctrlrange" type="array" array_type="float" array_size="2"/>
454+
<attribute name="forcerange" type="array" array_type="float" array_size="2"/>
455+
<attribute name="gear" type="array" array_type="float" array_size="6"/>
456+
<attribute name="cranklength" type="float"/>
457+
<attribute name="user" type="array" array_type="float"/>
458+
<attribute name="kv" type="float"/>
459+
</attributes>
460+
</element>
449461
<element name="cylinder">
450462
<attributes>
451463
<attribute name="group" type="int"/>
@@ -701,6 +713,30 @@
701713
<attribute name="kv" type="float"/>
702714
</attributes>
703715
</element>
716+
<element name="intvelocity">
717+
<attributes>
718+
<attribute name="ctrllimited" type="keyword" valid_values="false true"/>
719+
<attribute name="forcelimited" type="keyword" valid_values="false true"/>
720+
<attribute name="ctrlrange" type="array" array_type="float" array_size="2"/>
721+
<attribute name="forcerange" type="array" array_type="float" array_size="2"/>
722+
<attribute name="actrange" type="array" array_type="float" array_size="2"/>
723+
<attribute name="gear" type="array" array_type="float" array_size="6"/>
724+
<attribute name="cranklength" type="float"/>
725+
<attribute name="user" type="array" array_type="float"/>
726+
<attribute name="kp" type="float"/>
727+
</attributes>
728+
</element>
729+
<element name="damper">
730+
<attributes>
731+
<attribute name="forcelimited" type="keyword" valid_values="false true"/>
732+
<attribute name="ctrlrange" type="array" array_type="float" array_size="2"/>
733+
<attribute name="forcerange" type="array" array_type="float" array_size="2"/>
734+
<attribute name="gear" type="array" array_type="float" array_size="6"/>
735+
<attribute name="cranklength" type="float"/>
736+
<attribute name="user" type="array" array_type="float"/>
737+
<attribute name="kv" type="float"/>
738+
</attributes>
739+
</element>
704740
<element name="cylinder">
705741
<attributes>
706742
<attribute name="ctrllimited" type="keyword" valid_values="false true"/>
@@ -1540,6 +1576,50 @@
15401576
<attribute name="kv" type="float"/>
15411577
</attributes>
15421578
</element>
1579+
<element name="intvelocity" repeated="true" namespace="actuator">
1580+
<attributes>
1581+
<attribute name="name" type="identifier"/>
1582+
<attribute name="class" type="reference" reference_namespace="default"/>
1583+
<attribute name="group" type="int"/>
1584+
<attribute name="ctrllimited" type="keyword" valid_values="false true"/>
1585+
<attribute name="forcelimited" type="keyword" valid_values="false true"/>
1586+
<attribute name="ctrlrange" type="array" array_type="float" array_size="2"/>
1587+
<attribute name="forcerange" type="array" array_type="float" array_size="2"/>
1588+
<attribute name="actrange" type="array" array_type="float" array_size="2"/>
1589+
<attribute name="lengthrange" type="array" array_type="float" array_size="2"/>
1590+
<attribute name="gear" type="array" array_type="float" array_size="6"/>
1591+
<attribute name="cranklength" type="float"/>
1592+
<attribute name="joint" type="reference"/>
1593+
<attribute name="jointinparent" type="reference" reference_namespace="joint"/>
1594+
<attribute name="tendon" type="reference"/>
1595+
<attribute name="cranksite" type="reference" reference_namespace="site"/>
1596+
<attribute name="slidersite" type="reference" reference_namespace="site"/>
1597+
<attribute name="site" type="reference"/>
1598+
<attribute name="user" type="array" array_type="float"/>
1599+
<attribute name="kp" type="float"/>
1600+
</attributes>
1601+
</element>
1602+
<element name="damper" repeated="true" namespace="actuator">
1603+
<attributes>
1604+
<attribute name="name" type="identifier"/>
1605+
<attribute name="class" type="reference" reference_namespace="default"/>
1606+
<attribute name="group" type="int"/>
1607+
<attribute name="forcelimited" type="keyword" valid_values="false true"/>
1608+
<attribute name="ctrlrange" type="array" array_type="float" array_size="2"/>
1609+
<attribute name="forcerange" type="array" array_type="float" array_size="2"/>
1610+
<attribute name="lengthrange" type="array" array_type="float" array_size="2"/>
1611+
<attribute name="gear" type="array" array_type="float" array_size="6"/>
1612+
<attribute name="cranklength" type="float"/>
1613+
<attribute name="joint" type="reference"/>
1614+
<attribute name="jointinparent" type="reference" reference_namespace="joint"/>
1615+
<attribute name="tendon" type="reference"/>
1616+
<attribute name="cranksite" type="reference" reference_namespace="site"/>
1617+
<attribute name="slidersite" type="reference" reference_namespace="site"/>
1618+
<attribute name="site" type="reference"/>
1619+
<attribute name="user" type="array" array_type="float"/>
1620+
<attribute name="kv" type="float"/>
1621+
</attributes>
1622+
</element>
15431623
<element name="cylinder" repeated="true" namespace="actuator">
15441624
<attributes>
15451625
<attribute name="name" type="identifier"/>

0 commit comments

Comments
 (0)