-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16f26df
commit 2a2983c
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# requirements.txt | ||
|
||
torch | ||
kscale-onshape-library | ||
mlfab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/zsh | ||
# ./sim/scripts/download_urdf.sh | ||
|
||
# URL of the latest model. | ||
url=https://cad.onshape.com/documents/71f793a23ab7562fb9dec82d/w/6160a4f44eb6113d3fa116cd/e/1a95e260677a2d2d5a3b1eb3 | ||
|
||
# Output directory. | ||
output_dir=${MODEL_DIR}/robots/stompy | ||
|
||
kol urdf ${url} \ | ||
--max-ang-velocity 31.4 \ | ||
--suffix-to-joint-effort \ | ||
dof_x4_h=1.5 \ | ||
dof_x4=1.5 \ | ||
dof_x6=3 \ | ||
dof_x8=6 \ | ||
dof_x10=12 \ | ||
knee_revolute=13.9 \ | ||
ankle_revolute=6 \ | ||
--output-dir ${output_dir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Script to drop a URDF in Isaac Gym.""" | ||
|
||
import argparse | ||
|
||
from pathlib import Path | ||
from sim.isaacgym import gymutil, gymtorch, gymapi | ||
import torch | ||
import mlfab | ||
|
||
|
||
def get_sim_params(num_threads: int, use_gpu: bool) -> gymapi.SimParams: | ||
sim_params = gymapi.SimParams() | ||
sim_params.substeps = 2 | ||
sim_params.dt = 1.0 / 60.0 | ||
|
||
sim_params.physx.solver_type = 1 | ||
sim_params.physx.num_position_iterations = 4 | ||
sim_params.physx.num_velocity_iterations = 1 | ||
|
||
sim_params.physx.num_threads = num_threads | ||
sim_params.physx.use_gpu = use_gpu | ||
|
||
return sim_params | ||
|
||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser(description="Drop a URDF in Isaac Gym.") | ||
parser.add_argument("urdf_path", help="Path to the URDF file to load") | ||
args = parser.parse_args() | ||
|
||
mlfab.configure_logging() | ||
|
||
# Verifies that the URDF exists. | ||
urdf_path = Path(args.urdf_path) | ||
if not urdf_path.exists(): | ||
raise FileNotFoundError(f"URDF file not found: {urdf_path}") | ||
|
||
sim_params = get_sim_params(args.num_threads, args.use_gpu) | ||
|
||
|
||
if __name__ == "__main__": | ||
# python -m sim.scripts.drop_urdf | ||
main() |