Unverified Commit 35b04a94 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Fixes instructions on importing ANYmal URDF in docs (#1915)

# Description

Previously, the ANYmal URDF importer example was setting the stiffness
and damping to new defaults (100.0 and 0.1 respectively). However, this
is undesirable as we want to import the asset with no stiffness and
damping (as we do effort control). This MR corrects the instructions to
convert ANYmal asset.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- This change requires a documentation update

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent 829f6fe5
...@@ -15,12 +15,13 @@ extensions to Omniverse Kit: ...@@ -15,12 +15,13 @@ extensions to Omniverse Kit:
* **URDF Importer** - Import assets from URDF files. * **URDF Importer** - Import assets from URDF files.
* **MJCF Importer** - Import assets from MJCF files. * **MJCF Importer** - Import assets from MJCF files.
* **Asset Importer** - Import assets from various file formats, including * **Mesh Importer** - Import assets from various file formats, including
OBJ, FBX, STL, and glTF. OBJ, FBX, STL, and glTF.
The recommended workflow from NVIDIA is to use the above importers to convert The recommended workflow from NVIDIA is to use the above importers to convert
the asset into its USD representation. Once the asset is in USD format, you can the asset into its USD representation. Once the asset is in USD format, you can
use the Omniverse Kit to edit the asset and export it to other file formats. Isaac Sim includes these importers by default. They can also be enabled manually in Omniverse Kit. use the Omniverse Kit to edit the asset and export it to other file formats. Isaac Sim includes
these importers by default. They can also be enabled manually in Omniverse Kit.
An important note to use assets for large-scale simulation is to ensure that they An important note to use assets for large-scale simulation is to ensure that they
...@@ -92,7 +93,10 @@ The following shows the steps to clone the repository and run the converter: ...@@ -92,7 +93,10 @@ The following shows the steps to clone the repository and run the converter:
./isaaclab.sh -p scripts/tools/convert_urdf.py \ ./isaaclab.sh -p scripts/tools/convert_urdf.py \
~/git/anymal_d_simple_description/urdf/anymal.urdf \ ~/git/anymal_d_simple_description/urdf/anymal.urdf \
source/isaaclab_assets/data/Robots/ANYbotics/anymal_d.usd \ source/isaaclab_assets/data/Robots/ANYbotics/anymal_d.usd \
--merge-joints --merge-joints \
--joint-stiffness 0.0 \
--joint-damping 0.0 \
--joint-target-type none
Executing the above script will create a USD file inside the Executing the above script will create a USD file inside the
...@@ -117,9 +121,16 @@ You can press play on the opened window to see the asset in the scene. The asset ...@@ -117,9 +121,16 @@ You can press play on the opened window to see the asset in the scene. The asset
Using MJCF Importer Using MJCF Importer
------------------- -------------------
Similar to the URDF Importer, the MJCF Importer also has a GUI interface. Please check the documentation at `MJCF importer`_ for more details. For using the MJCF importer from Python scripts, we include a utility tool called ``convert_mjcf.py``. This script creates an instance of :class:`~sim.converters.MjcfConverterCfg` which is then passed to the :class:`~sim.converters.MjcfConverter` class. Similar to the URDF Importer, the MJCF Importer also has a GUI interface. Please check the documentation at
`MJCF importer`_ for more details. For using the MJCF importer from Python scripts, we include a utility tool
called ``convert_mjcf.py``. This script creates an instance of :class:`~sim.converters.MjcfConverterCfg`
which is then passed to the :class:`~sim.converters.MjcfConverter` class.
The default values for the importer's configuration parameters are specified in the :class:`~sim.converters.MjcfConverterCfg` class. The configuration parameters are listed below. We made a few commonly modified settings to be available as command-line arguments when calling the ``convert_mjcf.py``, and they are marked with ``*`` in the list. For a comprehensive list of the configuration parameters, please check the the documentation at `MJCF importer`_. The default values for the importer's configuration parameters are specified in the
:class:`~sim.converters.MjcfConverterCfg` class. The configuration parameters are listed below.
We made a few commonly modified settings to be available as command-line arguments when calling the
``convert_mjcf.py``, and they are marked with ``*`` in the list. For a comprehensive list of the configuration
parameters, please check the the documentation at `MJCF importer`_.
* :attr:`~sim.converters.MjcfConverterCfg.fix_base*` - Whether to fix the base of the robot. * :attr:`~sim.converters.MjcfConverterCfg.fix_base*` - Whether to fix the base of the robot.
...@@ -167,8 +178,6 @@ Executing the above script will create USD files inside the ...@@ -167,8 +178,6 @@ Executing the above script will create USD files inside the
:alt: result of convert_mjcf.py :alt: result of convert_mjcf.py
Using Mesh Importer Using Mesh Importer
------------------- -------------------
......
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
""" """
Utility to convert a MJCF into USD format. Utility to convert a MJCF into USD format.
MuJoCo XML Format (MJCF) is an XML file format used in MuJoCo to describe all elements of a robot. For more information, see: http://www.mujoco.org/book/XMLreference.html MuJoCo XML Format (MJCF) is an XML file format used in MuJoCo to describe all elements of a robot.
For more information, see: http://www.mujoco.org/book/XMLreference.html
This script uses the MJCF importer extension from Isaac Sim (``isaacsim.asset.importer.mjcf``) to convert a MJCF asset into USD format. It is designed as a convenience script for command-line use. For more information on the MJCF importer, see the documentation for the extension: This script uses the MJCF importer extension from Isaac Sim (``isaacsim.asset.importer.mjcf``) to convert
https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_mjcf.html a MJCF asset into USD format. It is designed as a convenience script for command-line use. For more information
on the MJCF importer, see the documentation for the extension:
https://docs.isaacsim.omniverse.nvidia.com/latest/robot_setup/ext_isaacsim_asset_importer_mjcf.html
positional arguments: positional arguments:
......
...@@ -12,7 +12,7 @@ a robot. For more information, see: http://wiki.ros.org/urdf ...@@ -12,7 +12,7 @@ a robot. For more information, see: http://wiki.ros.org/urdf
This script uses the URDF importer extension from Isaac Sim (``isaacsim.asset.importer.urdf``) to convert a This script uses the URDF importer extension from Isaac Sim (``isaacsim.asset.importer.urdf``) to convert a
URDF asset into USD format. It is designed as a convenience script for command-line use. For more URDF asset into USD format. It is designed as a convenience script for command-line use. For more
information on the URDF importer, see the documentation for the extension: information on the URDF importer, see the documentation for the extension:
https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/ext_omni_isaac_urdf.html https://docs.isaacsim.omniverse.nvidia.com/latest/robot_setup/ext_isaacsim_asset_importer_urdf.html
positional arguments: positional arguments:
...@@ -23,6 +23,9 @@ optional arguments: ...@@ -23,6 +23,9 @@ optional arguments:
-h, --help Show this help message and exit -h, --help Show this help message and exit
--merge-joints Consolidate links that are connected by fixed joints. (default: False) --merge-joints Consolidate links that are connected by fixed joints. (default: False)
--fix-base Fix the base to where it is imported. (default: False) --fix-base Fix the base to where it is imported. (default: False)
--joint-stiffness The stiffness of the joint drive. (default: 100.0)
--joint-damping The damping of the joint drive. (default: 1.0)
--joint-target-type The type of control to use for the joint drive. (default: "position")
""" """
...@@ -43,6 +46,26 @@ parser.add_argument( ...@@ -43,6 +46,26 @@ parser.add_argument(
help="Consolidate links that are connected by fixed joints.", help="Consolidate links that are connected by fixed joints.",
) )
parser.add_argument("--fix-base", action="store_true", default=False, help="Fix the base to where it is imported.") parser.add_argument("--fix-base", action="store_true", default=False, help="Fix the base to where it is imported.")
parser.add_argument(
"--joint-stiffness",
type=float,
default=100.0,
help="The stiffness of the joint drive.",
)
parser.add_argument(
"--joint-damping",
type=float,
default=1.0,
help="The damping of the joint drive.",
)
parser.add_argument(
"--joint-target-type",
type=str,
default="position",
choices=["position", "velocity", "none"],
help="The type of control to use for the joint drive.",
)
# append AppLauncher cli args # append AppLauncher cli args
AppLauncher.add_app_launcher_args(parser) AppLauncher.add_app_launcher_args(parser)
# parse the arguments # parse the arguments
...@@ -87,7 +110,11 @@ def main(): ...@@ -87,7 +110,11 @@ def main():
merge_fixed_joints=args_cli.merge_joints, merge_fixed_joints=args_cli.merge_joints,
force_usd_conversion=True, force_usd_conversion=True,
joint_drive=UrdfConverterCfg.JointDriveCfg( joint_drive=UrdfConverterCfg.JointDriveCfg(
gains=UrdfConverterCfg.JointDriveCfg.PDGainsCfg(stiffness=100.0, damping=1.0) gains=UrdfConverterCfg.JointDriveCfg.PDGainsCfg(
stiffness=args_cli.joint_stiffness,
damping=args_cli.joint_damping,
),
target_type=args_cli.joint_target_type,
), ),
) )
......
...@@ -16,6 +16,7 @@ class UrdfConverterCfg(AssetConverterBaseCfg): ...@@ -16,6 +16,7 @@ class UrdfConverterCfg(AssetConverterBaseCfg):
@configclass @configclass
class JointDriveCfg: class JointDriveCfg:
"""Configuration for the joint drive."""
@configclass @configclass
class PDGainsCfg: class PDGainsCfg:
...@@ -105,16 +106,18 @@ class UrdfConverterCfg(AssetConverterBaseCfg): ...@@ -105,16 +106,18 @@ class UrdfConverterCfg(AssetConverterBaseCfg):
"""Convert mimic joints to normal joints. Defaults to False.""" """Convert mimic joints to normal joints. Defaults to False."""
joint_drive: JointDriveCfg | None = JointDriveCfg() joint_drive: JointDriveCfg | None = JointDriveCfg()
"""The joint drive settings. """The joint drive settings. Defaults to :class:`JointDriveCfg`.
None can be used for URDFs without joints. The parameter can be set to ``None`` for URDFs without joints.
""" """
collision_from_visuals = False collision_from_visuals = False
"""Create collision geometry from visual geometry.""" """Whether to create collision geometry from visual geometry. Defaults to False."""
collider_type: Literal["convex_hull", "convex_decomposition"] = "convex_hull" collider_type: Literal["convex_hull", "convex_decomposition"] = "convex_hull"
"""The collision shape simplification. Defaults to ``"convex_hull"``. """The collision shape simplification. Defaults to "convex_hull".
Supported values are:
* ``"convex_hull"``: The collision shape is simplified to a convex hull. * ``"convex_hull"``: The collision shape is simplified to a convex hull.
* ``"convex_decomposition"``: The collision shape is decomposed into smaller convex shapes for a closer fit. * ``"convex_decomposition"``: The collision shape is decomposed into smaller convex shapes for a closer fit.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment