Skip to content

Commit

Permalink
Fixes paths of assets for Nucleus server (#275)
Browse files Browse the repository at this point in the history
As we pushed all the assets to the Nucleus, this MR now adapts all the
paths to the assets to make sure they work correctly.

Fixes #166

- Bug fix (non-breaking change which fixes an issue)

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] 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
  • Loading branch information
Mayankm96 committed Dec 10, 2023
1 parent 623b2d9 commit 0757d4e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 27 deletions.
4 changes: 2 additions & 2 deletions source/extensions/omni.isaac.orbit/omni/isaac/orbit/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,11 +652,11 @@ def _load_extensions(self):
if int(isaacsim_version[2]) == 2023:
carb_settings_iface.set_string(
"/persistent/isaac/asset_root/default",
"http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.0",
"http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1",
)
carb_settings_iface.set_string(
"/persistent/isaac/asset_root/nvidia",
"http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets",
"http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1",
)

def _hide_stop_button(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
* :obj:`ANYMAL_B_CFG`: The ANYmal-B robot with ANYdrives 3.0
* :obj:`ANYMAL_C_CFG`: The ANYmal-C robot with ANYdrives 3.0
* :obj:`ANYMAL_D_CFG`: The ANYmal-D robot with ANYdrives 3.0
Reference:
* https://github.com/ANYbotics/anymal_b_simple_description
* https://github.com/ANYbotics/anymal_c_simple_description
* https://github.com/ANYbotics/anymal_d_simple_description
"""

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.actuators import ActuatorNetLSTMCfg, DCMotorCfg
from omni.isaac.orbit.utils.assets import ISAAC_NUCLEUS_DIR, ISAAC_ORBIT_NUCLEUS_DIR
from omni.isaac.orbit.utils.assets import ISAAC_ORBIT_NUCLEUS_DIR

from ..articulation import ArticulationCfg

Expand All @@ -40,7 +42,7 @@

ANYDRIVE_3_LSTM_ACTUATOR_CFG = ActuatorNetLSTMCfg(
joint_names_expr=[".*HAA", ".*HFE", ".*KFE"],
network_file=f"{ISAAC_ORBIT_NUCLEUS_DIR}/ActuatorNets/anydrive_3_lstm_jit.pt",
network_file=f"{ISAAC_ORBIT_NUCLEUS_DIR}/ActuatorNets/ANYbotics/anydrive_3_lstm_jit.pt",
saturation_effort=120.0,
effort_limit=80.0,
velocity_limit=7.5,
Expand All @@ -54,7 +56,7 @@

ANYMAL_B_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/ANYbotics/ANYmalB/anymal_b_instanceable.usd",
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/ANYbotics/ANYmal-B/anymal_b.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
Expand Down Expand Up @@ -88,9 +90,8 @@

ANYMAL_C_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
# usd_path=f"{ORBIT_ASSETS_DATA_DIR}/Robots/ANYbotics/ANYmal-D/anymal_d.usd",
usd_path=f"{ISAAC_NUCLEUS_DIR}/Robots/ANYbotics/anymal_instanceable.usd",
# usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/ANYbotics/ANYmalC/anymal_c_minimal_instanceable.usd",
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/ANYbotics/ANYmal-C/anymal_c.usd",
# usd_path=f"{ISAAC_NUCLEUS_DIR}/Robots/ANYbotics/anymal_instanceable.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
Expand Down Expand Up @@ -120,3 +121,43 @@
soft_joint_pos_limit_factor=0.95,
)
"""Configuration of ANYmal-C robot using actuator-net."""


ANYMAL_D_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/ANYbotics/ANYmal-D/anymal_d.usd",
# usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/ANYbotics/ANYmal-D/anymal_d_minimal.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetration_velocity=1.0,
),
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
enabled_self_collisions=True, solver_position_iteration_count=4, solver_velocity_iteration_count=0
),
# collision_props=sim_utils.CollisionPropertiesCfg(contact_offset=0.02, rest_offset=0.0),
),
init_state=ArticulationCfg.InitialStateCfg(
pos=(0.0, 0.0, 0.6),
joint_pos={
".*HAA": 0.0, # all HAA
".*F_HFE": 0.4, # both front HFE
".*H_HFE": -0.4, # both hind HFE
".*F_KFE": -0.8, # both front KFE
".*H_KFE": 0.8, # both hind KFE
},
),
actuators={"legs": ANYDRIVE_3_LSTM_ACTUATOR_CFG},
soft_joint_pos_limit_factor=0.95,
)
"""Configuration of ANYmal-D robot using actuator-net.
Note:
Since we don't have a publicly available actuator network for ANYmal-D, we use the same network as ANYmal-C.
This may impact the sim-to-real transfer performance.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@

from __future__ import annotations

from omni.isaac.orbit_assets import ORBIT_ASSETS_DATA_DIR

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.actuators import ImplicitActuatorCfg
from omni.isaac.orbit.assets import ArticulationCfg
from omni.isaac.orbit.utils.assets import ISAAC_ORBIT_NUCLEUS_DIR

# Cartpole articulation configuration
CARTPOLE_CFG = ArticulationCfg(
# USD file configuration
spawn=sim_utils.UsdFileCfg(
# Location of USD file
usd_path=f"{ORBIT_ASSETS_DATA_DIR}/Robots/Classic/Cartpole/cartpole.usd",
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/Classic/Cartpole/cartpole.usd",
# Rigid body properties
rigid_props=sim_utils.RigidBodyPropertiesCfg(
rigid_body_enabled=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

UNITREE_A1_CFG = ArticulationCfg(
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/Unitree/A1/a1_instanceable.usd",
usd_path=f"{ISAAC_ORBIT_NUCLEUS_DIR}/Robots/Unitree/A1/a1.usd",
activate_contact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
Expand Down
23 changes: 16 additions & 7 deletions source/extensions/omni.isaac.orbit/test/sim/test_mesh_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

"""Launch Isaac Sim Simulator first."""

from omni.isaac.kit import SimulationApp
from omni.isaac.orbit.app import AppLauncher

# launch omniverse app
config = {"headless": True}
simulation_app = SimulationApp(config)
simulation_app = AppLauncher(headless=True).app

"""Rest everything follows."""

import os
import tempfile
import traceback
import unittest

Expand All @@ -23,11 +23,11 @@
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
from omni.isaac.core.simulation_context import SimulationContext
from omni.isaac.orbit_assets import ORBIT_ASSETS_DATA_DIR
from pxr import UsdGeom, UsdPhysics

from omni.isaac.orbit.sim.converters import MeshConverter, MeshConverterCfg
from omni.isaac.orbit.sim.schemas import schemas_cfg
from omni.isaac.orbit.utils.assets import ISAAC_ORBIT_NUCLEUS_DIR, retrieve_file_path


class TestMeshConverter(unittest.TestCase):
Expand All @@ -36,10 +36,19 @@ class TestMeshConverter(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""Load assets for tests."""
# TODO: Clean this up: https://github.com/isaac-orbit/orbit/issues/166
assets_dir = os.path.join(ORBIT_ASSETS_DATA_DIR, "Samples/Tests/MeshConverter/duck")
assets_dir = f"{ISAAC_ORBIT_NUCLEUS_DIR}/Tests/MeshConverter/duck"
# Create mapping of file endings to file paths that can be used by tests
cls.assets = {asset.split(".")[1]: os.path.join(assets_dir, asset) for asset in os.listdir(assets_dir)}
cls.assets = {
"obj": f"{assets_dir}/duck.obj",
"stl": f"{assets_dir}/duck.stl",
"fbx": f"{assets_dir}/duck.fbx",
"mtl": f"{assets_dir}/duck.mtl",
"png": f"{assets_dir}/duckCM.png",
}
# Download all these locally
download_dir = tempfile.mkdtemp(suffix="_mesh_converter_test_assets")
for key, value in cls.assets.items():
cls.assets[key] = retrieve_file_path(value, download_dir=download_dir)

def setUp(self):
"""Create a blank new stage for each test."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
from .utils import import_packages

# The blacklist is used to prevent importing configs from sub-packages
_BLACKLIST_PKGS = ["locomotion.velocity.config.anymal_d", "utils"]
_BLACKLIST_PKGS = ["utils"]
# Import all configs in this package
import_packages(__name__, _BLACKLIST_PKGS)
14 changes: 7 additions & 7 deletions source/standalone/demos/quadrupeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import Articulation
from omni.isaac.orbit.assets.config.anymal import ANYMAL_B_CFG, ANYMAL_C_CFG
from omni.isaac.orbit.assets.config.anymal import ANYMAL_B_CFG, ANYMAL_C_CFG, ANYMAL_D_CFG
from omni.isaac.orbit.assets.config.unitree import UNITREE_A1_CFG


Expand Down Expand Up @@ -86,18 +86,18 @@ def design_scene() -> tuple[dict, list[list[float]]]:
# -- Robot
anymal_c = Articulation(ANYMAL_C_CFG.replace(prim_path="/World/Origin2/Robot"))

# Origin 3 with Unitree A1
# Origin 3 with Anymal D
prim_utils.create_prim("/World/Origin3", "Xform", translation=origins[2])
# -- Robot
unitree_a = Articulation(UNITREE_A1_CFG.replace(prim_path="/World/Origin3/Robot"))
anymal_d = Articulation(ANYMAL_D_CFG.replace(prim_path="/World/Origin3/Robot"))

# Origin 4 with Unitree Go1
prim_utils.create_prim("/World/Origin4", "Xform", translation=origins[2])
# Origin 4 with Unitree A1
prim_utils.create_prim("/World/Origin4", "Xform", translation=origins[3])
# -- Robot
unitree_go1 = Articulation(UNITREE_A1_CFG.replace(prim_path="/World/Origin4/Robot"))
unitree_a = Articulation(UNITREE_A1_CFG.replace(prim_path="/World/Origin4/Robot"))

# return the scene information
scene_entities = {"anymal_b": anymal_b, "anymal_c": anymal_c, "unitree_a": unitree_a, "unitree_go1": unitree_go1}
scene_entities = {"anymal_b": anymal_b, "anymal_c": anymal_c, "anymal_d": anymal_d, "unitree_a": unitree_a}
return scene_entities, origins


Expand Down

0 comments on commit 0757d4e

Please sign in to comment.