Skip to content
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
370 commits
Select commit Hold shift + click to select a range
5c927da
Merge branch 'main' into feature/prim-prop-funcs
kellyguo11 Sep 8, 2025
7864b21
Merge branch 'main' into fix/instanced-proxies
kellyguo11 Sep 8, 2025
dd61d3e
revert changes to merge prs
renezurbruegg Sep 9, 2025
82819d8
Merge branch 'sim_utils' into feature/multi-mesh-ray-caster
renezurbruegg Sep 9, 2025
f5af366
Merge branch 'prim_utils' into feature/multi-mesh-ray-caster
renezurbruegg Sep 9, 2025
50fc172
fix typo
renezurbruegg Sep 9, 2025
c891112
Update trimesh functions
renezurbruegg Sep 9, 2025
85fbe94
Merge branch 'main' into feature/multi-mesh-ray-caster
jtigue-bdai Sep 9, 2025
c251913
Also lookup physics prim for sensor origin
renezurbruegg Sep 16, 2025
22040a7
fix merge issue
renezurbruegg Sep 16, 2025
50622c9
manager based flow not crashing, added depth camera, robot in visuali…
Zwoelf12 Sep 16, 2025
0c2955b
update benchmarking
renezurbruegg Sep 16, 2025
f71fd00
added VAE and changed observations to get image latents instead of de…
Zwoelf12 Sep 17, 2025
72216ce
lee velocity controller wip
Zwoelf12 Sep 18, 2025
737aff6
fix change
Zwoelf12 Sep 18, 2025
41924f2
formatter and fix multi mesh raycaster
pascal-roth Sep 18, 2025
a194b3b
image based benchmark
pascal-roth Sep 19, 2025
9a0f5ab
fixes
pascal-roth Sep 19, 2025
80908ed
fix md
pascal-roth Sep 19, 2025
30ceb59
fix data type name
pascal-roth Sep 19, 2025
4439744
fix benchmark ray caster
pascal-roth Sep 21, 2025
473c295
added lee velocity controller, not verified yet
Zwoelf12 Sep 22, 2025
ac2f724
Updated velocity controller
mihirk284 Sep 22, 2025
e14defd
removed unncessary print statements
mihirk284 Sep 22, 2025
5d3fda7
Apple forces to all links instead of just the first one
mihirk284 Sep 22, 2025
7e037d4
slight clean up
Zwoelf12 Sep 22, 2025
8538b90
added TODO
Zwoelf12 Sep 22, 2025
0a832b5
plot scripts
pascal-roth Sep 22, 2025
e1a5780
update plot script
pascal-roth Sep 22, 2025
c09b9d0
update
pascal-roth Sep 22, 2025
b2103cb
Create agg. plot script
renezurbruegg Sep 22, 2025
335dc71
Merge branch 'feature/multi-mesh-ray-caster' of github.com:renezurbru…
renezurbruegg Sep 22, 2025
3c5bd81
updated plotting scripts
renezurbruegg Sep 23, 2025
976b2bc
force add usd
Zwoelf12 Sep 23, 2025
0e0c5ce
try lfs again
Zwoelf12 Sep 23, 2025
9c03606
try lfs again
Zwoelf12 Sep 23, 2025
0d3f5be
Change output dir, disable non cached tests
renezurbruegg Sep 23, 2025
ee12bb3
Merge branch 'feature/multi-mesh-ray-caster' of github.com:renezurbru…
pascal-roth Sep 23, 2025
bc6886f
allow plot single nav environment
pascal-roth Sep 23, 2025
8d84fb1
refactor camera benchmark
pascal-roth Sep 24, 2025
8796999
add bash scripts
renezurbruegg Sep 24, 2025
9b2871b
Merge branch 'feature/multi-mesh-ray-caster' of github.com:renezurbru…
renezurbruegg Sep 24, 2025
64a9a61
add fps plot
renezurbruegg Sep 25, 2025
b079a0e
Updated code that learns to go to the goal location
mihirk284 Sep 25, 2025
658fae3
Updated code that learns to go to the goal location
mihirk284 Sep 25, 2025
04cd1c5
bugfix
pascal-roth Sep 26, 2025
ee857ce
Merge branch 'main' into feature/multi-mesh-ray-caster
pascal-roth Sep 26, 2025
461affb
push initial working navigation policy with depth images
grzemal Oct 2, 2025
89a22b9
Merge branch 'feature/drone' into hotfix/drone
grzemal Oct 2, 2025
00ee21e
update curriculum condition
grzemal Oct 2, 2025
94489da
Merge pull request #27 from ntnu-arl/hotfix/drone
grzemal Oct 2, 2025
c24fd6d
non fixed VAE weights path
Zwoelf12 Oct 3, 2025
6235db8
add rl_games compatibility
EtorArza Oct 6, 2025
4ae38af
navigation task with magpie mesh , random start and goal locations, a…
grzemal Oct 7, 2025
bd277a4
rl games config from aerialgym
grzemal Oct 7, 2025
62c58a7
Merge branch 'feature/drone' of github.com:ntnu-arl/IsaacLab into fea…
grzemal Oct 7, 2025
c5bc93b
rotate magpie mesh
grzemal Oct 7, 2025
a3b09a8
last action as observation
grzemal Oct 8, 2025
a19cce3
update vae with jit script
grzemal Oct 8, 2025
1b5ad99
position in the base frame
grzemal Oct 8, 2025
c48f0eb
change sample space of the goal location
grzemal Oct 8, 2025
9e880ad
correct observations and default action parametrization
grzemal Oct 9, 2025
27487e7
update observation and reward terms
grzemal Oct 9, 2025
4197836
clean up
grzemal Oct 9, 2025
9fd4819
reset the controller gains at every episode reset
grzemal Oct 9, 2025
bb113c9
clean up
grzemal Oct 9, 2025
f4e48fd
clean up the observations and goal sampling space
grzemal Oct 9, 2025
dfc9283
Add more mesh types
renezurbruegg Oct 10, 2025
8b2de9b
Add generic fan triangulation
renezurbruegg Oct 10, 2025
c97b616
Merge remote-tracking branch 'public/main' into upstream/feature/mult…
renezurbruegg Oct 10, 2025
0dbb2da
Remove unusued benchmarks
renezurbruegg Oct 10, 2025
ddcc3d8
lint
renezurbruegg Oct 10, 2025
dfd08df
remove benchmarks
renezurbruegg Oct 10, 2025
519f956
fix minimum number of obstacles and their location
grzemal Oct 11, 2025
e27edff
start always at easiest level and progress
grzemal Oct 11, 2025
b828403
adjust sampling space for resetting the env
grzemal Oct 11, 2025
a09c378
weight rewards based on the curriculum and keep agent in the highes…
grzemal Oct 11, 2025
87cc1b6
bugfix
grzemal Oct 11, 2025
fe5c95d
less strict condition
grzemal Oct 12, 2025
360f2be
update params
grzemal Oct 12, 2025
aa90eed
update params but still WIP
grzemal Oct 12, 2025
44d4728
action penalties
grzemal Oct 13, 2025
a11f1ff
camera params for the d455
grzemal Oct 13, 2025
0c3f77c
wip refactoring articulation_with_thrusters to multirotor and removin…
Zwoelf12 Oct 15, 2025
3ea7bc1
wip combined thrust works with refactored version
Zwoelf12 Oct 15, 2025
ab2783f
separate drone related terms from the other files
grzemal Oct 15, 2025
22568b9
add actions and command visualizations to the drone mdp
grzemal Oct 15, 2025
bd3fd4e
clean version of refactor with not working individual thrust application
Zwoelf12 Oct 15, 2025
f8ff26f
clean version of refactor only combined wrench application
Zwoelf12 Oct 15, 2025
739309f
removed old articulation with thrusters
Zwoelf12 Oct 15, 2025
8e5724e
more obstacles on the way
grzemal Oct 16, 2025
87c68cd
Merge branch 'feature/drone_refactor_mr_articulation' of github.com:n…
grzemal Oct 16, 2025
c8dfe1d
variable action dim for navigation action
Zwoelf12 Oct 16, 2025
f583dda
Merge branch 'main' of github.com:ntnu-arl/IsaacLab into feature/drone
grzemal Oct 16, 2025
9fdb66f
Merge branch 'feature/drone' of github.com:ntnu-arl/IsaacLab into fea…
grzemal Oct 16, 2025
5de8148
reverting changes on anymal files in navigation task
Zwoelf12 Oct 16, 2025
2fcc00e
remove obsolete
grzemal Oct 16, 2025
b055cb0
clean up
grzemal Oct 16, 2025
1760a21
clean up
grzemal Oct 16, 2025
f7723da
remove obsolete
grzemal Oct 16, 2025
42265a7
revert back
grzemal Oct 16, 2025
5cd7a66
update
grzemal Oct 16, 2025
83dd1f4
state based position control with LMF2 (reward function still needs s…
Zwoelf12 Oct 16, 2025
3bb369a
Merge branch 'feature/drone' of github.com:ntnu-arl/IsaacLab into fea…
Zwoelf12 Oct 16, 2025
d8d25eb
refactor and clean up of the drone related tasks
grzemal Oct 17, 2025
f0000d3
revert back the changes
grzemal Oct 17, 2025
cebc6c6
delete obsolete
grzemal Oct 17, 2025
c605b05
revert back the navigation anymal task
grzemal Oct 17, 2025
c82d66b
clean up
grzemal Oct 17, 2025
7177e2e
fix currriculum and navigation rewards after merging with state-based…
grzemal Oct 17, 2025
f2abb3b
delete obsolete
grzemal Oct 17, 2025
2f4e363
remove comment
grzemal Oct 17, 2025
e263236
add custom function for object placement
grzemal Oct 17, 2025
a80a1a9
fix naming
grzemal Oct 17, 2025
2429a66
remove direct implementation
grzemal Oct 17, 2025
df2e33f
bugfix
grzemal Oct 17, 2025
5a52119
bug fix last navigation action
grzemal Oct 17, 2025
71e0ec6
remove navigation related terms
grzemal Oct 17, 2025
e8ddd2c
clean up for first pr
grzemal Oct 17, 2025
febac18
bugfix
grzemal Oct 17, 2025
a0a6b2b
fix
grzemal Oct 17, 2025
af1436c
fix typos
grzemal Oct 17, 2025
9cb7c99
set episode length for 5sec
grzemal Oct 17, 2025
e5cfa4c
fix typos
grzemal Oct 17, 2025
f417b07
fix naming
grzemal Oct 17, 2025
968b64f
code after formatter
grzemal Oct 18, 2025
64177b3
add missing imports and remove unused imports and fix name mismatches
grzemal Oct 18, 2025
3eacbd5
all tests passed
grzemal Oct 18, 2025
ac20dbb
chore(ci): fix lint issues and add PR body
grzemal Oct 18, 2025
b39285c
chore(ci): fix lint issues and add PR body
grzemal Oct 18, 2025
9be0504
delete obsolete
grzemal Oct 18, 2025
191a4b9
add names
grzemal Oct 19, 2025
11cca2b
update with mesh and recent usd
grzemal Oct 20, 2025
d6a82ba
fixed velocity reward issue
Zwoelf12 Oct 20, 2025
93c7034
Normalize line endings
Zwoelf12 Oct 21, 2025
f90df4d
Merge branch 'pr-3298' into feature/drone
Zwoelf12 Oct 21, 2025
bf9bfe3
delete obsolete
grzemal Oct 21, 2025
3372a9d
add lee position controller
grzemal Oct 21, 2025
9284811
remove obsolete
grzemal Oct 21, 2025
1692487
add lee acceleration controller
grzemal Oct 21, 2025
fd90c34
clean up
grzemal Oct 21, 2025
af34142
fix naming
grzemal Oct 21, 2025
b17c7c2
fix typo
grzemal Oct 21, 2025
cdb9380
remove fix dt from thruster
grzemal Oct 22, 2025
f0dc677
Update source/isaaclab/isaaclab/actuators/thruster.py
grzemal Oct 22, 2025
d9348b1
Update source/isaaclab/isaaclab/assets/articulation/multirotor_cfg.py
grzemal Oct 22, 2025
193e02a
fix clipping depth camera and formatter
pascal-roth Oct 22, 2025
b0f90d6
docs(thruster): add missing __init__ arg descriptions
grzemal Oct 22, 2025
a717121
cache _ALL_INDICES to avoid reallocations
grzemal Oct 22, 2025
104f66d
added an obstacle scene cfg and generation, included multi-mesh-rayca…
Zwoelf12 Oct 23, 2025
476798d
use wrap_to_pi
grzemal Oct 23, 2025
9d59216
clean up the rewards and observations for the state based control task
grzemal Oct 23, 2025
b6d30f0
use default sampling function and remove obsolete
grzemal Oct 23, 2025
3292b8d
remove obsolete
grzemal Oct 23, 2025
ef95d3f
not crashing resetting obstacles scene (no learning performance teste…
Zwoelf12 Oct 24, 2025
4357abd
slight clean up
Zwoelf12 Oct 24, 2025
06e6ee7
simplify the drone command implementation
grzemal Oct 24, 2025
a46ff1f
simplify drone command implementation
grzemal Oct 24, 2025
658ce9c
Update source/isaaclab_tasks/isaaclab_tasks/manager_based/drone_ntnu/…
grzemal Oct 24, 2025
ecaad98
add descriptions
grzemal Oct 24, 2025
a54454f
Merge branch 'feature/drone_multirotor_class' of github.com:ntnu-arl/…
grzemal Oct 24, 2025
f87ac8b
Merge remote-tracking branch 'public/main' into upstream/feature/mult…
renezurbruegg Oct 25, 2025
9ddab8f
Add example for camera raycaster
renezurbruegg Oct 25, 2025
0f7635e
Add Raycaster Data to init
renezurbruegg Oct 25, 2025
5f4b475
Remove unusued Triggered
renezurbruegg Oct 25, 2025
412cf7a
Fix docstring
renezurbruegg Oct 25, 2025
ea6f322
Fix docstring
renezurbruegg Oct 25, 2025
2b6421e
always use env_ids as indexing tensor
renezurbruegg Oct 25, 2025
f5ca3e3
fix docs
renezurbruegg Oct 25, 2025
b467e79
update typing
renezurbruegg Oct 25, 2025
362e358
add warning on duplicate targets
renezurbruegg Oct 25, 2025
657d8f2
remove unused prim lookup
renezurbruegg Oct 25, 2025
92750b2
Address remaining PR comments
renezurbruegg Oct 25, 2025
766bf98
remove typo
renezurbruegg Oct 25, 2025
2e152f0
downgrade gymnasium
renezurbruegg Oct 25, 2025
8c59a07
Fix device and Warp Camera prim
renezurbruegg Oct 25, 2025
4b05304
revert change
renezurbruegg Oct 25, 2025
153894b
update quat_w
renezurbruegg Oct 25, 2025
2c4040e
fix docstring
renezurbruegg Oct 25, 2025
6a1d06e
fix mesh tensor shape for single raycast
renezurbruegg Oct 25, 2025
685885e
fix warp camera
renezurbruegg Oct 25, 2025
7b312d9
clean up
grzemal Oct 25, 2025
98ec5c5
Fix race conditions
renezurbruegg Oct 26, 2025
35c5c1f
Lint
renezurbruegg Oct 26, 2025
4fed595
Apply suggestions from code review
renezurbruegg Oct 26, 2025
c3115cd
Add check for ray alignment
renezurbruegg Oct 26, 2025
ae34fa7
lint
renezurbruegg Oct 26, 2025
dadec71
Move obtain_prim pose to custom utils
renezurbruegg Oct 26, 2025
571e4e9
Merge branch 'upstream/feature/multi-mesh-ray-caster' into feature/mu…
renezurbruegg Oct 26, 2025
80542aa
lint
renezurbruegg Oct 26, 2025
8bedf43
Apply suggestions from code review
renezurbruegg Oct 26, 2025
c62ae1d
minor changes from code review
renezurbruegg Oct 26, 2025
aba6b95
Merge branch 'feature/multi-mesh-ray-caster' of github.com:renezurbru…
renezurbruegg Oct 26, 2025
c4218df
Typos and formatting
renezurbruegg Oct 26, 2025
f525ff1
Move mesh_views to parent class
renezurbruegg Oct 26, 2025
6e89052
make order alphabetical
renezurbruegg Oct 26, 2025
b7f06dc
Make assignment more clear
renezurbruegg Oct 26, 2025
c3dcb2b
Fix tests
renezurbruegg Oct 26, 2025
387f3d9
navigation with obstacle reset curriculum learns well
Zwoelf12 Oct 26, 2025
c3f5987
make Thruster class generic
grzemal Oct 26, 2025
9286f62
add docstring
grzemal Oct 26, 2025
7e85940
training reaches only curriculum level 30, 1700 fps with 1024 envs
Zwoelf12 Oct 27, 2025
d8d6ac6
Merge branch 'feature/drone_reset_obstacles' into feature/drone
Zwoelf12 Oct 27, 2025
b0c5cfe
slight clean up
Zwoelf12 Oct 27, 2025
ac10a8c
further clean up
Zwoelf12 Oct 27, 2025
22f8758
remove num_motors from config
Zwoelf12 Oct 27, 2025
8587f17
added motor model functions to thruster class
Zwoelf12 Oct 27, 2025
865f407
fix private property and added error when non thruster actuator is found
Zwoelf12 Oct 27, 2025
8a01a1d
added submodule for LMF2 drone model
Zwoelf12 Oct 27, 2025
6b7e40b
added LMF2 drone model as git submodule
Zwoelf12 Oct 27, 2025
2586248
updated git submodule without git ssh url
Zwoelf12 Oct 27, 2025
895b888
adding explicit calculation of num_resets when env_ids is None
Zwoelf12 Oct 27, 2025
df0384f
removed thruster simulation based only on force without using rps
Zwoelf12 Oct 27, 2025
05fa7bc
remove header duplicate
Zwoelf12 Oct 27, 2025
280b979
Fixed type of asset
Zwoelf12 Oct 27, 2025
256e4cb
fixed thrust initialization on reset
Zwoelf12 Oct 27, 2025
4840b39
regenerated script module with fix in the vae encode path to support …
Zwoelf12 Oct 28, 2025
550956b
added LMF2_model as a submodule
Zwoelf12 Oct 28, 2025
0d794b1
fix for rl_games crashing
Zwoelf12 Oct 28, 2025
71028fa
update usd naming
Zwoelf12 Oct 28, 2025
577671d
update assets in submodule
Zwoelf12 Oct 28, 2025
27545b4
renaming robot
Zwoelf12 Oct 28, 2025
b9ed6a4
update submodule
Zwoelf12 Oct 28, 2025
51f002e
update submodule
Zwoelf12 Oct 28, 2025
f28d9d3
update submodule
Zwoelf12 Oct 28, 2025
3cdb6e3
fix for changed submodule and fix for global _vae_model variable in o…
Zwoelf12 Oct 29, 2025
80d9dbb
introducing obstacle curriculum state for less added fields to env
Zwoelf12 Oct 29, 2025
0fb3f18
added docstrings and removed obsolete terrain
Zwoelf12 Oct 29, 2025
3c502d0
add colors to the wall for better visualization
grzemal Oct 29, 2025
65ff02b
Merge branch 'feature/drone' of github.com:ntnu-arl/IsaacLab into fea…
grzemal Oct 29, 2025
91ac1ca
fix submodule path
grzemal Oct 29, 2025
5b37927
update naming convention
grzemal Oct 29, 2025
fcb0ee9
bugfix
grzemal Oct 29, 2025
ddfd5cc
add docstrings and clean up with --format
grzemal Oct 29, 2025
4c32c89
Merge branch 'feature/drone_multirotor_class' into feature/drone
Zwoelf12 Oct 29, 2025
884f862
Merge branch 'feature/drone' of https://github.com/ntnu-arl/IsaacLab …
Zwoelf12 Oct 29, 2025
29a07ec
Merge branch 'feature/drone_multirotor_class' into feature/drone
Zwoelf12 Oct 29, 2025
291e8db
docstrings + updates after merge
Zwoelf12 Oct 29, 2025
6f19575
update commit submodule
Zwoelf12 Oct 29, 2025
5cede36
added docstrings + fixed mistake in drone_pose_command while merging
Zwoelf12 Oct 29, 2025
e01ad86
remove old TODO
Zwoelf12 Oct 29, 2025
c03d563
put top wall back in place
Zwoelf12 Oct 29, 2025
f757ed3
code formatting
Zwoelf12 Oct 29, 2025
efb6e60
Merge branch 'pr-3298-latest' into feature/drone
Zwoelf12 Oct 29, 2025
cb24ac1
Merge remote-tracking branch 'upstream/main' into feature/drone
Zwoelf12 Oct 29, 2025
cc4c19c
clean up
Zwoelf12 Oct 29, 2025
167225f
bug fix
Zwoelf12 Oct 29, 2025
f7d0c84
Merge branch 'feature/drone_multirotor_class' into feature/drone
Zwoelf12 Oct 29, 2025
e7c9c9c
bug fix pos and acc controller
Zwoelf12 Oct 29, 2025
357c6a0
remove obsolete curriculum
Zwoelf12 Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
*.hdf5 filter=lfs diff=lfs merge=lfs -text

*.bat text eol=crlf
docs/make.bat text eol=crlf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: This specific rule is redundant since line 14 already covers all .bat files with CRLF line endings. The general pattern *.bat text eol=crlf should include docs/make.bat. Is there a specific reason this file needs explicit handling beyond the general *.bat rule?

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "source/isaaclab_tasks/isaaclab_tasks/manager_based/drone_arl/robot_model"]
path = source/isaaclab_tasks/isaaclab_tasks/manager_based/drone_arl/robot_model
url = https://github.com/ntnu-arl/robot_model.git
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Guidelines for modifications:
* Felix Yu
* Gary Lvov
* Giulio Romualdi
* Grzegorz Malczyk
* Haoran Zhou
* Harsh Patel
* HoJin Jeon
Expand Down Expand Up @@ -100,6 +101,7 @@ Guidelines for modifications:
* Michael Noseworthy
* Michael Lin
* Miguel Alonso Jr
* Mihir Kulkarni
* Mingyu Lee
* Muhong Guo
* Narendra Dahile
Expand Down Expand Up @@ -138,6 +140,7 @@ Guidelines for modifications:
* Virgilio Gómez Lambo
* Vladimir Fokow
* Wei Yang
* Welf Rehberg
* Xavier Nal
* Xinjie Yao
* Xinpeng Liu
Expand Down
9 changes: 9 additions & 0 deletions docs/source/api/lab/isaaclab.utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
dict
interpolation
math
mesh
modifiers
noise
string
Expand Down Expand Up @@ -89,6 +90,14 @@ Math operations
:inherited-members:
:show-inheritance:

Mesh operations
~~~~~~~~~~~~~~~

.. automodule:: isaaclab.utils.mesh
:members:
:imported-members:
:show-inheritance:

Modifier operations
~~~~~~~~~~~~~~~~~~~

Expand Down
296 changes: 296 additions & 0 deletions scripts/demos/sensors/multi_mesh_raycaster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause


"""Example on using the MultiMesh Raycaster sensor.
Usage:
`python scripts/demos/sensors/multi_mesh_raycaster.py --num_envs 16 --asset_type <allegro_hand|anymal_d|multi>`
"""

import argparse

from isaaclab.app import AppLauncher

# add argparse arguments
parser = argparse.ArgumentParser(description="Example on using the raycaster sensor.")
parser.add_argument("--num_envs", type=int, default=16, help="Number of environments to spawn.")
parser.add_argument(
"--asset_type",
type=str,
default="allegro_hand",
help="Asset type to use.",
choices=["allegro_hand", "anymal_d", "multi"],
)
# append AppLauncher cli args
AppLauncher.add_app_launcher_args(parser)
# parse the arguments
args_cli = parser.parse_args()

# launch omniverse app
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app

"""Rest everything follows."""

import random
import torch

import omni.usd
from pxr import Gf, Sdf

##
# Pre-defined configs
##
from isaaclab_assets.robots.allegro import ALLEGRO_HAND_CFG
from isaaclab_assets.robots.anymal import ANYMAL_D_CFG

import isaaclab.sim as sim_utils
from isaaclab.assets import Articulation, AssetBaseCfg, RigidObjectCfg
from isaaclab.markers.config import VisualizationMarkersCfg
from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
from isaaclab.sensors.ray_caster import MultiMeshRayCasterCfg, patterns
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR

RAY_CASTER_MARKER_CFG = VisualizationMarkersCfg(
markers={
"hit": sim_utils.SphereCfg(
radius=0.01,
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)),
),
},
)


if args_cli.asset_type == "allegro_hand":
asset_cfg = ALLEGRO_HAND_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot")
ray_caster_cfg = MultiMeshRayCasterCfg(
prim_path="{ENV_REGEX_NS}/Robot",
update_period=1 / 60,
offset=MultiMeshRayCasterCfg.OffsetCfg(pos=(0, -0.1, 0.3)),
mesh_prim_paths=[
"/World/Ground",
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/thumb_link_.*/visuals_xform"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/index_link.*/visuals_xform"),
MultiMeshRayCasterCfg.RaycastTargetCfg(
target_prim_expr="{ENV_REGEX_NS}/Robot/middle_link_.*/visuals_xform"
),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/ring_link_.*/visuals_xform"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/palm_link/visuals_xform"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/allegro_mount/visuals_xform"),
],
ray_alignment="world",
pattern_cfg=patterns.GridPatternCfg(resolution=0.005, size=(0.4, 0.4), direction=(0, 0, -1)),
debug_vis=not args_cli.headless,
visualizer_cfg=RAY_CASTER_MARKER_CFG.replace(prim_path="/Visuals/RayCaster"),
)

elif args_cli.asset_type == "anymal_d":
asset_cfg = ANYMAL_D_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot")
ray_caster_cfg = MultiMeshRayCasterCfg(
prim_path="{ENV_REGEX_NS}/Robot",
update_period=1 / 60,
offset=MultiMeshRayCasterCfg.OffsetCfg(pos=(0, -0.1, 0.3)),
mesh_prim_paths=[
"/World/Ground",
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/LF_.*/visuals"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/RF_.*/visuals"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/LH_.*/visuals"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/RH_.*/visuals"),
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Robot/base/visuals"),
],
ray_alignment="world",
pattern_cfg=patterns.GridPatternCfg(resolution=0.02, size=(2.5, 2.5), direction=(0, 0, -1)),
debug_vis=not args_cli.headless,
visualizer_cfg=RAY_CASTER_MARKER_CFG.replace(prim_path="/Visuals/RayCaster"),
)

elif args_cli.asset_type == "multi":
asset_cfg = RigidObjectCfg(
prim_path="{ENV_REGEX_NS}/Object",
spawn=sim_utils.MultiAssetSpawnerCfg(
assets_cfg=[
sim_utils.CuboidCfg(
size=(0.3, 0.3, 0.3),
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0), metallic=0.2),
),
sim_utils.SphereCfg(
radius=0.3,
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 0.0, 1.0), metallic=0.2),
),
sim_utils.CylinderCfg(
radius=0.2,
height=0.5,
axis="Y",
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0), metallic=0.2),
),
sim_utils.CapsuleCfg(
radius=0.15,
height=0.5,
axis="Z",
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 1.0, 0.0), metallic=0.2),
),
sim_utils.ConeCfg(
radius=0.2,
height=0.5,
axis="Z",
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 1.0), metallic=0.2),
),
],
random_choice=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
solver_position_iteration_count=4, solver_velocity_iteration_count=0
),
mass_props=sim_utils.MassPropertiesCfg(mass=1.0),
collision_props=sim_utils.CollisionPropertiesCfg(),
),
init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, 0.0, 2.0)),
)
ray_caster_cfg = MultiMeshRayCasterCfg(
prim_path="{ENV_REGEX_NS}/Object",
update_period=1 / 60,
offset=MultiMeshRayCasterCfg.OffsetCfg(pos=(0, 0.0, 0.6)),
mesh_prim_paths=[
"/World/Ground",
MultiMeshRayCasterCfg.RaycastTargetCfg(target_prim_expr="{ENV_REGEX_NS}/Object"),
],
ray_alignment="world",
pattern_cfg=patterns.GridPatternCfg(resolution=0.01, size=(0.6, 0.6), direction=(0, 0, -1)),
debug_vis=not args_cli.headless,
visualizer_cfg=RAY_CASTER_MARKER_CFG.replace(prim_path="/Visuals/RayCaster"),
)
else:
raise ValueError(f"Unknown asset type: {args_cli.asset_type}")


@configclass
class RaycasterSensorSceneCfg(InteractiveSceneCfg):
"""Design the scene with sensors on the asset."""

# ground plane
ground = AssetBaseCfg(
prim_path="/World/Ground",
spawn=sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Environments/Terrains/rough_plane.usd",
scale=(1, 1, 1),
),
)

# lights
dome_light = AssetBaseCfg(
prim_path="/World/Light", spawn=sim_utils.DomeLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75))
)

# asset
asset = asset_cfg
# ray caster
ray_caster = ray_caster_cfg


def randomize_shape_color(prim_path_expr: str):
"""Randomize the color of the geometry."""

# acquire stage
stage = omni.usd.get_context().get_stage()
# resolve prim paths for spawning and cloning
prim_paths = sim_utils.find_matching_prim_paths(prim_path_expr)
# manually clone prims if the source prim path is a regex expression

with Sdf.ChangeBlock():
for prim_path in prim_paths:
print("Applying prim scale to:", prim_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: print statement says 'prim scale' but the function randomizes both color and scale

# spawn single instance
prim_spec = Sdf.CreatePrimInLayer(stage.GetRootLayer(), prim_path)

# DO YOUR OWN OTHER KIND OF RANDOMIZATION HERE!
# Note: Just need to acquire the right attribute about the property you want to set
# Here is an example on setting color randomly
color_spec = prim_spec.GetAttributeAtPath(prim_path + "/geometry/material/Shader.inputs:diffuseColor")
color_spec.default = Gf.Vec3f(random.random(), random.random(), random.random())

# randomize scale
scale_spec = prim_spec.GetAttributeAtPath(prim_path + ".xformOp:scale")
scale_spec.default = Gf.Vec3f(random.uniform(0.5, 1.5), random.uniform(0.5, 1.5), random.uniform(0.5, 1.5))


def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
"""Run the simulator."""
# Define simulation stepping
sim_dt = sim.get_physics_dt()
sim_time = 0.0
count = 0

# Simulate physics
while simulation_app.is_running():

if count % 500 == 0:
# reset counter
count = 0
Comment on lines +229 to +231
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: counter is reset to 0 immediately after checking if it equals 0, creating unnecessary reset cycles. Is the intention to reset every 500 steps or reset immediately after the first reset?

# reset the scene entities
# root state
root_state = scene["asset"].data.default_root_state.clone()
root_state[:, :3] += scene.env_origins
scene["asset"].write_root_pose_to_sim(root_state[:, :7])
scene["asset"].write_root_velocity_to_sim(root_state[:, 7:])

if isinstance(scene["asset"], Articulation):
# set joint positions with some noise
joint_pos, joint_vel = (
scene["asset"].data.default_joint_pos.clone(),
scene["asset"].data.default_joint_vel.clone(),
)
joint_pos += torch.rand_like(joint_pos) * 0.1
scene["asset"].write_joint_state_to_sim(joint_pos, joint_vel)
# clear internal buffers
scene.reset()
print("[INFO]: Resetting Asset state...")

if isinstance(scene["asset"], Articulation):
# -- generate actions/commands
targets = scene["asset"].data.default_joint_pos + 5 * (
torch.rand_like(scene["asset"].data.default_joint_pos) - 0.5
)
# -- apply action to the asset
scene["asset"].set_joint_position_target(targets)
# -- write data to sim
scene.write_data_to_sim()
# perform step
sim.step()
# update sim-time
sim_time += sim_dt
count += 1
# update buffers
scene.update(sim_dt)


def main():
"""Main function."""

# Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device)
sim = sim_utils.SimulationContext(sim_cfg)
# Set main camera
sim.set_camera_view(eye=[3.5, 3.5, 3.5], target=[0.0, 0.0, 0.0])
# design scene
scene_cfg = RaycasterSensorSceneCfg(num_envs=args_cli.num_envs, env_spacing=2.0, replicate_physics=False)
scene = InteractiveScene(scene_cfg)

if args_cli.asset_type == "multi":
randomize_shape_color(scene_cfg.asset.prim_path.format(ENV_REGEX_NS="/World/envs/env_.*"))

# Play the simulator
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
# Run the simulator
run_simulator(sim, scene)


if __name__ == "__main__":
# run the main function
main()
# close sim app
simulation_app.close()
Loading