├── .gitattributes
├── .gitignore
├── .gitmodules
├── DexHandEnv
├── __init__.py
├── cfg
│ ├── config.yaml
│ ├── pbt
│ │ ├── no_pbt.yaml
│ │ └── pbt_default.yaml
│ ├── task
│ │ ├── Ant.yaml
│ │ ├── DexCube.yaml
│ │ └── DexHand.yaml
│ └── train
│ │ ├── AntPPO.yaml
│ │ ├── DexCubePPO.yaml
│ │ └── DexHandPPO.yaml
├── learning
│ ├── __init__.py
│ ├── amp_continuous.py
│ ├── amp_datasets.py
│ ├── amp_models.py
│ ├── amp_network_builder.py
│ ├── amp_players.py
│ ├── common_agent.py
│ ├── common_player.py
│ ├── hrl_continuous.py
│ ├── hrl_models.py
│ └── replay_buffer.py
├── pbt
│ ├── __init__.py
│ ├── experiments
│ │ ├── __init__.py
│ │ ├── ant_pbt.py
│ │ └── run_utils.py
│ ├── launcher
│ │ ├── LICENSE
│ │ ├── __init__.py
│ │ ├── run.py
│ │ ├── run_description.py
│ │ ├── run_ngc.py
│ │ ├── run_processes.py
│ │ ├── run_slurm.py
│ │ └── slurm
│ │ │ └── sbatch_timeout.sh
│ ├── mutation.py
│ └── pbt.py
├── tasks
│ ├── __init__.py
│ ├── ant.py
│ ├── base
│ │ ├── __init__.py
│ │ └── vec_task.py
│ ├── dex_cube.py
│ ├── dex_hand copy.py
│ └── dex_hand.py
├── train.py
└── utils
│ ├── __init__.py
│ ├── dr_utils.py
│ ├── reformat.py
│ ├── rlgames_utils.py
│ ├── rna_util.py
│ ├── torch_jit_utils.py
│ ├── utils.py
│ └── wandb_utils.py
├── LICENSE
├── LICENSE.txt
├── README.md
├── assets
├── README.md
├── dexhand
│ ├── .gitattributes
│ ├── .gitignore
│ ├── README.md
│ ├── meshes
│ │ ├── l_f_link1_1.STL
│ │ ├── l_f_link1_2.STL
│ │ ├── l_f_link1_2_1.STL
│ │ ├── l_f_link1_2_2.STL
│ │ ├── l_f_link1_3.STL
│ │ ├── l_f_link1_3_1.STL
│ │ ├── l_f_link1_3_2.STL
│ │ ├── l_f_link1_4.STL
│ │ ├── l_f_link1_4_1.STL
│ │ ├── l_f_link1_4_2.STL
│ │ ├── l_f_link2_1.STL
│ │ ├── l_f_link2_2.STL
│ │ ├── l_f_link2_2_1.STL
│ │ ├── l_f_link2_2_2.STL
│ │ ├── l_f_link2_3.STL
│ │ ├── l_f_link2_3_1.STL
│ │ ├── l_f_link2_3_2.STL
│ │ ├── l_f_link2_4.STL
│ │ ├── l_f_link2_4_1.STL
│ │ ├── l_f_link2_4_2.STL
│ │ ├── l_f_link3_1.STL
│ │ ├── l_f_link3_2.STL
│ │ ├── l_f_link3_2_1.STL
│ │ ├── l_f_link3_2_2.STL
│ │ ├── l_f_link3_3.STL
│ │ ├── l_f_link3_3_1.STL
│ │ ├── l_f_link3_3_2.STL
│ │ ├── l_f_link3_4.STL
│ │ ├── l_f_link3_4_1.STL
│ │ ├── l_f_link3_4_2.STL
│ │ ├── l_f_link4_1.STL
│ │ ├── l_f_link4_2.STL
│ │ ├── l_f_link4_2_1.STL
│ │ ├── l_f_link4_2_2.STL
│ │ ├── l_f_link4_3.STL
│ │ ├── l_f_link4_3_1.STL
│ │ ├── l_f_link4_3_2.STL
│ │ ├── l_f_link4_4.STL
│ │ ├── l_f_link4_4_1.STL
│ │ ├── l_f_link4_4_2.STL
│ │ ├── l_f_link5_1.STL
│ │ ├── l_f_link5_2.STL
│ │ ├── l_f_link5_2_1.STL
│ │ ├── l_f_link5_2_2.STL
│ │ ├── l_f_link5_3.STL
│ │ ├── l_f_link5_3_1.STL
│ │ ├── l_f_link5_3_2.STL
│ │ ├── l_f_link5_4.STL
│ │ ├── l_f_link5_4_1.STL
│ │ ├── l_f_link5_4_2.STL
│ │ ├── l_p_link0.STL
│ │ ├── l_p_link1.STL
│ │ ├── l_p_link2.STL
│ │ ├── l_p_link3.STL
│ │ ├── l_p_link4.STL
│ │ ├── l_p_link5.STL
│ │ ├── l_p_link6.STL
│ │ ├── r_f_link1_1.STL
│ │ ├── r_f_link1_2.STL
│ │ ├── r_f_link1_2_1.STL
│ │ ├── r_f_link1_2_2.STL
│ │ ├── r_f_link1_3.STL
│ │ ├── r_f_link1_3_1.STL
│ │ ├── r_f_link1_3_2.STL
│ │ ├── r_f_link1_4.STL
│ │ ├── r_f_link1_4_1.STL
│ │ ├── r_f_link1_4_2.STL
│ │ ├── r_f_link2_1.STL
│ │ ├── r_f_link2_2.STL
│ │ ├── r_f_link2_2_1.STL
│ │ ├── r_f_link2_2_2.STL
│ │ ├── r_f_link2_3.STL
│ │ ├── r_f_link2_3_1.STL
│ │ ├── r_f_link2_3_2.STL
│ │ ├── r_f_link2_4.STL
│ │ ├── r_f_link2_4_1.STL
│ │ ├── r_f_link2_4_2.STL
│ │ ├── r_f_link3_1.STL
│ │ ├── r_f_link3_2.STL
│ │ ├── r_f_link3_2_1.STL
│ │ ├── r_f_link3_2_2.STL
│ │ ├── r_f_link3_3.STL
│ │ ├── r_f_link3_3_1.STL
│ │ ├── r_f_link3_3_2.STL
│ │ ├── r_f_link3_4.STL
│ │ ├── r_f_link3_4_1.STL
│ │ ├── r_f_link3_4_2.STL
│ │ ├── r_f_link4_1.STL
│ │ ├── r_f_link4_2.STL
│ │ ├── r_f_link4_2_1.STL
│ │ ├── r_f_link4_2_2.STL
│ │ ├── r_f_link4_3.STL
│ │ ├── r_f_link4_3_1.STL
│ │ ├── r_f_link4_3_2.STL
│ │ ├── r_f_link4_4.STL
│ │ ├── r_f_link4_4_1.STL
│ │ ├── r_f_link4_4_2.STL
│ │ ├── r_f_link5_1.STL
│ │ ├── r_f_link5_2.STL
│ │ ├── r_f_link5_2_1.STL
│ │ ├── r_f_link5_2_2.STL
│ │ ├── r_f_link5_3.STL
│ │ ├── r_f_link5_3_1.STL
│ │ ├── r_f_link5_3_2.STL
│ │ ├── r_f_link5_4.STL
│ │ ├── r_f_link5_4_1.STL
│ │ ├── r_f_link5_4_2.STL
│ │ ├── r_p_link0.STL
│ │ ├── r_p_link1.STL
│ │ ├── r_p_link2.STL
│ │ ├── r_p_link3.STL
│ │ ├── r_p_link4.STL
│ │ ├── r_p_link5.STL
│ │ └── r_p_link6.STL
│ ├── mjcf
│ │ ├── cube_single_dof.xml
│ │ ├── dexhand021_right.xml
│ │ ├── dexhand021_right_floating.xml
│ │ └── floating_dex_hand.xml
│ └── urdf
│ │ └── objects
│ │ ├── arena_round.urdf
│ │ ├── ball.urdf
│ │ ├── bucket.urdf
│ │ ├── cube_goal_multicolor.urdf
│ │ ├── cube_multicolor.urdf
│ │ ├── cube_multicolor_allegro.urdf
│ │ ├── cube_multicolor_allegro_sdf.urdf
│ │ ├── cube_multicolor_dextreme.urdf
│ │ └── meshes
│ │ ├── ball.obj
│ │ ├── ball.stl
│ │ ├── bucket.mtl
│ │ ├── bucket.obj
│ │ ├── cube_multicolor.mtl
│ │ ├── cube_multicolor.obj
│ │ ├── dex_cube.mtl
│ │ ├── dex_cube.obj
│ │ └── dex_cube.png
└── mjcf
│ ├── nv_ant.xml
│ └── open_ai_assets
│ ├── fetch
│ ├── pick_and_place.xml
│ ├── push.xml
│ ├── reach.xml
│ ├── robot.xml
│ ├── shared.xml
│ └── slide.xml
│ ├── hand
│ ├── egg.xml
│ ├── manipulate_block.xml
│ ├── manipulate_block_touch_sensors.xml
│ ├── manipulate_egg.xml
│ ├── manipulate_egg_touch_sensors.xml
│ ├── manipulate_pen.xml
│ ├── manipulate_pen_touch_sensors.xml
│ ├── pen.xml
│ ├── reach.xml
│ ├── robot.xml
│ ├── robot_touch_sensors_92.xml
│ ├── shadow_hand.xml
│ ├── shared.xml
│ ├── shared_asset.xml
│ └── shared_touch_sensors_92.xml
│ ├── stls
│ ├── .get
│ ├── fetch
│ │ ├── base_link_collision.stl
│ │ ├── bellows_link_collision.stl
│ │ ├── elbow_flex_link_collision.stl
│ │ ├── estop_link.stl
│ │ ├── forearm_roll_link_collision.stl
│ │ ├── gripper_link.stl
│ │ ├── head_pan_link_collision.stl
│ │ ├── head_tilt_link_collision.stl
│ │ ├── l_wheel_link_collision.stl
│ │ ├── laser_link.stl
│ │ ├── r_wheel_link_collision.stl
│ │ ├── shoulder_lift_link_collision.stl
│ │ ├── shoulder_pan_link_collision.stl
│ │ ├── torso_fixed_link.stl
│ │ ├── torso_lift_link_collision.stl
│ │ ├── upperarm_roll_link_collision.stl
│ │ ├── wrist_flex_link_collision.stl
│ │ └── wrist_roll_link_collision.stl
│ └── hand
│ │ ├── F1.stl
│ │ ├── F2.stl
│ │ ├── F3.stl
│ │ ├── TH1_z.stl
│ │ ├── TH2_z.stl
│ │ ├── TH3_z.stl
│ │ ├── forearm_electric.stl
│ │ ├── forearm_electric_cvx.stl
│ │ ├── knuckle.stl
│ │ ├── lfmetacarpal.stl
│ │ ├── palm.stl
│ │ └── wrist.stl
│ └── textures
│ ├── block.png
│ └── block_hidden.png
├── dataset
├── dataset.csv
└── generate_dataset.py
└── setup.py
/.gitattributes:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/.gitattributes
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | videos
2 | cloud
3 | recorded_frames
4 | /DexHandEnv/logs
5 | *train_dir*
6 | *ige_logs*
7 | *.egg-info
8 | /.vs
9 | /.vscode
10 | /_package
11 | /shaders
12 | ._tmptext.txt
13 | __pycache__/
14 | /DexHandEnv/tasks/__pycache__
15 | /DexHandEnv/utils/__pycache__
16 | /DexHandEnv/tasks/base/__pycache__
17 | /tools/format/.lastrun
18 | *.pyc
19 | _doxygen
20 | /rlDexHandEnvgpu/logs
21 | /DexHandEnv/benchmarks/results
22 | /DexHandEnv/simpletests/results
23 | *.pxd2
24 | /tests/logs
25 | /DexHandEnv/balance_bot.xml
26 | /DexHandEnv/quadcopter.xml
27 | /DexHandEnv/ingenuity.xml
28 | logs*
29 | nn/
30 | runs/
31 | .idea
32 | outputs/
33 | *.hydra*
34 | /DexHandEnv/wandb
35 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/.gitmodules
--------------------------------------------------------------------------------
/DexHandEnv/__init__.py:
--------------------------------------------------------------------------------
1 | import hydra
2 | from hydra import compose, initialize
3 | from hydra.core.hydra_config import HydraConfig
4 | from omegaconf import DictConfig, OmegaConf
5 | from DexHandEnv.utils.reformat import omegaconf_to_dict
6 |
7 |
8 | OmegaConf.register_new_resolver('eq', lambda x, y: x.lower()==y.lower())
9 | OmegaConf.register_new_resolver('contains', lambda x, y: x.lower() in y.lower())
10 | OmegaConf.register_new_resolver('if', lambda pred, a, b: a if pred else b)
11 | OmegaConf.register_new_resolver('resolve_default', lambda default, arg: default if arg=='' else arg)
12 |
13 |
14 | def make(
15 | seed: int,
16 | task: str,
17 | num_envs: int,
18 | sim_device: str,
19 | rl_device: str,
20 | graphics_device_id: int = -1,
21 | headless: bool = False,
22 | multi_gpu: bool = False,
23 | virtual_screen_capture: bool = False,
24 | force_render: bool = True,
25 | cfg: DictConfig = None
26 | ):
27 | from DexHandEnv.utils.rlgames_utils import get_rlgames_env_creator
28 | # create hydra config if no config passed in
29 | if cfg is None:
30 | # reset current hydra config if already parsed (but not passed in here)
31 | if HydraConfig.initialized():
32 | task = HydraConfig.get().runtime.choices['task']
33 | hydra.core.global_hydra.GlobalHydra.instance().clear()
34 |
35 | with initialize(config_path="./cfg"):
36 | cfg = compose(config_name="config", overrides=[f"task={task}"])
37 | cfg_dict = omegaconf_to_dict(cfg.task)
38 | cfg_dict['env']['numEnvs'] = num_envs
39 | # reuse existing config
40 | else:
41 | cfg_dict = omegaconf_to_dict(cfg.task)
42 |
43 | create_rlgpu_env = get_rlgames_env_creator(
44 | seed=seed,
45 | task_config=cfg_dict,
46 | task_name=cfg_dict["name"],
47 | sim_device=sim_device,
48 | rl_device=rl_device,
49 | graphics_device_id=graphics_device_id,
50 | headless=headless,
51 | multi_gpu=multi_gpu,
52 | virtual_screen_capture=virtual_screen_capture,
53 | force_render=force_render,
54 | )
55 | return create_rlgpu_env()
56 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/config.yaml:
--------------------------------------------------------------------------------
1 |
2 | # Task name - used to pick the class to load
3 | task_name: ${task.name}
4 | # experiment name. defaults to name of training config
5 | experiment: ''
6 |
7 | # if set to positive integer, overrides the default number of environments
8 | num_envs: ''
9 |
10 | # seed - set to -1 to choose random seed
11 | seed: 42
12 | # set to True for deterministic performance
13 | torch_deterministic: False
14 |
15 | # set the maximum number of learning iterations to train for. overrides default per-environment setting
16 | max_iterations: ''
17 |
18 | ## Device config
19 | # 'physx' or 'flex'
20 | physics_engine: 'physx'
21 | # whether to use cpu or gpu pipeline
22 | pipeline: 'gpu'
23 | # device for running physics simulation
24 | sim_device: 'cuda:0'
25 | # device to run RL
26 | rl_device: 'cuda:0'
27 | graphics_device_id: 0
28 |
29 | ## PhysX arguments
30 | num_threads: 4 # Number of worker threads per scene used by PhysX - for CPU PhysX only.
31 | solver_type: 1 # 0: pgs, 1: tgs
32 | num_subscenes: 4 # Splits the simulation into N physics scenes and runs each one in a separate thread
33 |
34 | # RLGames Arguments
35 | # test - if set, run policy in inference mode (requires setting checkpoint to load)
36 | test: False
37 | # used to set checkpoint path
38 | checkpoint: ''
39 | # set sigma when restoring network
40 | sigma: ''
41 | # set to True to use multi-gpu training
42 | multi_gpu: False
43 |
44 | wandb_activate: False
45 | wandb_group: ''
46 | wandb_name: ${train.params.config.name}
47 | wandb_entity: ''
48 | wandb_project: 'DexHandEnv'
49 | wandb_tags: []
50 | wandb_logcode_dir: ''
51 |
52 | capture_video: False
53 | capture_video_freq: 1464
54 | capture_video_len: 100
55 | force_render: True
56 |
57 | # disables rendering
58 | headless: False
59 |
60 | # set default task and default training config based on task
61 | defaults:
62 | - task: Ant
63 | - train: ${task}PPO
64 | - pbt: no_pbt
65 | - override hydra/job_logging: disabled
66 | - _self_
67 |
68 | # set the directory where the output files get saved
69 | hydra:
70 | output_subdir: null
71 | run:
72 | dir: .
73 |
74 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/pbt/no_pbt.yaml:
--------------------------------------------------------------------------------
1 | enabled: False
--------------------------------------------------------------------------------
/DexHandEnv/cfg/pbt/pbt_default.yaml:
--------------------------------------------------------------------------------
1 | defaults:
2 | - mutation: default_mutation
3 |
4 | enabled: True
5 |
6 | policy_idx: 0 # policy index in a population: should always be specified explicitly! Each run in a population should have a unique idx from [0..N-1]
7 | num_policies: 8 # total number of policies in the population, the total number of learners. Override through CLI!
8 | workspace: "pbt_workspace" # suffix of the workspace dir name inside train_dir, used to distinguish different PBT runs with the same experiment name. Recommended to specify a unique name
9 |
10 | # special mode that enables PBT features for debugging even if only one policy is present. Never enable in actual experiments
11 | dbg_mode: False
12 |
13 | # PBT hyperparams
14 | interval_steps: 10000000 # Interval in env steps between PBT iterations (checkpointing, mutation, etc.)
15 | start_after: 10000000 # Start PBT after this many env frames are collected, this applies to all experiment restarts, i.e. when we resume training after the weights are mutated
16 | initial_delay: 20000000 # This is a separate delay for when we're just starting the training session. It makes sense to give policies a bit more time to develop different behaviors
17 |
18 | # Fraction of the underperforming policies whose weights are to be replaced by better performing policies
19 | # This is rounded up, i.e. for 8 policies and fraction 0.3 we replace ceil(0.3*8)=3 worst policies
20 | replace_fraction_worst: 0.125
21 |
22 | # Fraction of agents used to sample weights from when we replace an underperforming agent
23 | # This is also rounded up
24 | replace_fraction_best: 0.3
25 |
26 | # Replace an underperforming policy only if its reward is lower by at least this fraction of standard deviation
27 | # within the population.
28 | replace_threshold_frac_std: 0.5
29 |
30 | # Replace an underperforming policy only if its reward is lower by at least this fraction of the absolute value
31 | # of the objective of a better policy
32 | replace_threshold_frac_absolute: 0.05
33 |
34 | # Probability to mutate a certain parameter
35 | mutation_rate: 0.15
36 |
37 | # min and max values for the mutation of a parameter
38 | # The mutation is performed by multiplying or dividing (randomly) the parameter value by a value sampled from [change_min, change_max]
39 | change_min: 1.1
40 | change_max: 1.5
41 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/task/Ant.yaml:
--------------------------------------------------------------------------------
1 | # used to create the object
2 | name: Ant
3 |
4 | physics_engine: ${..physics_engine}
5 |
6 | # if given, will override the device setting in gym.
7 | env:
8 | numEnvs: ${resolve_default:4096,${...num_envs}}
9 | envSpacing: 5
10 | episodeLength: 1000
11 | enableDebugVis: False
12 |
13 | clipActions: 1.0
14 |
15 | powerScale: 1.0
16 | controlFrequencyInv: 1 # 60 Hz
17 |
18 | # reward parameters
19 | headingWeight: 0.5
20 | upWeight: 0.1
21 |
22 | # cost parameters
23 | actionsCost: 0.005
24 | energyCost: 0.05
25 | dofVelocityScale: 0.2
26 | contactForceScale: 0.1
27 | jointsAtLimitCost: 0.1
28 | deathCost: -2.0
29 | terminationHeight: 0.31
30 |
31 | plane:
32 | staticFriction: 1.0
33 | dynamicFriction: 1.0
34 | restitution: 0.0
35 |
36 | asset:
37 | assetFileName: "mjcf/nv_ant.xml"
38 |
39 | # set to True if you use camera sensors in the environment
40 | enableCameraSensors: False
41 |
42 | sim:
43 | dt: 0.0166 # 1/60 s
44 | substeps: 2
45 | up_axis: "z"
46 | use_gpu_pipeline: ${eq:${...pipeline},"gpu"}
47 | gravity: [0.0, 0.0, -9.81]
48 | physx:
49 | num_threads: ${....num_threads}
50 | solver_type: ${....solver_type}
51 | use_gpu: ${contains:"cuda",${....sim_device}} # set to False to run on CPU
52 | num_position_iterations: 4
53 | num_velocity_iterations: 0
54 | contact_offset: 0.02
55 | rest_offset: 0.0
56 | bounce_threshold_velocity: 0.2
57 | max_depenetration_velocity: 10.0
58 | default_buffer_size_multiplier: 5.0
59 | max_gpu_contact_pairs: 8388608 # 8*1024*1024
60 | num_subscenes: ${....num_subscenes}
61 | contact_collection: 0 # 0: CC_NEVER (don't collect contact info), 1: CC_LAST_SUBSTEP (collect only contacts on last substep), 2: CC_ALL_SUBSTEPS (broken - do not use!)
62 |
63 | task:
64 | randomize: False
65 | randomization_params:
66 | # specify which attributes to randomize for each actor type and property
67 | frequency: 600 # Define how many environment steps between generating new randomizations
68 | observations:
69 | range: [0, .002] # range for the white noise
70 | operation: "additive"
71 | distribution: "gaussian"
72 | actions:
73 | range: [0., .02]
74 | operation: "additive"
75 | distribution: "gaussian"
76 | actor_params:
77 | ant:
78 | color: True
79 | rigid_body_properties:
80 | mass:
81 | range: [0.5, 1.5]
82 | operation: "scaling"
83 | distribution: "uniform"
84 | setup_only: True # Property will only be randomized once before simulation is started. See Domain Randomization Documentation for more info.
85 | dof_properties:
86 | damping:
87 | range: [0.5, 1.5]
88 | operation: "scaling"
89 | distribution: "uniform"
90 | stiffness:
91 | range: [0.5, 1.5]
92 | operation: "scaling"
93 | distribution: "uniform"
94 | lower:
95 | range: [0, 0.01]
96 | operation: "additive"
97 | distribution: "gaussian"
98 | upper:
99 | range: [0, 0.01]
100 | operation: "additive"
101 | distribution: "gaussian"
102 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/task/DexCube.yaml:
--------------------------------------------------------------------------------
1 | # used to create the object
2 | name: DexCube
3 |
4 | physics_engine: ${..physics_engine}
5 |
6 | # if given, will override the device setting in gym.
7 | env:
8 | numEnvs: ${resolve_default:4096,${...num_envs}}
9 | envSpacing: 1.5
10 | episodeLength: 100 # *1/(100/5)
11 | enableDebugVis: True
12 |
13 | clipObservations: 5.0
14 | clipActions: 1.0
15 |
16 | startPositionNoise: 0.25
17 | startRotationNoise: 0.785
18 | dexPositionNoise: 0.0
19 | dexRotationNoise: 0.0
20 | dexDofNoise: 0.25
21 |
22 | aggregateMode: 3
23 |
24 | actionScale: 0.1 # complimentary control rather than absolute control
25 |
26 | # reward weights
27 | heightRewardScale: 30.0
28 | distanceRewardScale: 2.0
29 | armHeightRewardScale: 2.0
30 | successRewardScale: 10.0
31 | qdotPenaltyScale: 0.1
32 | actionPenaltyScale: 1.0
33 | pregraspPenaltyScale: 0.1
34 | terminationPenaltyScale: 10.0
35 |
36 | controlType: joint_pos # options are {osc, joint_tor, joint_pos}
37 |
38 | pregraspDatasetPath: "../../dataset/dataset.csv"
39 |
40 | asset:
41 | assetRoot: "../../assets"
42 | assetFileNamedex: "dexhand/mjcf/dexhand021_right_floating.xml"
43 |
44 | # set to True if you use camera sensors in the environment
45 | enableCameraSensors: False
46 |
47 | sim:
48 | dt: 0.01
49 | substeps: 2
50 | up_axis: "z"
51 | use_gpu_pipeline: ${eq:${...pipeline},"gpu"}
52 | gravity: [0.0, 0.0, -9.81]
53 | physx:
54 | num_threads: ${....num_threads}
55 | solver_type: ${....solver_type}
56 | use_gpu: ${contains:"cuda",${....sim_device}} # set to False to run on CPU
57 | num_position_iterations: 8
58 | num_velocity_iterations: 1
59 | contact_offset: 0.005
60 | rest_offset: 0.0
61 | bounce_threshold_velocity: 0.2
62 | max_depenetration_velocity: 1000.0
63 | default_buffer_size_multiplier: 5.0
64 | max_gpu_contact_pairs: 4194304 # 1024*1024
65 | num_subscenes: ${....num_subscenes}
66 | contact_collection: 2 # 0: CC_NEVER (don't collect contact info), 1: CC_LAST_SUBSTEP (collect only contacts on last substep), 2: CC_ALL_SUBSTEPS (broken - do not use!)
67 |
68 | task:
69 | randomize: False
70 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/train/AntPPO.yaml:
--------------------------------------------------------------------------------
1 | params:
2 | seed: ${...seed}
3 |
4 | algo:
5 | name: a2c_continuous
6 |
7 | model:
8 | name: continuous_a2c_logstd
9 |
10 | network:
11 | name: actor_critic
12 | separate: False
13 | space:
14 | continuous:
15 | mu_activation: None
16 | sigma_activation: None
17 |
18 | mu_init:
19 | name: default
20 | sigma_init:
21 | name: const_initializer
22 | val: 0
23 | fixed_sigma: True
24 | mlp:
25 | units: [256, 128, 64]
26 | activation: elu
27 | d2rl: False
28 |
29 | initializer:
30 | name: default
31 | regularizer:
32 | name: None
33 |
34 | load_checkpoint: ${if:${...checkpoint},True,False} # flag which sets whether to load the checkpoint
35 | load_path: ${...checkpoint} # path to the checkpoint to load
36 |
37 | config:
38 | name: ${resolve_default:Ant,${....experiment}}
39 | full_experiment_name: ${.name}
40 | env_name: rlgpu
41 | multi_gpu: ${....multi_gpu}
42 | ppo: True
43 | mixed_precision: True
44 | normalize_input: True
45 | normalize_value: True
46 | value_bootstrap: True
47 | num_actors: ${....task.env.numEnvs}
48 | reward_shaper:
49 | scale_value: 0.01
50 | normalize_advantage: True
51 | gamma: 0.99
52 | tau: 0.95
53 | learning_rate: 3e-4
54 | lr_schedule: adaptive
55 | schedule_type: legacy
56 | kl_threshold: 0.008
57 | score_to_win: 20000
58 | max_epochs: ${resolve_default:500,${....max_iterations}}
59 | save_best_after: 200
60 | save_frequency: 50
61 | grad_norm: 1.0
62 | entropy_coef: 0.0
63 | truncate_grads: False
64 | e_clip: 0.2
65 | horizon_length: 16
66 | minibatch_size: 32768
67 | mini_epochs: 4
68 | critic_coef: 2
69 | clip_value: True
70 | seq_len: 4
71 | bounds_loss_coef: 0.0001
72 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/train/DexCubePPO.yaml:
--------------------------------------------------------------------------------
1 | params:
2 | seed: ${...seed}
3 | algo:
4 | name: a2c_continuous
5 |
6 | model:
7 | name: continuous_a2c_logstd
8 |
9 | network:
10 | name: actor_critic
11 | separate: False
12 |
13 | space:
14 | continuous:
15 | mu_activation: None
16 | sigma_activation: None
17 | mu_init:
18 | name: default
19 | sigma_init:
20 | name: const_initializer
21 | val: 0
22 | fixed_sigma: True
23 | mlp:
24 | units: [256, 128, 64]
25 | activation: elu
26 | d2rl: False
27 |
28 | initializer:
29 | name: default
30 | regularizer:
31 | name: None
32 |
33 | load_checkpoint: ${if:${...checkpoint},True,False} # flag which sets whether to load the checkpoint
34 | load_path: ${...checkpoint} # path to the checkpoint to load
35 |
36 | config:
37 | name: ${resolve_default:DexCube,${....experiment}}
38 | full_experiment_name: ${.name}
39 | env_name: rlgpu
40 | multi_gpu: ${....multi_gpu}
41 | ppo: True
42 | mixed_precision: False
43 | normalize_input: True
44 | normalize_value: True
45 | value_bootstrap: True
46 | num_actors: ${....task.env.numEnvs}
47 | reward_shaper:
48 | scale_value: 1.0
49 | normalize_advantage: True
50 | gamma: 0.99
51 | tau: 0.95
52 | learning_rate: 5e-4
53 | lr_schedule: adaptive
54 | schedule_type: standard
55 | kl_threshold: 0.008
56 | score_to_win: 10000
57 | max_epochs: ${resolve_default:10000,${....max_iterations}}
58 | save_best_after: 100
59 | save_frequency: 100
60 | print_stats: True
61 | grad_norm: 1.0
62 | entropy_coef: 0.0
63 | truncate_grads: True
64 | e_clip: 0.2
65 | horizon_length: 32
66 | minibatch_size: 16 # 16384
67 | mini_epochs: 5
68 | critic_coef: 4
69 | clip_value: True
70 | seq_len: 4
71 | bounds_loss_coef: 0.0001
72 |
--------------------------------------------------------------------------------
/DexHandEnv/cfg/train/DexHandPPO.yaml:
--------------------------------------------------------------------------------
1 | params:
2 | seed: ${...seed}
3 |
4 | algo:
5 | name: a2c_continuous
6 |
7 | model:
8 | name: continuous_a2c_logstd
9 |
10 | network:
11 | name: actor_critic
12 | separate: False
13 |
14 | space:
15 | continuous:
16 | mu_activation: None
17 | sigma_activation: None
18 | mu_init:
19 | name: default
20 | sigma_init:
21 | name: const_initializer
22 | val: 0
23 | fixed_sigma: True
24 |
25 | mlp:
26 | units: [512, 512, 256, 128]
27 | activation: elu
28 | d2rl: False
29 |
30 | initializer:
31 | name: default
32 | regularizer:
33 | name: None
34 |
35 | load_checkpoint: ${if:${...checkpoint},True,False} # flag which sets whether to load the checkpoint
36 | load_path: ${...checkpoint} # path to the checkpoint to load
37 |
38 | config:
39 | name: ${resolve_default:DexHand,${....experiment}}
40 | full_experiment_name: ${.name}
41 | env_name: rlgpu
42 | multi_gpu: ${....multi_gpu}
43 | ppo: True
44 | mixed_precision: False
45 | normalize_input: True
46 | normalize_value: True
47 | value_bootstrap: True
48 | num_actors: ${....task.env.numEnvs}
49 | reward_shaper:
50 | scale_value: 0.01
51 | normalize_advantage: True
52 | gamma: 0.99
53 | tau: 0.95
54 | learning_rate: 5e-4
55 | lr_schedule: adaptive
56 | schedule_type: standard
57 | kl_threshold: 0.016
58 | score_to_win: 100000
59 | max_epochs: ${resolve_default:15000,${....max_iterations}}
60 | save_best_after: 100
61 | save_frequency: 200
62 | print_stats: True
63 | grad_norm: 1.0
64 | entropy_coef: 0.0
65 | truncate_grads: True
66 | e_clip: 0.2
67 | horizon_length: 8
68 | minibatch_size: 16 # 32768
69 | mini_epochs: 5
70 | critic_coef: 4
71 | clip_value: True
72 | seq_len: 4
73 | bounds_loss_coef: 0.0001
74 |
75 | player:
76 | # render: True
77 | deterministic: True
78 | games_num: 100000
79 | print_stats: True
80 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/DexHandEnv/learning/__init__.py
--------------------------------------------------------------------------------
/DexHandEnv/learning/amp_datasets.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | import torch
30 | from rl_games.common import datasets
31 |
32 |
33 | class AMPDataset(datasets.PPODataset):
34 | def __init__(
35 | self, batch_size, minibatch_size, is_discrete, is_rnn, device, seq_len
36 | ):
37 | super().__init__(
38 | batch_size, minibatch_size, is_discrete, is_rnn, device, seq_len
39 | )
40 | self._idx_buf = torch.randperm(batch_size)
41 | return
42 |
43 | def update_mu_sigma(self, mu, sigma):
44 | raise NotImplementedError()
45 | return
46 |
47 | def _get_item(self, idx):
48 | start = idx * self.minibatch_size
49 | end = (idx + 1) * self.minibatch_size
50 | sample_idx = self._idx_buf[start:end]
51 |
52 | input_dict = {}
53 | for k, v in self.values_dict.items():
54 | if k not in self.special_names and v is not None:
55 | input_dict[k] = v[sample_idx]
56 |
57 | if end >= self.batch_size:
58 | self._shuffle_idx_buf()
59 |
60 | return input_dict
61 |
62 | def _shuffle_idx_buf(self):
63 | self._idx_buf[:] = torch.randperm(self.batch_size)
64 | return
65 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/amp_models.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | from rl_games.algos_torch.models import ModelA2CContinuousLogStd
30 |
31 |
32 | class ModelAMPContinuous(ModelA2CContinuousLogStd):
33 | def __init__(self, network):
34 | super().__init__(network)
35 | return
36 |
37 | def build(self, config):
38 | net = self.network_builder.build("amp", **config)
39 | for name, _ in net.named_parameters():
40 | print(name)
41 |
42 | obs_shape = config["input_shape"]
43 | normalize_value = config.get("normalize_value", False)
44 | normalize_input = config.get("normalize_input", False)
45 | value_size = config.get("value_size", 1)
46 |
47 | return self.Network(
48 | net,
49 | obs_shape=obs_shape,
50 | normalize_value=normalize_value,
51 | normalize_input=normalize_input,
52 | value_size=value_size,
53 | )
54 |
55 | class Network(ModelA2CContinuousLogStd.Network):
56 | def __init__(self, a2c_network, **kwargs):
57 | super().__init__(a2c_network, **kwargs)
58 | return
59 |
60 | def forward(self, input_dict):
61 | is_train = input_dict.get("is_train", True)
62 | result = super().forward(input_dict)
63 |
64 | if is_train:
65 | amp_obs = input_dict["amp_obs"]
66 | disc_agent_logit = self.a2c_network.eval_disc(amp_obs)
67 | result["disc_agent_logit"] = disc_agent_logit
68 |
69 | amp_obs_replay = input_dict["amp_obs_replay"]
70 | disc_agent_replay_logit = self.a2c_network.eval_disc(amp_obs_replay)
71 | result["disc_agent_replay_logit"] = disc_agent_replay_logit
72 |
73 | amp_demo_obs = input_dict["amp_obs_demo"]
74 | disc_demo_logit = self.a2c_network.eval_disc(amp_demo_obs)
75 | result["disc_demo_logit"] = disc_demo_logit
76 |
77 | return result
78 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/amp_network_builder.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | import torch
30 | import torch.nn as nn
31 |
32 | from rl_games.algos_torch import network_builder
33 |
34 |
35 | DISC_LOGIT_INIT_SCALE = 1.0
36 |
37 |
38 | class AMPBuilder(network_builder.A2CBuilder):
39 | def __init__(self, **kwargs):
40 | super().__init__(**kwargs)
41 | return
42 |
43 | class Network(network_builder.A2CBuilder.Network):
44 | def __init__(self, params, **kwargs):
45 | super().__init__(params, **kwargs)
46 |
47 | if self.is_continuous:
48 | if not self.space_config["learn_sigma"]:
49 | actions_num = kwargs.get("actions_num")
50 | sigma_init = self.init_factory.create(
51 | **self.space_config["sigma_init"]
52 | )
53 | self.sigma = nn.Parameter(
54 | torch.zeros(
55 | actions_num, requires_grad=False, dtype=torch.float32
56 | ),
57 | requires_grad=False,
58 | )
59 | sigma_init(self.sigma)
60 |
61 | amp_input_shape = kwargs.get("amp_input_shape")
62 | self._build_disc(amp_input_shape)
63 |
64 | return
65 |
66 | def load(self, params):
67 | super().load(params)
68 |
69 | self._disc_units = params["disc"]["units"]
70 | self._disc_activation = params["disc"]["activation"]
71 | self._disc_initializer = params["disc"]["initializer"]
72 | return
73 |
74 | def eval_critic(self, obs):
75 | c_out = self.critic_cnn(obs)
76 | c_out = c_out.contiguous().view(c_out.size(0), -1)
77 | c_out = self.critic_mlp(c_out)
78 | value = self.value_act(self.value(c_out))
79 | return value
80 |
81 | def eval_disc(self, amp_obs):
82 | disc_mlp_out = self._disc_mlp(amp_obs)
83 | disc_logits = self._disc_logits(disc_mlp_out)
84 | return disc_logits
85 |
86 | def get_disc_logit_weights(self):
87 | return torch.flatten(self._disc_logits.weight)
88 |
89 | def get_disc_weights(self):
90 | weights = []
91 | for m in self._disc_mlp.modules():
92 | if isinstance(m, nn.Linear):
93 | weights.append(torch.flatten(m.weight))
94 |
95 | weights.append(torch.flatten(self._disc_logits.weight))
96 | return weights
97 |
98 | def _build_disc(self, input_shape):
99 | self._disc_mlp = nn.Sequential()
100 |
101 | mlp_args = {
102 | "input_size": input_shape[0],
103 | "units": self._disc_units,
104 | "activation": self._disc_activation,
105 | "dense_func": torch.nn.Linear,
106 | }
107 | self._disc_mlp = self._build_mlp(**mlp_args)
108 |
109 | mlp_out_size = self._disc_units[-1]
110 | self._disc_logits = torch.nn.Linear(mlp_out_size, 1)
111 |
112 | mlp_init = self.init_factory.create(**self._disc_initializer)
113 | for m in self._disc_mlp.modules():
114 | if isinstance(m, nn.Linear):
115 | mlp_init(m.weight)
116 | if getattr(m, "bias", None) is not None:
117 | torch.nn.init.zeros_(m.bias)
118 |
119 | torch.nn.init.uniform_(
120 | self._disc_logits.weight, -DISC_LOGIT_INIT_SCALE, DISC_LOGIT_INIT_SCALE
121 | )
122 | torch.nn.init.zeros_(self._disc_logits.bias)
123 |
124 | return
125 |
126 | def build(self, name, **kwargs):
127 | net = AMPBuilder.Network(self.params, **kwargs)
128 | return net
129 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/amp_players.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | import torch
30 |
31 | from rl_games.algos_torch import torch_ext
32 | from rl_games.algos_torch.running_mean_std import RunningMeanStd
33 |
34 | import DexHandEnv.learning.common_player as common_player
35 |
36 |
37 | class AMPPlayerContinuous(common_player.CommonPlayer):
38 |
39 | def __init__(self, params):
40 | config = params["config"]
41 |
42 | self._normalize_amp_input = config.get("normalize_amp_input", True)
43 | self._disc_reward_scale = config["disc_reward_scale"]
44 | self._print_disc_prediction = config.get("print_disc_prediction", False)
45 |
46 | super().__init__(params)
47 | return
48 |
49 | def restore(self, fn):
50 | super().restore(fn)
51 | if self._normalize_amp_input:
52 | checkpoint = torch_ext.load_checkpoint(fn)
53 | self._amp_input_mean_std.load_state_dict(checkpoint["amp_input_mean_std"])
54 | return
55 |
56 | def _build_net(self, config):
57 | super()._build_net(config)
58 |
59 | if self._normalize_amp_input:
60 | self._amp_input_mean_std = RunningMeanStd(config["amp_input_shape"]).to(
61 | self.device
62 | )
63 | self._amp_input_mean_std.eval()
64 | return
65 |
66 | def _post_step(self, info):
67 | super()._post_step(info)
68 | if self._print_disc_prediction:
69 | self._amp_debug(info)
70 | return
71 |
72 | def _build_net_config(self):
73 | config = super()._build_net_config()
74 | if hasattr(self, "env"):
75 | config["amp_input_shape"] = self.env.amp_observation_space.shape
76 | else:
77 | config["amp_input_shape"] = self.env_info["amp_observation_space"]
78 |
79 | return config
80 |
81 | def _amp_debug(self, info):
82 | with torch.no_grad():
83 | amp_obs = info["amp_obs"]
84 | amp_obs = amp_obs[0:1]
85 | disc_pred = self._eval_disc(amp_obs.to(self.device))
86 | amp_rewards = self._calc_amp_rewards(amp_obs.to(self.device))
87 | disc_reward = amp_rewards["disc_rewards"]
88 |
89 | disc_pred = disc_pred.detach().cpu().numpy()[0, 0]
90 | disc_reward = disc_reward.cpu().numpy()[0, 0]
91 | print("disc_pred: ", disc_pred, disc_reward)
92 | return
93 |
94 | def _preproc_amp_obs(self, amp_obs):
95 | if self._normalize_amp_input:
96 | amp_obs = self._amp_input_mean_std(amp_obs)
97 | return amp_obs
98 |
99 | def _eval_disc(self, amp_obs):
100 | proc_amp_obs = self._preproc_amp_obs(amp_obs)
101 | return self.model.a2c_network.eval_disc(proc_amp_obs)
102 |
103 | def _calc_amp_rewards(self, amp_obs):
104 | disc_r = self._calc_disc_rewards(amp_obs)
105 | output = {"disc_rewards": disc_r}
106 | return output
107 |
108 | def _calc_disc_rewards(self, amp_obs):
109 | with torch.no_grad():
110 | disc_logits = self._eval_disc(amp_obs)
111 | prob = 1.0 / (1.0 + torch.exp(-disc_logits))
112 | disc_r = -torch.log(
113 | torch.maximum(1 - prob, torch.tensor(0.0001, device=self.device))
114 | )
115 | disc_r *= self._disc_reward_scale
116 | return disc_r
117 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/hrl_continuous.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | import os
30 | import yaml
31 | import copy
32 | import numpy as np
33 |
34 | import torch
35 | from gym import spaces
36 |
37 | import DexHandEnv.learning.common_agent as common_agent
38 | import DexHandEnv.learning.gen_amp as gen_amp
39 | import DexHandEnv.learning.gen_amp_models as gen_amp_models
40 | import DexHandEnv.learning.gen_amp_network_builder as gen_amp_network_builder
41 |
42 | from tensorboardX import SummaryWriter
43 |
44 |
45 | class HRLAgent(common_agent.CommonAgent):
46 | def __init__(self, base_name, config):
47 | with open(os.path.join(os.getcwd(), config["llc_config"]), "r") as f:
48 | llc_config = yaml.load(f, Loader=yaml.SafeLoader)
49 | llc_config_params = llc_config["params"]
50 | self._latent_dim = llc_config_params["config"]["latent_dim"]
51 |
52 | super().__init__(base_name, config)
53 |
54 | self._task_size = self.vec_env.env.get_task_obs_size()
55 |
56 | self._llc_steps = config["llc_steps"]
57 | llc_checkpoint = config["llc_checkpoint"]
58 | assert llc_checkpoint != ""
59 | self._build_llc(llc_config_params, llc_checkpoint)
60 |
61 | return
62 |
63 | def env_step(self, actions):
64 | actions = self.preprocess_actions(actions)
65 | obs = self.obs["obs"]
66 |
67 | rewards = 0.0
68 | done_count = 0.0
69 | for t in range(self._llc_steps):
70 | llc_actions = self._compute_llc_action(obs, actions)
71 | obs, curr_rewards, curr_dones, infos = self.vec_env.step(llc_actions)
72 |
73 | rewards += curr_rewards
74 | done_count += curr_dones
75 |
76 | rewards /= self._llc_steps
77 | dones = torch.zeros_like(done_count)
78 | dones[done_count > 0] = 1.0
79 |
80 | if self.is_tensor_obses:
81 | if self.value_size == 1:
82 | rewards = rewards.unsqueeze(1)
83 | return (
84 | self.obs_to_tensors(obs),
85 | rewards.to(self.ppo_device),
86 | dones.to(self.ppo_device),
87 | infos,
88 | )
89 | else:
90 | if self.value_size == 1:
91 | rewards = np.expand_dims(rewards, axis=1)
92 | return (
93 | self.obs_to_tensors(obs),
94 | torch.from_numpy(rewards).to(self.ppo_device).float(),
95 | torch.from_numpy(dones).to(self.ppo_device),
96 | infos,
97 | )
98 |
99 | def cast_obs(self, obs):
100 | obs = super().cast_obs(obs)
101 | self._llc_agent.is_tensor_obses = self.is_tensor_obses
102 | return obs
103 |
104 | def preprocess_actions(self, actions):
105 | clamped_actions = torch.clamp(actions, -1.0, 1.0)
106 | if not self.is_tensor_obses:
107 | clamped_actions = clamped_actions.cpu().numpy()
108 | return clamped_actions
109 |
110 | def _setup_action_space(self):
111 | super()._setup_action_space()
112 | self.actions_num = self._latent_dim
113 | return
114 |
115 | def _build_llc(self, config_params, checkpoint_file):
116 | network_params = config_params["network"]
117 | network_builder = gen_amp_network_builder.GenAMPBuilder()
118 | network_builder.load(network_params)
119 |
120 | network = gen_amp_models.ModelGenAMPContinuous(network_builder)
121 | llc_agent_config = self._build_llc_agent_config(config_params, network)
122 |
123 | self._llc_agent = gen_amp.GenAMPAgent("llc", llc_agent_config)
124 | self._llc_agent.restore(checkpoint_file)
125 | print("Loaded LLC checkpoint from {:s}".format(checkpoint_file))
126 | self._llc_agent.set_eval()
127 | return
128 |
129 | def _build_llc_agent_config(self, config_params, network):
130 | llc_env_info = copy.deepcopy(self.env_info)
131 | obs_space = llc_env_info["observation_space"]
132 | obs_size = obs_space.shape[0]
133 | obs_size -= self._task_size
134 | llc_env_info["observation_space"] = spaces.Box(
135 | obs_space.low[:obs_size], obs_space.high[:obs_size]
136 | )
137 |
138 | config = config_params["config"]
139 | config["network"] = network
140 | config["num_actors"] = self.num_actors
141 | config["features"] = {"observer": self.algo_observer}
142 | config["env_info"] = llc_env_info
143 |
144 | return config
145 |
146 | def _compute_llc_action(self, obs, actions):
147 | llc_obs = self._extract_llc_obs(obs)
148 | processed_obs = self._llc_agent._preproc_obs(llc_obs)
149 | z = torch.nn.functional.normalize(actions, dim=-1)
150 |
151 | mu, _ = self._llc_agent.model.a2c_network.eval_actor(
152 | obs=processed_obs, amp_latents=z
153 | )
154 | llc_action = mu
155 | llc_action = self._llc_agent.preprocess_actions(llc_action)
156 |
157 | return llc_action
158 |
159 | def _extract_llc_obs(self, obs):
160 | obs_size = obs.shape[-1]
161 | llc_obs = obs[..., : obs_size - self._task_size]
162 | return llc_obs
163 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/hrl_models.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | from rl_games.algos_torch.models import ModelA2CContinuousLogStd
30 |
31 |
32 | class ModelHRLContinuous(ModelA2CContinuousLogStd):
33 | def __init__(self, network):
34 | super().__init__(network)
35 | return
36 |
37 | def build(self, config):
38 | net = self.network_builder.build("amp", **config)
39 | for name, _ in net.named_parameters():
40 | print(name)
41 | return ModelHRLContinuous.Network(net)
42 |
43 | class Network(ModelA2CContinuousLogStd.Network):
44 | def __init__(self, a2c_network):
45 | super().__init__(a2c_network)
46 | return
47 |
--------------------------------------------------------------------------------
/DexHandEnv/learning/replay_buffer.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | import torch
30 |
31 |
32 | class ReplayBuffer:
33 | def __init__(self, buffer_size, device):
34 | self._head = 0
35 | self._total_count = 0
36 | self._buffer_size = buffer_size
37 | self._device = device
38 | self._data_buf = None
39 | self._sample_idx = torch.randperm(buffer_size)
40 | self._sample_head = 0
41 |
42 | return
43 |
44 | def reset(self):
45 | self._head = 0
46 | self._total_count = 0
47 | self._reset_sample_idx()
48 | return
49 |
50 | def get_buffer_size(self):
51 | return self._buffer_size
52 |
53 | def get_total_count(self):
54 | return self._total_count
55 |
56 | def store(self, data_dict):
57 | if self._data_buf is None:
58 | self._init_data_buf(data_dict)
59 |
60 | n = next(iter(data_dict.values())).shape[0]
61 | buffer_size = self.get_buffer_size()
62 | assert n < buffer_size
63 |
64 | for key, curr_buf in self._data_buf.items():
65 | curr_n = data_dict[key].shape[0]
66 | assert n == curr_n
67 |
68 | store_n = min(curr_n, buffer_size - self._head)
69 | curr_buf[self._head : (self._head + store_n)] = data_dict[key][:store_n]
70 |
71 | remainder = n - store_n
72 | if remainder > 0:
73 | curr_buf[0:remainder] = data_dict[key][store_n:]
74 |
75 | self._head = (self._head + n) % buffer_size
76 | self._total_count += n
77 |
78 | return
79 |
80 | def sample(self, n):
81 | total_count = self.get_total_count()
82 | buffer_size = self.get_buffer_size()
83 |
84 | idx = torch.arange(self._sample_head, self._sample_head + n)
85 | idx = idx % buffer_size
86 | rand_idx = self._sample_idx[idx]
87 | if total_count < buffer_size:
88 | rand_idx = rand_idx % self._head
89 |
90 | samples = dict()
91 | for k, v in self._data_buf.items():
92 | samples[k] = v[rand_idx]
93 |
94 | self._sample_head += n
95 | if self._sample_head >= buffer_size:
96 | self._reset_sample_idx()
97 |
98 | return samples
99 |
100 | def _reset_sample_idx(self):
101 | buffer_size = self.get_buffer_size()
102 | self._sample_idx[:] = torch.randperm(buffer_size)
103 | self._sample_head = 0
104 | return
105 |
106 | def _init_data_buf(self, data_dict):
107 | buffer_size = self.get_buffer_size()
108 | self._data_buf = dict()
109 |
110 | for k, v in data_dict.items():
111 | v_shape = v.shape[1:]
112 | self._data_buf[k] = torch.zeros(
113 | (buffer_size,) + v_shape, device=self._device
114 | )
115 |
116 | return
117 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/DexHandEnv/pbt/__init__.py
--------------------------------------------------------------------------------
/DexHandEnv/pbt/experiments/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/DexHandEnv/pbt/experiments/__init__.py
--------------------------------------------------------------------------------
/DexHandEnv/pbt/experiments/ant_pbt.py:
--------------------------------------------------------------------------------
1 | from DexHandEnv.pbt.launcher.run_description import (
2 | ParamGrid,
3 | RunDescription,
4 | Experiment,
5 | )
6 | from DexHandEnv.pbt.experiments.run_utils import version
7 |
8 |
9 | _env = "ant"
10 | _name = f"{_env}_{version}"
11 | _iterations = 10000
12 | _pbt_num_policies = 3
13 |
14 | _params = ParamGrid(
15 | [
16 | ("pbt.policy_idx", list(range(_pbt_num_policies))),
17 | ]
18 | )
19 |
20 | _wandb_activate = True
21 | _wandb_group = f"pbt_{_name}"
22 | _wandb_entity = "your_wandb_entity"
23 | _wandb_project = "your_wandb_project"
24 |
25 | _experiments = [
26 | Experiment(
27 | f"{_name}",
28 | f"python -m DexHandEnv.train task=Ant headless=True "
29 | f"max_iterations={_iterations} num_envs=2048 seed=-1 train.params.config.save_frequency=2000 "
30 | f"wandb_activate={_wandb_activate} wandb_group={_wandb_group} wandb_entity={_wandb_entity} wandb_project={_wandb_project} "
31 | f"pbt=pbt_default pbt.num_policies={_pbt_num_policies} pbt.workspace=workspace_{_name} "
32 | f"pbt.initial_delay=10000000 pbt.interval_steps=5000000 pbt.start_after=10000000 pbt/mutation=ant_mutation",
33 | _params.generate_params(randomize=False),
34 | ),
35 | ]
36 |
37 |
38 | RUN_DESCRIPTION = RunDescription(
39 | f"{_name}",
40 | experiments=_experiments,
41 | experiment_arg_name="experiment",
42 | experiment_dir_arg_name="hydra.run.dir",
43 | param_prefix="",
44 | customize_experiment_name=False,
45 | )
46 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/experiments/run_utils.py:
--------------------------------------------------------------------------------
1 | import random
2 | from typing import List
3 |
4 | # Versioning -- you can change this number and keep a changelog below to keep track of your experiments as you go.
5 | version = "v1"
6 |
7 |
8 | def seeds(num_seeds) -> List[int]:
9 | return [random.randrange(1000000, 9999999) for _ in range(num_seeds)]
10 |
11 |
12 | default_num_frames: int = 10_000_000_000
13 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Aleksei Petrenko
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/DexHandEnv/pbt/launcher/__init__.py
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/run.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import argparse
3 | import importlib
4 |
5 | from DexHandEnv.pbt.launcher.run_ngc import add_ngc_args, run_ngc
6 | from DexHandEnv.pbt.launcher.run_processes import add_os_parallelism_args, run
7 | from DexHandEnv.pbt.launcher.run_slurm import add_slurm_args, run_slurm
8 |
9 |
10 | def launcher_argparser(args) -> argparse.ArgumentParser:
11 | parser = argparse.ArgumentParser()
12 | parser.add_argument(
13 | "--train_dir",
14 | default="./train_dir",
15 | type=str,
16 | help="Directory for sub-experiments",
17 | )
18 | parser.add_argument(
19 | "--run",
20 | default=None,
21 | type=str,
22 | help="Name of the python module that describes the run, e.g. sf_examples.vizdoom.experiments.paper_doom_all_basic_envs.py "
23 | "Run module must be importable in your Python environment. It must define a global variable RUN_DESCRIPTION (see existing run modules for examples).",
24 | )
25 | parser.add_argument(
26 | "--backend",
27 | default="processes",
28 | choices=["processes", "slurm", "ngc"],
29 | help="Launcher backend, use OS multiprocessing by default",
30 | )
31 | parser.add_argument(
32 | "--pause_between",
33 | default=1,
34 | type=int,
35 | help="Pause in seconds between processes",
36 | )
37 | parser.add_argument(
38 | "--experiment_suffix",
39 | default="",
40 | type=str,
41 | help="Append this to the name of the experiment dir",
42 | )
43 |
44 | partial_cfg, _ = parser.parse_known_args(args)
45 |
46 | if partial_cfg.backend == "slurm":
47 | parser = add_slurm_args(parser)
48 | elif partial_cfg.backend == "ngc":
49 | parser = add_ngc_args(parser)
50 | elif partial_cfg.backend == "processes":
51 | parser = add_os_parallelism_args(parser)
52 | else:
53 | raise ValueError(f"Unknown backend: {partial_cfg.backend}")
54 |
55 | return parser
56 |
57 |
58 | def parse_args():
59 | args = launcher_argparser(sys.argv[1:]).parse_args(sys.argv[1:])
60 | return args
61 |
62 |
63 | def main():
64 | launcher_cfg = parse_args()
65 |
66 | try:
67 | # assuming we're given the full name of the module
68 | run_module = importlib.import_module(f"{launcher_cfg.run}")
69 | except ImportError as exc:
70 | print(f"Could not import the run module {exc}")
71 | return 1
72 |
73 | run_description = run_module.RUN_DESCRIPTION
74 | run_description.experiment_suffix = launcher_cfg.experiment_suffix
75 |
76 | if launcher_cfg.backend == "processes":
77 | run(run_description, launcher_cfg)
78 | elif launcher_cfg.backend == "slurm":
79 | run_slurm(run_description, launcher_cfg)
80 | elif launcher_cfg.backend == "ngc":
81 | run_ngc(run_description, launcher_cfg)
82 |
83 | return 0
84 |
85 |
86 | if __name__ == "__main__":
87 | sys.exit(main())
88 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/run_ngc.py:
--------------------------------------------------------------------------------
1 | """
2 | Run many experiments with NGC: hyperparameter sweeps, etc.
3 | This isn't production code, but feel free to use as an example for your NGC setup.
4 |
5 | """
6 |
7 | import time
8 | from multiprocessing.pool import ThreadPool
9 | from subprocess import PIPE, Popen
10 |
11 | from DexHandEnv.pbt.launcher.run_slurm import str2bool
12 |
13 |
14 | def add_ngc_args(parser):
15 | parser.add_argument(
16 | "--ngc_job_template",
17 | default=None,
18 | type=str,
19 | help="NGC command line template, specifying instance type, docker container, etc.",
20 | )
21 | parser.add_argument(
22 | "--ngc_print_only",
23 | default=False,
24 | type=str2bool,
25 | help="Just print commands to the console without executing",
26 | )
27 |
28 | parser.set_defaults(pause_between=0)
29 | return parser
30 |
31 |
32 | def run_ngc(run_description, args):
33 | pause_between = args.pause_between
34 | experiments = run_description.experiments
35 |
36 | print(f"Starting processes with base cmds: {[e.cmd for e in experiments]}")
37 |
38 | if args.ngc_job_template is not None:
39 | with open(args.ngc_job_template, "r") as template_file:
40 | ngc_template = template_file.read()
41 |
42 | ngc_template = ngc_template.replace("\\", " ")
43 | ngc_template = " ".join(ngc_template.split())
44 |
45 | print(f"NGC template: {ngc_template}")
46 | experiments = run_description.generate_experiments(args.train_dir, makedirs=False)
47 | experiments = list(experiments)
48 | print(f"{len(experiments)} experiments to run")
49 |
50 | def launch_experiment(experiment_idx, experiment_):
51 | time.sleep(experiment_idx * 0.1)
52 |
53 | cmd, name, *_ = experiment_
54 |
55 | job_name = name
56 | print(f"Job name: {job_name}")
57 |
58 | ngc_job_cmd = ngc_template.replace("{{ name }}", job_name).replace(
59 | "{{ experiment_cmd }}", cmd
60 | )
61 |
62 | print(f"Executing {ngc_job_cmd}")
63 |
64 | if not args.ngc_print_only:
65 | process = Popen(ngc_job_cmd, stdout=PIPE, shell=True)
66 | output, err = process.communicate()
67 | exit_code = process.wait()
68 | print(f"Output: {output}, err: {err}, exit code: {exit_code}")
69 |
70 | time.sleep(pause_between)
71 |
72 | pool_size = 1 if pause_between > 0 else min(10, len(experiments))
73 | with ThreadPool(pool_size) as p:
74 | p.starmap(launch_experiment, enumerate(experiments))
75 |
76 | print("Done!")
77 | return 0
78 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/run_processes.py:
--------------------------------------------------------------------------------
1 | """Run groups of experiments, hyperparameter sweeps, etc."""
2 |
3 | import os
4 | import sys
5 | import time
6 | import argparse
7 | import subprocess
8 | from os.path import join
9 |
10 |
11 | def add_os_parallelism_args(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
12 | parser.add_argument(
13 | "--num_gpus", default=1, type=int, help="How many local GPUs to use"
14 | )
15 | parser.add_argument(
16 | "--max_parallel", default=4, type=int, help="Maximum simultaneous experiments"
17 | )
18 | parser.add_argument(
19 | "--experiments_per_gpu",
20 | default=-1,
21 | type=int,
22 | help="How many experiments can we squeeze on a single GPU. "
23 | "Specify this option if and only if you are using launcher to run several experiments using OS-level"
24 | "parallelism (--backend=processes)."
25 | "In any other case use default value (-1) for not altering CUDA_VISIBLE_DEVICES at all."
26 | "This will allow your experiments to use all GPUs available (as many as --num_gpu allows)"
27 | "Helpful when e.g. you are running a single big PBT experiment.",
28 | )
29 | return parser
30 |
31 |
32 | def ensure_dir_exists(path) -> str:
33 | if not os.path.exists(path):
34 | os.makedirs(path, exist_ok=True)
35 | return path
36 |
37 |
38 | def run(run_description, args):
39 | experiments = run_description.experiments
40 | max_parallel = args.max_parallel
41 |
42 | print("Starting processes with base cmds: %r", [e.cmd for e in experiments])
43 | print(f"Max parallel processes is {max_parallel}")
44 | print(
45 | f"Monitor log files using\n\n\ttail -f train_dir/{run_description.run_name}/**/**/sf_log.txt\n\n"
46 | )
47 |
48 | processes = []
49 | processes_per_gpu = {g: [] for g in range(args.num_gpus)}
50 |
51 | experiments = run_description.generate_experiments(args.train_dir)
52 | next_experiment = next(experiments, None)
53 |
54 | def find_least_busy_gpu():
55 | least_busy_gpu = None
56 | gpu_available_processes = 0
57 |
58 | for gpu_id in range(args.num_gpus):
59 | available_processes = args.experiments_per_gpu - len(
60 | processes_per_gpu[gpu_id]
61 | )
62 | if available_processes > gpu_available_processes:
63 | gpu_available_processes = available_processes
64 | least_busy_gpu = gpu_id
65 |
66 | return least_busy_gpu, gpu_available_processes
67 |
68 | def can_squeeze_another_process():
69 | if len(processes) >= max_parallel:
70 | return False
71 |
72 | if args.experiments_per_gpu > 0:
73 | least_busy_gpu, gpu_available_processes = find_least_busy_gpu()
74 | if gpu_available_processes <= 0:
75 | return False
76 |
77 | return True
78 |
79 | failed_processes = []
80 | last_log_time = 0
81 | log_interval = 3 # seconds
82 |
83 | while len(processes) > 0 or next_experiment is not None:
84 | while can_squeeze_another_process() and next_experiment is not None:
85 | cmd, name, root_dir, exp_env_vars = next_experiment
86 |
87 | cmd_tokens = cmd.split(" ")
88 |
89 | # workaround to make sure we're running the correct python executable from our virtual env
90 | if cmd_tokens[0].startswith("python"):
91 | cmd_tokens[0] = sys.executable
92 | print(f"Using Python executable {cmd_tokens[0]}")
93 |
94 | ensure_dir_exists(join(args.train_dir, root_dir))
95 |
96 | envvars = os.environ.copy()
97 |
98 | best_gpu = None
99 | if args.experiments_per_gpu > 0:
100 | best_gpu, best_gpu_available_processes = find_least_busy_gpu()
101 | print(
102 | f"The least busy gpu is {best_gpu} where we can run {best_gpu_available_processes} more processes",
103 | )
104 | envvars["CUDA_VISIBLE_DEVICES"] = f"{best_gpu}"
105 |
106 | print(f"Starting process {cmd_tokens}")
107 |
108 | if exp_env_vars is not None:
109 | for key, value in exp_env_vars.items():
110 | print(f"Adding env variable {key} {value}")
111 | envvars[str(key)] = str(value)
112 |
113 | process = subprocess.Popen(
114 | cmd_tokens, stdout=None, stderr=None, env=envvars
115 | )
116 | process.gpu_id = best_gpu
117 | process.proc_cmd = cmd
118 |
119 | processes.append(process)
120 |
121 | if process.gpu_id is not None:
122 | processes_per_gpu[process.gpu_id].append(process.proc_cmd)
123 |
124 | print(f"Started process {process.proc_cmd} GPU {process.gpu_id}")
125 | print(
126 | f"Waiting for {args.pause_between} seconds before starting next process"
127 | )
128 | time.sleep(args.pause_between)
129 |
130 | next_experiment = next(experiments, None)
131 |
132 | remaining_processes = []
133 | for process in processes:
134 | if process.poll() is None:
135 | remaining_processes.append(process)
136 | continue
137 | else:
138 | if process.gpu_id is not None:
139 | processes_per_gpu[process.gpu_id].remove(process.proc_cmd)
140 | print(f"Process finished {process.proc_cmd}, {process.returncode}")
141 | if process.returncode != 0:
142 | failed_processes.append(
143 | (process.proc_cmd, process.pid, process.returncode)
144 | )
145 | print(f"WARNING: RETURN CODE IS {process.returncode}")
146 |
147 | processes = remaining_processes
148 |
149 | if time.time() - last_log_time > log_interval:
150 | if failed_processes:
151 | print(
152 | f"Failed processes:",
153 | ", ".join([f"PID: {p[1]} code: {p[2]}" for p in failed_processes]),
154 | )
155 | last_log_time = time.time()
156 |
157 | time.sleep(0.1)
158 |
159 | print("Done!")
160 |
161 | return 0
162 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/run_slurm.py:
--------------------------------------------------------------------------------
1 | import os
2 | import time
3 | import argparse
4 | from os.path import join
5 | from string import Template
6 | from subprocess import PIPE, Popen
7 |
8 |
9 | SBATCH_TEMPLATE_DEFAULT = (
10 | "#!/bin/bash\n" "conda activate conda_env_name\n" "cd ~/project\n"
11 | )
12 |
13 |
14 | def str2bool(v):
15 | if isinstance(v, bool):
16 | return v
17 | if isinstance(v, str) and v.lower() in ("true",):
18 | return True
19 | elif isinstance(v, str) and v.lower() in ("false",):
20 | return False
21 | else:
22 | raise argparse.ArgumentTypeError("Boolean value expected")
23 |
24 |
25 | def add_slurm_args(parser):
26 | parser.add_argument(
27 | "--slurm_gpus_per_job",
28 | default=1,
29 | type=int,
30 | help="GPUs in a single SLURM process",
31 | )
32 | parser.add_argument(
33 | "--slurm_cpus_per_gpu",
34 | default=16,
35 | type=int,
36 | help="Max allowed number of CPU cores per allocated GPU",
37 | )
38 | parser.add_argument(
39 | "--slurm_print_only",
40 | default=False,
41 | type=str2bool,
42 | help="Just print commands to the console without executing",
43 | )
44 | parser.add_argument(
45 | "--slurm_workdir",
46 | default=None,
47 | type=str,
48 | help="Optional workdir. Used by slurm launcher to store logfiles etc.",
49 | )
50 | parser.add_argument(
51 | "--slurm_partition",
52 | default=None,
53 | type=str,
54 | help='Adds slurm partition, i.e. for "gpu" it will add "-p gpu" to sbatch command line',
55 | )
56 |
57 | parser.add_argument(
58 | "--slurm_sbatch_template",
59 | default=None,
60 | type=str,
61 | help="Commands to run before the actual experiment (i.e. activate conda env, etc.)",
62 | )
63 |
64 | parser.add_argument(
65 | "--slurm_timeout",
66 | default="0",
67 | type=str,
68 | help="Time to run jobs before timing out job and requeuing the job. Defaults to 0, which does not time out the job",
69 | )
70 |
71 | return parser
72 |
73 |
74 | def run_slurm(run_description, args):
75 | workdir = args.slurm_workdir
76 | pause_between = args.pause_between
77 |
78 | experiments = run_description.experiments
79 |
80 | print(f"Starting processes with base cmds: {[e.cmd for e in experiments]}")
81 |
82 | if not os.path.exists(workdir):
83 | print(f"Creating {workdir}...")
84 | os.makedirs(workdir)
85 |
86 | if args.slurm_sbatch_template is not None:
87 | with open(args.slurm_sbatch_template, "r") as template_file:
88 | sbatch_template = template_file.read()
89 | else:
90 | sbatch_template = SBATCH_TEMPLATE_DEFAULT
91 |
92 | print(f"Sbatch template: {sbatch_template}")
93 |
94 | partition = ""
95 | if args.slurm_partition is not None:
96 | partition = f"-p {args.slurm_partition} "
97 |
98 | num_cpus = args.slurm_cpus_per_gpu * args.slurm_gpus_per_job
99 |
100 | experiments = run_description.generate_experiments(args.train_dir)
101 | sbatch_files = []
102 | for experiment in experiments:
103 | cmd, name, *_ = experiment
104 |
105 | sbatch_fname = f"sbatch_{name}.sh"
106 | sbatch_fname = join(workdir, sbatch_fname)
107 | sbatch_fname = os.path.abspath(sbatch_fname)
108 |
109 | file_content = Template(sbatch_template).substitute(
110 | CMD=cmd,
111 | FILENAME=sbatch_fname,
112 | PARTITION=partition,
113 | GPU=args.slurm_gpus_per_job,
114 | CPU=num_cpus,
115 | TIMEOUT=args.slurm_timeout,
116 | )
117 | with open(sbatch_fname, "w") as sbatch_f:
118 | sbatch_f.write(file_content)
119 |
120 | sbatch_files.append(sbatch_fname)
121 |
122 | job_ids = []
123 | idx = 0
124 | for sbatch_file in sbatch_files:
125 | idx += 1
126 | sbatch_fname = os.path.basename(sbatch_file)
127 | cmd = f"sbatch {partition}--gres=gpu:{args.slurm_gpus_per_job} -c {num_cpus} --parsable --output {workdir}/{sbatch_fname}-slurm-%j.out {sbatch_file}"
128 | print(f"Executing {cmd}")
129 |
130 | if args.slurm_print_only:
131 | output = idx
132 | else:
133 | cmd_tokens = cmd.split()
134 | process = Popen(cmd_tokens, stdout=PIPE)
135 | output, err = process.communicate()
136 | exit_code = process.wait()
137 | print(f"{output} {err} {exit_code}")
138 |
139 | if exit_code != 0:
140 | print("sbatch process failed!")
141 | time.sleep(5)
142 |
143 | job_id = int(output)
144 | job_ids.append(str(job_id))
145 |
146 | time.sleep(pause_between)
147 |
148 | tail_cmd = f"tail -f {workdir}/*.out"
149 | print(f"Monitor log files using\n\n\t {tail_cmd} \n\n")
150 |
151 | scancel_cmd = f'scancel {" ".join(job_ids)}'
152 |
153 | print("Jobs queued: %r" % job_ids)
154 | print("Use this command to cancel your jobs: \n\t %s \n" % scancel_cmd)
155 |
156 | with open(join(workdir, "scancel.sh"), "w") as fobj:
157 | fobj.write(scancel_cmd)
158 |
159 | print("Done!")
160 | return 0
161 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/launcher/slurm/sbatch_timeout.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | conda activate your_env
3 | cd ~/your_project_dir || exit
4 |
5 | timeout $TIMEOUT $CMD
6 | if [[ $$? -eq 124 ]]; then
7 | sbatch $PARTITION--gres=gpu:$GPU -c $CPU --parsable --output $FILENAME-slurm-%j.out $FILENAME
8 | fi
9 |
--------------------------------------------------------------------------------
/DexHandEnv/pbt/mutation.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | import copy
30 | import random
31 |
32 |
33 | def mutate_float(x, change_min=1.1, change_max=1.5):
34 | perturb_amount = random.uniform(change_min, change_max)
35 |
36 | # mutation direction
37 | new_value = x / perturb_amount if random.random() < 0.5 else x * perturb_amount
38 | return new_value
39 |
40 |
41 | def mutate_float_min_1(x, **kwargs):
42 | new_value = mutate_float(x, **kwargs)
43 | new_value = max(1.0, new_value)
44 | return new_value
45 |
46 |
47 | def mutate_eps_clip(x, **kwargs):
48 | new_value = mutate_float(x, **kwargs)
49 | new_value = max(0.01, new_value)
50 | new_value = min(0.3, new_value)
51 | return new_value
52 |
53 |
54 | def mutate_mini_epochs(x, **kwargs):
55 | change_amount = 1
56 | new_value = x + change_amount if random.random() < 0.5 else x - change_amount
57 | new_value = max(1, new_value)
58 | new_value = min(8, new_value)
59 | return new_value
60 |
61 |
62 | def mutate_discount(x, **kwargs):
63 | """Special mutation func for parameters such as gamma (discount factor)."""
64 | inv_x = 1.0 - x
65 | # very conservative, large changes in gamma can lead to very different critic estimates
66 | new_inv_x = mutate_float(inv_x, change_min=1.1, change_max=1.2)
67 | new_value = 1.0 - new_inv_x
68 | return new_value
69 |
70 |
71 | def get_mutation_func(mutation_func_name):
72 | try:
73 | func = eval(mutation_func_name)
74 | except Exception as exc:
75 | print(
76 | f"Exception {exc} while trying to find the mutation func {mutation_func_name}."
77 | )
78 | raise Exception(f"Could not find mutation func {mutation_func_name}")
79 |
80 | return func
81 |
82 |
83 | def mutate(params, mutations, mutation_rate, pbt_change_min, pbt_change_max):
84 | mutated_params = copy.deepcopy(params)
85 |
86 | for param, param_value in params.items():
87 | # toss a coin whether we perturb the parameter at all
88 | if random.random() > mutation_rate:
89 | continue
90 |
91 | mutation_func_name = mutations[param]
92 | mutation_func = get_mutation_func(mutation_func_name)
93 |
94 | mutated_value = mutation_func(
95 | param_value, change_min=pbt_change_min, change_max=pbt_change_max
96 | )
97 | mutated_params[param] = mutated_value
98 |
99 | print(f"Param {param} mutated to value {mutated_value}")
100 |
101 | return mutated_params
102 |
--------------------------------------------------------------------------------
/DexHandEnv/tasks/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | from .ant import Ant
30 | from .dex_cube import DexCube
31 | from .dex_hand import DexHand
32 |
33 | # Mappings from strings to environments
34 | isaacgym_task_map = {
35 | "Ant": Ant,
36 | "DexCube": DexCube,
37 | "DexHand": DexHand,
38 | }
39 |
--------------------------------------------------------------------------------
/DexHandEnv/tasks/base/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/DexHandEnv/utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/DexHandEnv/utils/__init__.py
--------------------------------------------------------------------------------
/DexHandEnv/utils/reformat.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | from omegaconf import DictConfig, OmegaConf
30 | from typing import Dict
31 |
32 | def omegaconf_to_dict(d: DictConfig)->Dict:
33 | """Converts an omegaconf DictConfig to a python Dict, respecting variable interpolation."""
34 | ret = {}
35 | for k, v in d.items():
36 | if isinstance(v, DictConfig):
37 | ret[k] = omegaconf_to_dict(v)
38 | else:
39 | ret[k] = v
40 | return ret
41 |
42 | def print_dict(val, nesting: int = -4, start: bool = True):
43 | """Outputs a nested dictionory."""
44 | if type(val) == dict:
45 | if not start:
46 | print('')
47 | nesting += 4
48 | for k in val:
49 | print(nesting * ' ', end='')
50 | print(k, end=': ')
51 | print_dict(val[k], nesting, start=False)
52 | else:
53 | print(val)
54 |
55 | # EOF
56 |
--------------------------------------------------------------------------------
/DexHandEnv/utils/rna_util.py:
--------------------------------------------------------------------------------
1 |
2 | # Copyright (c) 2018-2023, NVIDIA Corporation
3 | # All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are met:
7 | #
8 | # 1. Redistributions of source code must retain the above copyright notice, this
9 | # list of conditions and the following disclaimer.
10 | #
11 | # 2. Redistributions in binary form must reproduce the above copyright notice,
12 | # this list of conditions and the following disclaimer in the documentation
13 | # and/or other materials provided with the distribution.
14 | #
15 | # 3. Neither the name of the copyright holder nor the names of its
16 | # contributors may be used to endorse or promote products derived from
17 | # this software without specific prior written permission.
18 | #
19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 | from __future__ import print_function
31 |
32 | import torch
33 | import torch.nn as nn
34 | import torch.nn.functional as F
35 |
36 |
37 | class RandomNetworkAdversary(nn.Module):
38 |
39 | def __init__(self, num_envs, in_dims, out_dims, softmax_bins, device):
40 | super(RandomNetworkAdversary, self).__init__()
41 |
42 | """
43 | Class to add random action to the action generated by the policy.
44 | The output is binned to 32 bins per channel and we do softmax over
45 | these bins to figure out the most likely joint angle.
46 |
47 | Note: OpenAI et al. 2019 found out that if they used a continuous space
48 | and a tanh non-linearity, actions would always be close to 0.
49 | Section B.3 https://arxiv.org/abs/1910.07113
50 |
51 | Q: Why do we need dropouts here?
52 |
53 | A: If we were using a CPU-based simulator as in OpenAI et al. 2019, we
54 | will use a different RNA network for different CPU. However,
55 | this is not feasible for a GPU-based simulator as that would mean
56 | creating N_envs RNA networks which will overwhelm the GPU-memory.
57 | Therefore, dropout is a nice approximation of this by re-sampling
58 | weights of the same neural network for each different env on the GPU.
59 | """
60 |
61 | self.in_dims = in_dims
62 | self.out_dims = out_dims
63 | self.softmax_bins = softmax_bins
64 | self.num_envs = num_envs
65 |
66 | self.device = device
67 |
68 | self.num_feats1 = 512
69 | self.num_feats2 = 1024
70 |
71 | # Sampling random probablities for dropout masks
72 | dropout_probs = torch.rand((2, ))
73 |
74 | # Setting up the RNA neural network here
75 |
76 | # First layer
77 |
78 | self.fc1 = nn.Linear(in_dims, self.num_feats1).to(self.device)
79 |
80 | self.dropout_masks1 = torch.bernoulli(torch.ones((self.num_envs, \
81 | self.num_feats1)), p=dropout_probs[0]).to(self.device)
82 |
83 | self.fc1_1 = nn.Linear(self.num_feats1, self.num_feats1).to(self.device)
84 |
85 | # Second layer
86 | self.fc2 = nn.Linear(self.num_feats1, self.num_feats2).to(self.device)
87 |
88 | self.dropout_masks2 = torch.bernoulli(torch.ones((self.num_envs, \
89 | self.num_feats2)), p=dropout_probs[1]).to(self.device)
90 |
91 | self.fc2_1 = nn.Linear(self.num_feats2, self.num_feats2).to(self.device)
92 |
93 | # Last layer
94 | self.fc3 = nn.Linear(self.num_feats2, out_dims*softmax_bins).to(self.device)
95 |
96 | # This is needed to reset weights and dropout masks
97 | self._refresh()
98 |
99 | def _refresh(self):
100 |
101 | self._init_weights()
102 | self.eval()
103 | self.refresh_dropout_masks()
104 |
105 | def _init_weights(self):
106 |
107 | print('initialising weights for random network')
108 |
109 | nn.init.kaiming_uniform_(self.fc1.weight)
110 | nn.init.kaiming_uniform_(self.fc1_1.weight)
111 | nn.init.kaiming_uniform_(self.fc2.weight)
112 | nn.init.kaiming_uniform_(self.fc2_1.weight)
113 | nn.init.kaiming_uniform_(self.fc3.weight)
114 |
115 | return
116 |
117 | def refresh_dropout_masks(self):
118 |
119 | dropout_probs = torch.rand((2, ))
120 |
121 | self.dropout_masks1 = torch.bernoulli(torch.ones((self.num_envs, self.num_feats1)), \
122 | p=dropout_probs[0]).to(self.dropout_masks1.device)
123 |
124 | self.dropout_masks2 = torch.bernoulli(torch.ones((self.num_envs, self.num_feats2)), \
125 | p=dropout_probs[1]).to(self.dropout_masks2.device)
126 |
127 | return
128 |
129 | def forward(self, x):
130 |
131 | x = self.fc1(x)
132 | x = F.relu(x)
133 | x = self.fc1_1(x)
134 | x = self.dropout_masks1 * x
135 |
136 | x = self.fc2(x)
137 | x = F.relu(x)
138 | x = self.fc2_1(x)
139 | x = self.dropout_masks2 * x
140 |
141 | x = self.fc3(x)
142 |
143 | x = x.view(-1, self.out_dims, self.softmax_bins)
144 | output = F.softmax(x, dim=-1)
145 |
146 | # We have discretised the joint angles into bins
147 | # Now we pick up the bin for each joint angle
148 | # corresponding to the highest softmax value / prob.
149 |
150 | return output
151 |
152 |
153 | if __name__ == "__main__":
154 |
155 | num_envs = 1024
156 | RNA = RandomNetworkAdversary(num_envs=num_envs, in_dims=16, out_dims=16, softmax_bins=32, device='cuda')
157 |
158 | x = torch.tensor(torch.randn(num_envs, 16).to(RNA.device))
159 | y = RNA(x)
160 | import ipdb; ipdb.set_trace()
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/DexHandEnv/utils/utils.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2018-2023, NVIDIA Corporation
2 | # All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | #
7 | # 1. Redistributions of source code must retain the above copyright notice, this
8 | # list of conditions and the following disclaimer.
9 | #
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # 3. Neither the name of the copyright holder nor the names of its
15 | # contributors may be used to endorse or promote products derived from
16 | # this software without specific prior written permission.
17 | #
18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | # python
30 | #import pwd
31 | import getpass
32 | import tempfile
33 | import time
34 | from collections import OrderedDict
35 | from os.path import join
36 |
37 | import numpy as np
38 | import torch
39 | import random
40 | import os
41 |
42 |
43 | def retry(times, exceptions):
44 | """
45 | Retry Decorator https://stackoverflow.com/a/64030200/1645784
46 | Retries the wrapped function/method `times` times if the exceptions listed
47 | in ``exceptions`` are thrown
48 | :param times: The number of times to repeat the wrapped function/method
49 | :type times: Int
50 | :param exceptions: Lists of exceptions that trigger a retry attempt
51 | :type exceptions: Tuple of Exceptions
52 | """
53 | def decorator(func):
54 | def newfn(*args, **kwargs):
55 | attempt = 0
56 | while attempt < times:
57 | try:
58 | return func(*args, **kwargs)
59 | except exceptions:
60 | print(f'Exception thrown when attempting to run {func}, attempt {attempt} out of {times}')
61 | time.sleep(min(2 ** attempt, 30))
62 | attempt += 1
63 |
64 | return func(*args, **kwargs)
65 | return newfn
66 | return decorator
67 |
68 |
69 | def flatten_dict(d, prefix='', separator='.'):
70 | res = dict()
71 | for key, value in d.items():
72 | if isinstance(value, (dict, OrderedDict)):
73 | res.update(flatten_dict(value, prefix + key + separator, separator))
74 | else:
75 | res[prefix + key] = value
76 |
77 | return res
78 |
79 |
80 | def set_np_formatting():
81 | """ formats numpy print """
82 | np.set_printoptions(edgeitems=30, infstr='inf',
83 | linewidth=4000, nanstr='nan', precision=2,
84 | suppress=False, threshold=10000, formatter=None)
85 |
86 |
87 | def set_seed(seed, torch_deterministic=False, rank=0):
88 | """ set seed across modules """
89 | if seed == -1 and torch_deterministic:
90 | seed = 42 + rank
91 | elif seed == -1:
92 | seed = np.random.randint(0, 10000)
93 | else:
94 | seed = seed + rank
95 |
96 | print("Setting seed: {}".format(seed))
97 |
98 | random.seed(seed)
99 | np.random.seed(seed)
100 | torch.manual_seed(seed)
101 | os.environ['PYTHONHASHSEED'] = str(seed)
102 | torch.cuda.manual_seed(seed)
103 | torch.cuda.manual_seed_all(seed)
104 |
105 | if torch_deterministic:
106 | # refer to https://docs.nvidia.com/cuda/cublas/index.html#cublasApi_reproducibility
107 | os.environ['CUBLAS_WORKSPACE_CONFIG'] = ':4096:8'
108 | torch.backends.cudnn.benchmark = False
109 | torch.backends.cudnn.deterministic = True
110 | torch.use_deterministic_algorithms(True)
111 | else:
112 | torch.backends.cudnn.benchmark = True
113 | torch.backends.cudnn.deterministic = False
114 |
115 | return seed
116 |
117 | def nested_dict_set_attr(d, key, val):
118 | pre, _, post = key.partition('.')
119 | if post:
120 | nested_dict_set_attr(d[pre], post, val)
121 | else:
122 | d[key] = val
123 |
124 | def nested_dict_get_attr(d, key):
125 | pre, _, post = key.partition('.')
126 | if post:
127 | return nested_dict_get_attr(d[pre], post)
128 | else:
129 | return d[key]
130 |
131 | def ensure_dir_exists(path):
132 | if not os.path.exists(path):
133 | os.makedirs(path)
134 | return path
135 |
136 |
137 | def safe_ensure_dir_exists(path):
138 | """Should be safer in multi-treaded environment."""
139 | try:
140 | return ensure_dir_exists(path)
141 | except FileExistsError:
142 | return path
143 |
144 |
145 | def get_username():
146 | uid = os.getuid()
147 | try:
148 | return getpass.getuser()
149 | except KeyError:
150 | # worst case scenario - let's just use uid
151 | return str(uid)
152 |
153 |
154 | def project_tmp_dir():
155 | tmp_dir_name = f'ige_{get_username()}'
156 | return safe_ensure_dir_exists(join(tempfile.gettempdir(), tmp_dir_name))
157 |
158 | # EOF
159 |
--------------------------------------------------------------------------------
/DexHandEnv/utils/wandb_utils.py:
--------------------------------------------------------------------------------
1 | from rl_games.common.algo_observer import AlgoObserver
2 |
3 | from DexHandEnv.utils.utils import retry
4 | from DexHandEnv.utils.reformat import omegaconf_to_dict
5 |
6 |
7 | class WandbAlgoObserver(AlgoObserver):
8 | """Need this to propagate the correct experiment name after initialization."""
9 |
10 | def __init__(self, cfg):
11 | super().__init__()
12 | self.cfg = cfg
13 |
14 | def before_init(self, base_name, config, experiment_name):
15 | """
16 | Must call initialization of Wandb before RL-games summary writer is initialized, otherwise
17 | sync_tensorboard does not work.
18 | """
19 |
20 | import wandb
21 |
22 | wandb_unique_id = f"uid_{experiment_name}"
23 | print(f"Wandb using unique id {wandb_unique_id}")
24 |
25 | cfg = self.cfg
26 |
27 | # this can fail occasionally, so we try a couple more times
28 | @retry(3, exceptions=(Exception,))
29 | def init_wandb():
30 | wandb.init(
31 | project=cfg.wandb_project,
32 | entity=cfg.wandb_entity,
33 | group=cfg.wandb_group,
34 | tags=cfg.wandb_tags,
35 | sync_tensorboard=True,
36 | id=wandb_unique_id,
37 | name=experiment_name,
38 | resume=True,
39 | settings=wandb.Settings(start_method="fork"),
40 | )
41 |
42 | if cfg.wandb_logcode_dir:
43 | wandb.run.log_code(root=cfg.wandb_logcode_dir)
44 | print("wandb running directory........", wandb.run.dir)
45 |
46 | print("Initializing WandB...")
47 | try:
48 | init_wandb()
49 | except Exception as exc:
50 | print(f"Could not initialize WandB! {exc}")
51 |
52 | if isinstance(self.cfg, dict):
53 | wandb.config.update(self.cfg, allow_val_change=True)
54 | else:
55 | wandb.config.update(omegaconf_to_dict(self.cfg), allow_val_change=True)
56 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2018-2023, NVIDIA Corporation
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | 3. Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 | See assets/licenses for license information for assets included in this repository
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Isaac Gym Envs for DexHand
2 |
3 | This repository provides a framework for training dexterous grasping policies for robotic hands using NVIDIA's Isaac Gym simulator.
4 |
5 | ### Installation
6 |
7 | 1. Download and install [Isaac Gym Preview 4](https://developer.nvidia.com/isaac-gym) from NVIDIA's website
8 |
9 | 2. Verify Isaac Gym installation:
10 |
11 | ```bash
12 | cd isaac-gym/python/examples
13 | python joint_monkey.py
14 | ```
15 |
16 | 3. Clone and install this repository:
17 |
18 | ```bash
19 | git clone https://github.com/dexrobot/dexrobot_isaac
20 | cd dexrobot_isaac
21 | pip install -e .
22 | ```
23 |
24 | ## Running
25 |
26 | ### Training
27 |
28 | ```bash
29 | python DexHandEnv/train.py task=DexCube num_envs=4096 headless=True
30 | ```
31 | - `num_envs`: Number of parallel environments (default: 4096)
32 | - `headless`: Run without visualization for faster training
33 |
34 | ### Testing
35 |
36 | To test a trained model:
37 |
38 | ```bash
39 | python DexHandEnv/train.py task=DexCube test=True num_envs=2 checkpoint=runs/DexCube_*/nn/DexHand.pth
40 | python DexHandEnv/train.py task=DexCube test=True num_envs=2 checkpoint=runs/DexCube_06-14-42-29/nn/DexCube.pth
41 | ```
42 |
43 | ### Configuration
44 |
45 | The environment and training parameters can be customized through config files:
46 |
47 | - Environment config: `DexHandEnv/config/task/DexHand.yaml`
48 | - Training config: `DexHandEnv/config/train/DexHandPPO.yaml`
49 |
50 | ### Video Recording
51 |
52 | To capture training videos:
53 |
54 | ```bash
55 | python DexHandEnv/train.py task=DexHand capture_video=True capture_video_freq=1500 capture_video_len=100
56 | ```
57 |
58 | ### Multi-GPU Training
59 |
60 | For distributed training across multiple GPUs:
61 |
62 | ```bash
63 | torchrun --standalone --nnodes=1 --nproc_per_node=2 DexHandEnv/train.py multi_gpu=True task=DexHand
64 | ```
65 |
66 | ## License
67 |
68 | This project is licensed under the Apache License.
69 |
70 | ## Acknowledgements
71 |
72 | This work builds upon the Isaac Gym framework developed by NVIDIA.
73 |
--------------------------------------------------------------------------------
/assets/README.md:
--------------------------------------------------------------------------------
1 | # Assets Directory Structure
2 |
3 | - `mjcf`: MuJoCo XML format files for various robots and scenes
4 | - `urdf`: Universal Robot Description Format files
5 | - `dexhand`: Dex Hand robot assets
6 |
--------------------------------------------------------------------------------
/assets/dexhand/.gitattributes:
--------------------------------------------------------------------------------
1 | *.STL filter=lfs diff=lfs merge=lfs -text
2 | *.stl filter=lfs diff=lfs merge=lfs -text
3 |
--------------------------------------------------------------------------------
/assets/dexhand/.gitignore:
--------------------------------------------------------------------------------
1 | # Python
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 | *.so
6 | .Python
7 | build/
8 | develop-eggs/
9 | dist/
10 | downloads/
11 | eggs/
12 | .eggs/
13 | lib/
14 | lib64/
15 | parts/
16 | sdist/
17 | var/
18 | wheels/
19 | *.egg-info/
20 | .installed.cfg
21 | *.egg
22 | MANIFEST
23 | .env
24 | .venv
25 | env/
26 | venv/
27 | ENV/
28 | env.bak/
29 | venv.bak/
30 |
31 | # IDEs and editors
32 | .idea/
33 | .vscode/
34 | *.swp
35 | *.swo
36 | *~
37 | *.iml
38 |
39 | # OS
40 | .DS_Store
41 | .DS_Store?
42 | ._*
43 | .Spotlight-V100
44 | .Trashes
45 | ehthumbs.db
46 | Thumbs.db
47 |
48 | # URDF backup files
49 | *.urdf.bak
50 |
51 | # Common simulation/visualization temp files
52 | *.rviz.bak
53 | *.world.bak
54 | *.sdf.bak
55 |
56 | # Log files
57 | *.log
58 | logs/
59 |
60 | # code2prompt
61 | dexrobot_urdf.txt
62 |
--------------------------------------------------------------------------------
/assets/dexhand/README.md:
--------------------------------------------------------------------------------
1 | # DexRobot URDF Models
2 |
3 | This repository contains URDF models for a dexterous robotic hand system, including both left and right hand configurations. The models are compatible with standard URDF toolchains and have been tested with MuJoCo.
4 |
5 | ## Quickstart
6 |
7 | The URDF models can be visualized using MuJoCo's `simulate` tool:
8 |
9 | ```bash
10 | # For left hand
11 | simulate urdf/dexhand021_left.urdf
12 |
13 | # For right hand
14 | simulate urdf/dexhand021_right.urdf
15 | ```
16 |
17 | Note: After launching the simulator, hit the 'Pause' button first, then 'Reset' to properly visualize the model in its initial configuration.
18 |
19 | ## Model Conventions
20 |
21 | ### Naming Convention
22 |
23 | The model follows a systematic naming convention for links and joints:
24 |
25 | - Base Format: `[lr]_[type]_[component]`
26 | - `[lr]`: 'l' for left hand, 'r' for right hand
27 | - `[type]`: 'p' for palm components, 'f' for finger components
28 | - `[component]`: specific component identifier
29 |
30 | #### Component Numbering
31 |
32 | - Thumb Rotation: `*_1_1`
33 | - Finger Spread: `[2345]_1` (for index, middle, ring, and pinky fingers)
34 | - Proximal Joints: `[12345]_2` (for all fingers including thumb)
35 | - Distal Joints: `[12345]_[34]` (for all fingers)
36 | - Note: While distal joints are mechanically coupled in the physical system, this coupling is not reflected in the URDF model
37 |
38 | ### Frame Convention
39 |
40 | The model primarily follows the Denavit-Hartenberg (DH) convention for frame assignments:
41 |
42 | #### Base Frame
43 | - Origin: Located at the wrist
44 | - Z-axis: Points toward fingertips
45 | - Thumb Orientation: Inclines toward negative X-axis for both hands
46 |
47 | ## Utility Scripts
48 |
49 | The repository includes several Python utilities in the `utils/` directory for checking and modifying URDF models:
50 |
51 | ### analyze_urdf.py
52 | Analyzes URDF files for physical validity and consistency:
53 | ```bash
54 | python utils/analyze_urdf.py urdf/dexhand021_left.urdf
55 | ```
56 |
57 | ### update_mesh_paths.py
58 | Updates mesh file paths in URDF files:
59 | ```bash
60 | python utils/update_mesh_paths.py urdf/dexhand021_left.urdf --prefix ../meshes
61 | ```
62 |
63 | ### rename_urdf.py
64 | Renames links and joints in URDF files:
65 | ```bash
66 | python utils/rename_urdf.py urdf/dexhand021_left.urdf meshes/
67 | ```
68 |
69 | All utility scripts support a `--dry-run` option to preview changes without modifying files.
70 |
71 | ## Notes for Users
72 |
73 | - Mesh files are referenced relative to the URDF location using `../meshes/`
74 | - The models are compatible with major robotics simulation environments that support URDF
75 | - While the URDF models don't enforce joint coupling, users can implement this in their control software
76 | - The utility scripts can be modified as needed to accommodate specific requirements
77 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4f8dd990e2da4140d466f4dd34afe23222ea5b91e9af0d4e90a05dbdd30b447e
3 | size 792684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:50217e4d0b439bfd179e470f8e03f85c65e88b7b75fb06fd35f104bc5dea8de8
3 | size 503184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d5c804896939dba97984bdb038692a0297bc4050a090e9775e2f5a8e1e2432d1
3 | size 474884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d00880bebb740bfc17c43dc9548efd64413b21d6e4db9d994c1a18d6aa120b44
3 | size 317584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b4459c643bc6ed433d029a715d45e92198b4f1d5a531a34e5f1775e924702c2b
3 | size 293884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9c2794f7ee06a94dff89d34eb3d044750b564c85768a8b55f3ed157a1d546ae1
3 | size 371684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:edfd86e15fb087fa641a06c8e09a4016c9d04fe4205f8ce235c8de29dd3b50e4
3 | size 53284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d20ed0d40143ad80568a82214799e0e291599218c5a13e5613a818ba12067456
3 | size 1356484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:730db745452ff0c10f955a92fe7691922411779cb2e7e0b104e3687a5d215e4d
3 | size 236684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link1_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9e99670d537966c8d0fb6982b980fbe99ba632da75b53ddc94daf6969387558c
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:94bf2aad39dca39a4f507e8ee684ffb0665338a8ab3b99138353e3caa66cecae
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:6c5fad6286ec532e3b159f002fa9cb88d79b77e305e36756244df3560cf40f1b
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:8c51c9888026e6f4afe17bc93e64d2916127419686e63306fa8cbd87068e66cb
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0ddb912753b29105f35d65287868ff782fd5a0186d2350462a03bf8680315009
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7da76def698acf2733261837199b3427e9d7895289503708a5123bdd554982af
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:e3dfcbaeb8cad5b9c46722beb12b82293e5eb3a1525968b0722b73bc9ebd992d
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d946c06967c0dc24b4caba3b2bb03d16f8b365e18f91b62a00879179732d7c65
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:093f8f3e794f65935c10a6c14717590154d062d2e7a24f7def440fce41f71e7b
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:c5916c7dd81cc8b023b337520fae9fa838b52b84a785f40872a55bd2baaee13c
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link2_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ffa230fe9557d8e212e822eb19da5e69545db91af1b2f36b25dfbc707f020d7a
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4678a519ebb4a38e839d3217705994b60536f4b873169ae2934f2489ed0440b1
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f7fa8a5f390e0a6754e00cbe8a5e89b7a602fcaf076b51f5874f8739b4f0f021
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:74e2959e27bc1da709b747a4bfbcce54e5ef9a06f881f23734dddd3296ac9376
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a5f90f2c26e0ee4d72dd37c199071b8d1b68ce7eb681d90b1392b9da56fa079a
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ee67923a42c8bed1261eabf5a39a8d382d37fb97c280b3a3d20a573260a8727f
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:30f310341aa7cd87eb0ac675627ddb6356468df227f20a63e727cce3f5c00af1
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a74481a31fc50c49db8ff16eec9a43539de2d847f6f016769e5a4d38dc24c3e6
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:000b19ec12ac46de4f43b7f7e101be2212a204afbfab27cb7dcb8e978c9f4308
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d76ff51d7dd057858d6f578c26ee712272e9dea4b0d59b6c4466abcb83eeb85a
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link3_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:92797376c88d9461e224cc5e5c171ecc5acf57a1e32c0cae184215b0f1830ef8
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ed0de3257bc0fc1c2fcc0027b686bf3e91ed7be53748d0f56e5710da7e56a6e3
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9b6ab9b9a473ebf97a39a31c1ce828904e81e11808458cb3b435d3b4e9e211d7
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:948f057e58e28bcb5d40c43b7b2672f45356a5bd8716c96fc17a4b459bae7522
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:79eda222ada70eedcab6193fe3f3eb0bce2c0e79d7e411bc0e78ea087a81ce05
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:da30557e507f3fd685bc2ce3095fccff745ed72c72dbead1b50a1caedce3d2d9
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5967eff028f9ebfc7fafa0fa3f08f2bcf6e0ec5f58873bd9227b645adc7a1ddd
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9f05297fb82475bf9ebd7905d3fd65e1f23b982f88e799edaa57aad7a8f2edc1
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:bdb2ec3c5b8b2cf8b6014b9bf4d366ebd61a6ecb5bcf478f2617cf5703806eb3
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:3e6272f12a6b7297961f59646b2c5801778141fcaf33d510805217616fbb69e1
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link4_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:30b0d2e0a852f5a14a73a9a690e7f9baf74b60f3fa4618dd6a1cb871026a6368
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ddd15a512762bba2e888b8067d5ca3adccef6d71495cfb7b44e732ac83103054
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:bf7ae8992f92794bb1d0f38dd2a6163624f2effa9146357d4dc728b47cee48a5
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:dddd67515d7249f191a910714ff2c415c8d32f4af014dc1f7af1f3a669bc8aa6
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:3690bf0381c490d025c9fdfe251670f8a1ab642ff4e992763e9a946e1434aef3
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:524073029eeb5540b5896566b1b489f2ab9bb015c1f73dec9b46be9b764d4dc3
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ee6c74051e4cbb79a95a09e8dcef2f78ab174210744d88027205dd4fa02356ec
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a7d1d38d0b21e0aed1175279d4a37812b9bdc2243a8bec796354c8f05abf7eaa
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9ea978c373bfe3f498cc5a05b7b7d21b066dd58bbd94253fb98b0ebce2c39db6
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:bc4d7c3141c14e4942abb553b9ac630977a34495a16ec81c868353c6e75c98ea
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_f_link5_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:837c4df50e8dc006324f88b529b8e7583f2e65f000f68145472753401a762578
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link0.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:20981e8b76a33c3101fb02652dcba03818aae99cdc3cfb006b0679649fe3e4a7
3 | size 4389584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:87fbbe93fa0e048aab85b8cce67d9479d64d7b0210b3796eb6b1a33dafb0694f
3 | size 134684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9b57f1fdab0c45b6a5fb33819d383cafce77aa50315fa4911e52f90220662bb1
3 | size 311484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a87e01e6d2da24396303aa40f8262a6d27fae121224e225e001ee226163f4e0e
3 | size 1011184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:219609cd3c47f5b9f78d73161bcc2efa5ae87369dcd01d08de43884843d2e52a
3 | size 439384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link5.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:25b5c1f0eeae691f701ec722ada199e14bebc9feaf825c034a24af5cdf34e27d
3 | size 1442584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/l_p_link6.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:a409e835ad3f83fc4a9c6ec520c772329358169b1deab108d14aadada5360ee9
3 | size 358684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:821afdc0164292ae3f545acbe1675c5c068713ddb997dfcaa837cc78449f51df
3 | size 792684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4944199c42978d237edea90f36a09ad9035dfde72a66918f93d0ef4510a71013
3 | size 503184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:44c2fd77855a1b0e4f6e59585a7643c947b7a61ec36a2d47c33fe0f6d4858cc7
3 | size 474884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4ef398932babcca1e04ae84854bae6d75c784f1f17f016837aca052f6a6767a4
3 | size 317584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:94f5d8fd506751560284c2dc5cd5c7842a14e9ae4c7469aa2ef0719ac851734d
3 | size 293884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5ef6c3b616fd04ad152ef71461dba2d0d6e40ae401500635902c4b16206a2687
3 | size 371684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:78a141f81148384767dc91213cf75a300b24dbc5bbf63c4af88821b63c3c0d33
3 | size 53284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0b1b25f2ea4dea84977a5cf992dc0938f5731634422fd3c62f2d25e5f7c43e5d
3 | size 1356484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:bfe8d68e8d73163f90941152e2537aa687ad1d31c43cd5a1c22ba003de3bc6fd
3 | size 236684
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link1_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:3b4dab551a91d0005a139d8ae8a5825648ce6601602f5ab96dd86e2d280d7e67
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:31441fad42bf2bf3abd91c30d228e6f597c2971cd1f614cb1166edbadb61bc61
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:819d9fb7d976b1de117432063a9d8d4dba4943e0844a09e7fce840b356780dd0
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:84b6767b9a426ffec8d8ae9655f440c7275db046d821b562b5ac64c30b68f062
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5d05c5c19c2f4d8512239f07df365d0e5a7c77279e0d646370f0f6a9882747af
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f9b53e91963f9bdc8f68b4a0535d7936a1fbde8e5c9bae7b0fbee7495f3d10af
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:18989c9c2581e5024f32b7b3be4d9f8e7e48bda23e843af0e36fe9af7d1912dc
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9ff05eca4ad91e0db4f4e0cbad58254855ecbd2bbfe3d14ef20f91238c9f91b0
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:3b621a6fd2ba8cd43f8fd404e1a482b59bc1f6021d9b17cc974fcb7d02195b0f
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:008ca9b61dc763d9adabd5340ca419da259819cd98e3b8b4a68c345c103781de
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link2_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:01b9f2b93b3dc363fed77954264e39ccd1bc5e0cf5c9d58ecf5fc581d849239a
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:19ca99ba7ade1884a9abbae5d476a6a1281d6ffea0ecd53a28688f3e5bc0b5cc
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:dbd3eeb2e02fcbc161ed79b28773f7adaf916a5e992f4bd7f5198f82334fd656
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:04211dba43565de8c18f8bb74f20c60fef0818c7eb9a953e14e9a06b87016c2d
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:c2220bd18a4816793d3e60e22037a208327b6c47a6e8f14be1f0b134ad56302c
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:c315603981fc7ef65d1891b1f578a4705e1dff8811b78d9fd4c54399afa98931
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:16e385cbb4ca1e24b910175ab61ec6d872428dfc8a9ff05510f4d802a17c203f
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1430280cd77cedf0eea08b57ab7940520930a7f00c0b7ddf7b963914a64eaf71
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:eed5b251b7c68c38fe234987ef6749e0f25e87f39be6f925a70bc1d036f5f608
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:b47e3a9cf543a5534045c3f39378874a05d22a7ec76a9654623fbd63d666f07b
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link3_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:833ee596776df24b9f8d5ef31849942e86fed2de96dbee51ea16d2a23ea60b9f
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f8571cdd91fa7db0f4dbe5d3783bf4b17098e30e255c2c93d2872706969ee16e
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:35512dfce76b9e3b9c775ecddab82ff5d634ff7d0f09608b8a22eea51ffe15cc
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:28d5a3a150820700e2927f83022c793cb845280ca54c913735221600fab12115
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:99ee3448de78ffcbcf091650a3bd25d206529562eee2cecd9b67f63380ca7265
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:c078b1344c02e8d9b5f46b3fdb91f8f06d8ab3c45c49de6db18e8ad0944ad374
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:c9d527987ea595e03b7adbeb0735cf6e3e17e765b5f14a4fa603a59c0c4fb3de
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:fc8de3ae6299f901cb46832d9ce5afc0c8414b41c2ce2d3f4dded36120fe011b
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:eaca5a03f96f652b3c2ce821f86755ae03a1b8062c1fbfda18d11a7e9ad24bc2
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:59608f1576aaa683b7db33f16d293b5c9c99400f674b97abf7a77757b25a9d7a
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link4_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:323d212a1cf431f7b0cbe6b2741a80d0249afdc4cb375485c8aebb318d57c667
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:8c332eed662495e69912939ca304dce203bc3575fba4ddf7918d77e170a0a772
3 | size 291184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:1bedb163ae4c66f71d2557a34ea6d8dc393e6ab61d19a4571f9cea491c273088
3 | size 523384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_2_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:0b0dfcd6ed715290969290e992ff52f4bf1cf44b7a75ff5f553048cf8f6cda90
3 | size 697484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_2_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:ada7d13e4de2785e594d6876469da7a68f2dfb4d2ef677a3371cdf6d75675999
3 | size 335384
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:48acbae8cdc6718d3f27ac0a6f4aef94223f0780be731e13b509ab78fc3bafd2
3 | size 302484
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_3_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:722cb76c6ca5de6d93b6c680a835647b3c625a4bb6e725200048df86a25088ed
3 | size 429884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_3_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:34822ed21fcd352654cda50f5a7248cf445df6b5ebdb5bf8fd3fb789094e051b
3 | size 53784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4449383336307f2b9035e3a4ed85737c66e277a5a0e2d05458dd0ce0d7ff1e0e
3 | size 1355884
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_4_1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:74ca2adf1accd0a2772145280e5c4d635e153b724b3fb28e3fba83f4cf371a15
3 | size 327584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_f_link5_4_2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:8e364e9fdae2ec4c9ccdd4a08b0bb6d01efdc4186ce63305cc5570b2f34e95bc
3 | size 271284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link0.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:00920b6723bb39321eea748fd96279f8a7634de5d5034d7c9725f5713d8595fa
3 | size 636184
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link1.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5a5555f2225c084ea10f207ed18e8733d6136b07881fb39ae7c18168a4ac6984
3 | size 132084
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link2.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:f82581f65e2501b929e803638fa1cafa823d98655da9325998adc78d1293285e
3 | size 311584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link3.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:e7784afd44f560c22c5d4d3cd1027cb3d2bc143815761f0ec307dc280c52e8f7
3 | size 1009784
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link4.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4c33e24769483292c4e5f538060b81208c8acdd5642759f93ff5e893b3cd4d3c
3 | size 427984
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link5.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:47f7e1be016ace38dc5a095e8eb056e4142ded466f577c0d214d0e7414280f03
3 | size 1443584
4 |
--------------------------------------------------------------------------------
/assets/dexhand/meshes/r_p_link6.STL:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:03693492eafa87dbf2f7243879ad2f971d74b004cee5a3f471720b1617402647
3 | size 357284
4 |
--------------------------------------------------------------------------------
/assets/dexhand/mjcf/cube_single_dof.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/arena_round.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/ball.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/bucket.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/cube_goal_multicolor.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/cube_multicolor.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/cube_multicolor_allegro.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/cube_multicolor_allegro_sdf.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/cube_multicolor_dextreme.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/ball.obj:
--------------------------------------------------------------------------------
1 | ####
2 | #
3 | # OBJ File Generated by Meshlab
4 | #
5 | ####
6 | # Object ball.obj
7 | #
8 | # Vertices: 52
9 | # Faces: 100
10 | #
11 | ####
12 | vn -2.736881 -3.135792 3.650102
13 | v -0.019796 -0.021793 0.025077
14 | vn -0.283305 -4.867286 2.817169
15 | v -0.001758 -0.033065 0.019653
16 | vn 2.979527 -4.359581 2.047262
17 | v 0.020129 -0.029636 0.013791
18 | vn 0.804378 -2.960452 4.640355
19 | v 0.006077 -0.020829 0.032099
20 | vn 2.600202 -5.129210 -0.151066
21 | v 0.017524 -0.034012 -0.000871
22 | vn 3.758670 -2.542891 3.605391
23 | v 0.024696 -0.016773 0.023675
24 | vn 3.350138 -2.348826 -4.057188
25 | v 0.022760 -0.016363 -0.025808
26 | vn 4.616093 -0.051791 -3.293688
27 | v 0.031391 -0.000222 -0.022368
28 | vn 4.777335 -2.855832 -0.821087
29 | v 0.032700 -0.019580 -0.005914
30 | vn 4.124402 0.780002 3.688572
31 | v 0.028253 0.004440 0.026000
32 | vn 5.237640 -1.233876 1.641103
33 | v 0.036055 -0.008321 0.010948
34 | vn -0.536476 2.683864 -5.003013
35 | v -0.004085 0.018586 -0.033546
36 | vn -0.856318 4.975262 -2.886957
37 | v -0.005180 0.032627 -0.019173
38 | vn -0.011274 5.697695 0.033894
39 | v 0.000000 0.038416 0.000000
40 | vn 1.548117 5.164749 -2.296017
41 | v 0.010190 0.033213 -0.015789
42 | vn 1.505271 3.337274 -4.546393
43 | v 0.009111 0.022589 -0.029360
44 | vn 3.488779 4.461930 -0.016972
45 | v 0.023662 0.030453 -0.000281
46 | vn 4.479890 2.809529 2.347029
47 | v 0.029739 0.018643 0.014599
48 | vn 3.529057 3.454826 -2.921593
49 | v 0.023122 0.024124 -0.019011
50 | vn 5.070533 2.206106 -2.001021
51 | v 0.033078 0.013633 -0.012823
52 | vn 5.444608 1.876673 0.673634
53 | v 0.035923 0.012335 0.003388
54 | vn -0.599094 -0.459006 -5.500641
55 | v -0.004844 -0.003207 -0.038287
56 | vn 2.271039 -0.186382 5.263724
57 | v 0.015817 -0.001351 0.034834
58 | vn -2.690078 -5.009366 0.457029
59 | v -0.018229 -0.033695 0.002338
60 | vn -0.918321 -0.276341 5.393467
61 | v -0.006380 -0.001299 0.038407
62 | vn 0.078866 -5.696169 0.033567
63 | v -0.000000 -0.038416 0.000000
64 | vn 2.968390 -4.177267 -2.745841
65 | v 0.019445 -0.027444 -0.018293
66 | vn -3.955125 -0.017691 4.199929
67 | v -0.026503 0.000775 0.027558
68 | vn -0.084924 -2.821173 -4.648463
69 | v -0.000428 -0.021167 -0.032900
70 | vn -4.899406 -1.568905 2.476551
71 | v -0.033086 -0.010994 0.016445
72 | vn -4.386741 -3.847526 0.392798
73 | v -0.028767 -0.024781 0.002346
74 | vn -1.572935 -5.068572 -2.399193
75 | v -0.010190 -0.033213 -0.015789
76 | vn -5.603407 -1.710843 0.396545
77 | v -0.035923 -0.012335 0.003388
78 | vn -5.121485 -2.108362 -1.992761
79 | v -0.033078 -0.013633 -0.012823
80 | vn -4.617683 2.217114 2.765672
81 | v -0.030245 0.014162 0.018490
82 | vn -5.411799 1.477013 1.269662
83 | v -0.035908 0.010364 0.008307
84 | vn -3.345715 -3.526425 -2.917672
85 | v -0.023122 -0.024124 -0.019011
86 | vn -2.331253 2.479513 4.560584
87 | v -0.016663 0.016228 0.030719
88 | vn -4.758959 3.023074 -0.830718
89 | v -0.032700 0.019580 -0.005914
90 | vn -0.724280 4.833078 3.122172
91 | v -0.004153 0.031744 0.020635
92 | vn -3.019570 4.383113 2.032065
93 | v -0.020129 0.029636 0.013791
94 | vn -3.583183 -0.626529 -4.223618
95 | v -0.024926 -0.004220 -0.029145
96 | vn 0.980673 2.652054 4.860205
97 | v 0.006646 0.019040 0.032864
98 | vn -2.615672 5.124959 -0.152392
99 | v -0.017524 0.034012 -0.000871
100 | vn -5.257881 0.621508 -1.793234
101 | v -0.036782 0.004415 -0.011453
102 | vn -3.251458 3.661318 -2.867412
103 | v -0.021608 0.025584 -0.018953
104 | vn -2.902887 1.895444 -4.660213
105 | v -0.017210 0.012967 -0.031406
106 | vn 0.935884 -4.814260 -3.069167
107 | v 0.005924 -0.031447 -0.021234
108 | vn 5.836606 -0.109171 -0.822667
109 | v 0.037698 0.000189 -0.004997
110 | vn 2.465987 0.508544 -4.973077
111 | v 0.017883 0.003738 -0.033870
112 | vn 2.312305 4.042447 3.409233
113 | v 0.013926 0.027960 0.022263
114 | vn 1.881975 5.250778 1.735332
115 | v 0.012152 0.034078 0.012286
116 | # 52 vertices, 0 vertices normals
117 |
118 | f 4//4 25//25 1//1
119 | f 4//4 1//1 2//2
120 | f 2//2 26//26 3//3
121 | f 3//3 26//26 5//5
122 | f 4//4 2//2 3//3
123 | f 25//25 4//4 23//23
124 | f 6//6 4//4 3//3
125 | f 5//5 27//27 9//9
126 | f 3//3 5//5 9//9
127 | f 23//23 4//4 6//6
128 | f 11//11 3//3 9//9
129 | f 9//9 27//27 7//7
130 | f 6//6 3//3 11//11
131 | f 9//9 7//7 8//8
132 | f 23//23 6//6 10//10
133 | f 10//10 6//6 11//11
134 | f 8//8 7//7 50//50
135 | f 11//11 9//9 49//49
136 | f 49//49 9//9 8//8
137 | f 21//21 11//11 49//49
138 | f 46//46 12//12 47//47
139 | f 47//47 12//12 22//22
140 | f 13//13 12//12 46//46
141 | f 44//44 14//14 13//13
142 | f 13//13 16//16 12//12
143 | f 14//14 15//15 13//13
144 | f 15//15 16//16 13//13
145 | f 17//17 15//15 14//14
146 | f 52//52 17//17 14//14
147 | f 15//15 19//19 16//16
148 | f 17//17 19//19 15//15
149 | f 51//51 18//18 52//52
150 | f 18//18 17//17 52//52
151 | f 16//16 50//50 12//12
152 | f 19//19 50//50 16//16
153 | f 50//50 22//22 12//12
154 | f 51//51 10//10 18//18
155 | f 17//17 20//20 19//19
156 | f 18//18 21//21 17//17
157 | f 8//8 50//50 19//19
158 | f 43//43 23//23 10//10
159 | f 17//17 21//21 20//20
160 | f 20//20 8//8 19//19
161 | f 21//21 49//49 20//20
162 | f 10//10 11//11 18//18
163 | f 18//18 11//11 21//21
164 | f 27//27 5//5 48//48
165 | f 1//1 24//24 2//2
166 | f 26//26 48//48 5//5
167 | f 7//7 29//29 50//50
168 | f 28//28 1//1 25//25
169 | f 27//27 29//29 7//7
170 | f 29//29 22//22 50//50
171 | f 26//26 32//32 48//48
172 | f 25//25 38//38 28//28
173 | f 48//48 29//29 27//27
174 | f 1//1 31//31 24//24
175 | f 28//28 30//30 1//1
176 | f 24//24 32//32 26//26
177 | f 30//30 31//31 1//1
178 | f 32//32 29//29 48//48
179 | f 30//30 33//33 31//31
180 | f 31//31 37//37 24//24
181 | f 24//24 37//37 32//32
182 | f 32//32 37//37 29//29
183 | f 33//33 34//34 31//31
184 | f 31//31 34//34 37//37
185 | f 38//38 35//35 28//28
186 | f 28//28 35//35 30//30
187 | f 36//36 33//33 30//30
188 | f 35//35 36//36 30//30
189 | f 36//36 45//45 33//33
190 | f 33//33 45//45 34//34
191 | f 25//25 43//43 38//38
192 | f 34//34 42//42 37//37
193 | f 37//37 42//42 29//29
194 | f 38//38 41//41 35//35
195 | f 35//35 41//41 36//36
196 | f 42//42 22//22 29//29
197 | f 36//36 39//39 45//45
198 | f 45//45 42//42 34//34
199 | f 41//41 39//39 36//36
200 | f 43//43 40//40 38//38
201 | f 40//40 41//41 38//38
202 | f 41//41 44//44 39//39
203 | f 43//43 51//51 40//40
204 | f 39//39 46//46 45//45
205 | f 40//40 14//14 41//41
206 | f 14//14 44//44 41//41
207 | f 25//25 23//23 43//43
208 | f 44//44 46//46 39//39
209 | f 46//46 47//47 45//45
210 | f 45//45 47//47 42//42
211 | f 51//51 52//52 40//40
212 | f 52//52 14//14 40//40
213 | f 47//47 22//22 42//42
214 | f 44//44 13//13 46//46
215 | f 26//26 2//2 24//24
216 | f 49//49 8//8 20//20
217 | f 10//10 51//51 43//43
218 | # 100 faces, 0 coords texture
219 |
220 | # End of File
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/ball.stl:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:88c5d1ee597afe6282c0232049075f1014069ac24c3a68bf8229e6dfeabf8328
3 | size 4438193
4 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/bucket.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'bucket.blend'
2 | # Material Count: 1
3 |
4 | newmtl None
5 | Ns 500
6 | Ka 0.8 0.8 0.8
7 | Kd 0.8 0.8 0.8
8 | Ks 0.8 0.8 0.8
9 | d 1
10 | illum 2
11 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/bucket.obj:
--------------------------------------------------------------------------------
1 | # Blender v2.93.1 OBJ File: 'bucket.blend'
2 | # www.blender.org
3 | mtllib bucket.mtl
4 | o Cylinder
5 | v -0.000000 0.079763 0.000047
6 | v -0.000000 0.101419 0.197743
7 | v 0.040890 0.068807 0.000047
8 | v 0.051718 0.087562 0.197743
9 | v 0.070823 0.038873 0.000047
10 | v 0.089578 0.049702 0.197743
11 | v 0.081779 -0.002016 0.000047
12 | v 0.103436 -0.002016 0.197743
13 | v 0.070823 -0.042906 0.000047
14 | v 0.089578 -0.053734 0.197743
15 | v 0.040890 -0.072839 0.000047
16 | v 0.051718 -0.091594 0.197743
17 | v -0.000000 -0.083795 0.000047
18 | v -0.000000 -0.105452 0.197743
19 | v -0.040890 -0.072839 0.000047
20 | v -0.051718 -0.091594 0.197743
21 | v -0.070823 -0.042906 0.000047
22 | v -0.089578 -0.053734 0.197743
23 | v -0.081779 -0.002016 0.000047
24 | v -0.103436 -0.002016 0.197743
25 | v -0.070823 0.038873 0.000047
26 | v -0.089578 0.049702 0.197743
27 | v -0.040890 0.068807 0.000047
28 | v -0.051718 0.087562 0.197743
29 | v 0.060000 0.101907 0.197743
30 | v 0.000000 0.117984 0.197743
31 | v 0.103923 0.057984 0.197743
32 | v 0.120000 -0.002016 0.197743
33 | v 0.103923 -0.062016 0.197743
34 | v 0.060000 -0.105939 0.197743
35 | v -0.000000 -0.122016 0.197743
36 | v -0.060000 -0.105939 0.197743
37 | v -0.103923 -0.062016 0.197743
38 | v -0.120000 -0.002016 0.197743
39 | v -0.103923 0.057984 0.197743
40 | v -0.060000 0.101907 0.197743
41 | v 0.035245 0.059030 0.009911
42 | v -0.000000 0.068474 0.009911
43 | v 0.061047 0.033229 0.009911
44 | v 0.070491 -0.002016 0.009911
45 | v 0.061047 -0.037262 0.009911
46 | v 0.035245 -0.063063 0.009911
47 | v -0.000000 -0.072507 0.009911
48 | v -0.035245 -0.063063 0.009911
49 | v -0.061047 -0.037261 0.009911
50 | v -0.070491 -0.002016 0.009911
51 | v -0.061047 0.033229 0.009911
52 | v -0.035245 0.059030 0.009911
53 | vt 1.000000 0.500000
54 | vt 1.000000 1.000000
55 | vt 0.916667 1.000000
56 | vt 0.916667 0.500000
57 | vt 0.833333 1.000000
58 | vt 0.833333 0.500000
59 | vt 0.750000 1.000000
60 | vt 0.750000 0.500000
61 | vt 0.666667 1.000000
62 | vt 0.666667 0.500000
63 | vt 0.583333 1.000000
64 | vt 0.583333 0.500000
65 | vt 0.500000 1.000000
66 | vt 0.500000 0.500000
67 | vt 0.416667 1.000000
68 | vt 0.416667 0.500000
69 | vt 0.333333 1.000000
70 | vt 0.333333 0.500000
71 | vt 0.250000 1.000000
72 | vt 0.250000 0.500000
73 | vt 0.166667 1.000000
74 | vt 0.166667 0.500000
75 | vt 0.429156 0.146564
76 | vt 0.456871 0.250000
77 | vt 0.456871 0.250000
78 | vt 0.429156 0.146564
79 | vt 0.083333 1.000000
80 | vt 0.083333 0.500000
81 | vt 0.000000 1.000000
82 | vt 0.000000 0.500000
83 | vt 0.750000 0.490000
84 | vt 0.870000 0.457846
85 | vt 0.957846 0.370000
86 | vt 0.990000 0.250000
87 | vt 0.957846 0.130000
88 | vt 0.870000 0.042154
89 | vt 0.750000 0.010000
90 | vt 0.630000 0.042154
91 | vt 0.542154 0.130000
92 | vt 0.510000 0.250000
93 | vt 0.542154 0.370000
94 | vt 0.630000 0.457846
95 | vt 0.250000 0.456871
96 | vt 0.353436 0.429156
97 | vt 0.370000 0.457846
98 | vt 0.250000 0.490000
99 | vt 0.429156 0.353436
100 | vt 0.457846 0.370000
101 | vt 0.490000 0.250000
102 | vt 0.457846 0.130000
103 | vt 0.353436 0.070844
104 | vt 0.370000 0.042154
105 | vt 0.250000 0.043129
106 | vt 0.250000 0.010000
107 | vt 0.146564 0.070844
108 | vt 0.130000 0.042154
109 | vt 0.070844 0.146564
110 | vt 0.042154 0.130000
111 | vt 0.043129 0.250000
112 | vt 0.010000 0.250000
113 | vt 0.070844 0.353436
114 | vt 0.042154 0.370000
115 | vt 0.146564 0.429156
116 | vt 0.130000 0.457846
117 | vt 0.353436 0.429156
118 | vt 0.250000 0.456871
119 | vt 0.146564 0.429156
120 | vt 0.070844 0.353436
121 | vt 0.043129 0.250000
122 | vt 0.070844 0.146564
123 | vt 0.146564 0.070844
124 | vt 0.250000 0.043129
125 | vt 0.353436 0.070844
126 | vt 0.429156 0.353436
127 | vn 0.2544 0.9495 -0.1836
128 | vn 0.6951 0.6951 -0.1836
129 | vn 0.9495 0.2544 -0.1836
130 | vn 0.9495 -0.2544 -0.1836
131 | vn 0.6951 -0.6951 -0.1836
132 | vn 0.2544 -0.9495 -0.1836
133 | vn -0.2544 -0.9495 -0.1836
134 | vn -0.6951 -0.6951 -0.1836
135 | vn -0.9495 -0.2544 -0.1836
136 | vn -0.9495 0.2544 -0.1836
137 | vn -0.9524 0.2552 0.1670
138 | vn -0.6951 0.6951 -0.1836
139 | vn -0.2544 0.9495 -0.1836
140 | vn 0.0000 0.0000 -1.0000
141 | vn 0.0000 0.0000 1.0000
142 | vn 0.6972 -0.6972 0.1670
143 | vn -0.2552 -0.9524 0.1670
144 | vn 0.6972 0.6972 0.1670
145 | vn -0.6972 0.6972 0.1670
146 | vn 0.2552 -0.9524 0.1670
147 | vn -0.6972 -0.6972 0.1670
148 | vn 0.9524 0.2552 0.1670
149 | vn -0.2552 0.9524 0.1670
150 | vn -0.9524 -0.2552 0.1670
151 | vn 0.9524 -0.2552 0.1670
152 | vn 0.2552 0.9524 0.1670
153 | usemtl None
154 | s off
155 | f 1/1/1 26/2/1 25/3/1 3/4/1
156 | f 3/4/2 25/3/2 27/5/2 5/6/2
157 | f 5/6/3 27/5/3 28/7/3 7/8/3
158 | f 7/8/4 28/7/4 29/9/4 9/10/4
159 | f 9/10/5 29/9/5 30/11/5 11/12/5
160 | f 11/12/6 30/11/6 31/13/6 13/14/6
161 | f 13/14/7 31/13/7 32/15/7 15/16/7
162 | f 15/16/8 32/15/8 33/17/8 17/18/8
163 | f 17/18/9 33/17/9 34/19/9 19/20/9
164 | f 19/20/10 34/19/10 35/21/10 21/22/10
165 | f 10/23/11 8/24/11 40/25/11 41/26/11
166 | f 21/22/12 35/21/12 36/27/12 23/28/12
167 | f 23/28/13 36/27/13 26/29/13 1/30/13
168 | f 1/31/14 3/32/14 5/33/14 7/34/14 9/35/14 11/36/14 13/37/14 15/38/14 17/39/14 19/40/14 21/41/14 23/42/14
169 | f 2/43/15 4/44/15 25/45/15 26/46/15
170 | f 4/44/15 6/47/15 27/48/15 25/45/15
171 | f 6/47/15 8/24/15 28/49/15 27/48/15
172 | f 8/24/15 10/23/15 29/50/15 28/49/15
173 | f 10/23/15 12/51/15 30/52/15 29/50/15
174 | f 12/51/15 14/53/15 31/54/15 30/52/15
175 | f 14/53/15 16/55/15 32/56/15 31/54/15
176 | f 16/55/15 18/57/15 33/58/15 32/56/15
177 | f 18/57/15 20/59/15 34/60/15 33/58/15
178 | f 20/59/15 22/61/15 35/62/15 34/60/15
179 | f 22/61/15 24/63/15 36/64/15 35/62/15
180 | f 24/63/15 2/43/15 26/46/15 36/64/15
181 | f 37/65/15 38/66/15 48/67/15 47/68/15 46/69/15 45/70/15 44/71/15 43/72/15 42/73/15 41/26/15 40/25/15 39/74/15
182 | f 24/63/16 22/61/16 47/68/16 48/67/16
183 | f 4/44/17 2/43/17 38/66/17 37/65/17
184 | f 18/57/18 16/55/18 44/71/18 45/70/18
185 | f 12/51/19 10/23/19 41/26/19 42/73/19
186 | f 2/43/20 24/63/20 48/67/20 38/66/20
187 | f 6/47/21 4/44/21 37/65/21 39/74/21
188 | f 20/59/22 18/57/22 45/70/22 46/69/22
189 | f 14/53/23 12/51/23 42/73/23 43/72/23
190 | f 8/24/24 6/47/24 39/74/24 40/25/24
191 | f 22/61/25 20/59/25 46/69/25 47/68/25
192 | f 16/55/26 14/53/26 43/72/26 44/71/26
193 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/cube_multicolor.mtl:
--------------------------------------------------------------------------------
1 | newmtl red
2 | Ns 10.0
3 | Ka 1.0 1.0 1.0
4 | Kd 1.0 0.0 0.0
5 | Ks 0.125 0.125 0.125
6 | Ke 0.0 0.0 0.0
7 | Ni 1.0
8 | d 1.0
9 | illum 2
10 |
11 | newmtl green
12 | Ns 10.0
13 | Ka 1.0 1.0 1.0
14 | Kd 0.0 1.0 0.0
15 | Ks 0.125 0.125 0.125
16 | Ke 0.0 0.0 0.0
17 | Ni 1.0
18 | d 1.0
19 | illum 2
20 |
21 | newmtl blue
22 | Ns 10.0
23 | Ka 1.0 1.0 1.0
24 | Kd 0.0 0.0 1.0
25 | Ks 0.125 0.125 0.125
26 | Ke 0.0 0.0 0.0
27 | Ni 1.0
28 | d 1.0
29 | illum 2
30 |
31 | newmtl yellow
32 | Ns 10.0
33 | Ka 1.0 1.0 1.0
34 | Kd 1.0 1.0 0.0
35 | Ks 0.125 0.125 0.125
36 | Ke 0.0 0.0 0.0
37 | Ni 1.0
38 | d 1.0
39 | illum 2
40 |
41 | newmtl cyan
42 | Ns 10.0
43 | Ka 1.0 1.0 1.0
44 | Kd 0.0 1.0 1.0
45 | Ks 0.125 0.125 0.125
46 | Ke 0.0 0.0 0.0
47 | Ni 1.0
48 | d 1.0
49 | illum 2
50 |
51 | newmtl white
52 | Ns 10.0
53 | Ka 1.0 1.0 1.0
54 | Kd 1.0 1.0 1.0
55 | Ks 0.125 0.125 0.125
56 | Ke 0.0 0.0 0.0
57 | Ni 1.0
58 | d 1.0
59 | illum 2
60 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/cube_multicolor.obj:
--------------------------------------------------------------------------------
1 | mtllib cube_multicolor.mtl
2 |
3 | v -0.5 -0.5 -0.5
4 | v -0.5 -0.5 0.5
5 | v -0.5 0.5 -0.5
6 | v -0.5 0.5 0.5
7 | v 0.5 -0.5 -0.5
8 | v 0.5 -0.5 0.5
9 | v 0.5 0.5 -0.5
10 | v 0.5 0.5 0.5
11 |
12 | vn -0.5 -0.5 0.5
13 | vn -0.5 -0.5 -0.5
14 | vn -0.5 0.5 -0.5
15 | vn -0.5 -0.5 -0.5
16 | vn 0.5 -0.5 -0.5
17 | vn -0.5 -0.5 -0.5
18 |
19 | usemtl red
20 | f 1//2 7//2 5//2
21 | f 1//2 3//2 7//2
22 | usemtl green
23 | f 1//6 4//6 3//6
24 | f 1//6 2//6 4//6
25 | usemtl blue
26 | f 3//3 8//3 7//3
27 | f 3//3 4//3 8//3
28 | usemtl yellow
29 | f 5//5 7//5 8//5
30 | f 5//5 8//5 6//5
31 | usemtl cyan
32 | f 1//4 5//4 6//4
33 | f 1//4 6//4 2//4
34 | usemtl white
35 | f 2//1 6//1 8//1
36 | f 2//1 8//1 4//1
37 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/dex_cube.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'dex_cube.blend'
2 | # Material Count: 1
3 |
4 | newmtl Material.002
5 | Ns 225.000000
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.134017 0.365916 0.800000
8 | Ks 0.500000 0.500000 0.500000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.450000
11 | d 1.000000
12 | illum 2
13 | map_Kd dex_cube.png
14 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/dex_cube.obj:
--------------------------------------------------------------------------------
1 | # Blender v3.0.1 OBJ File: 'dex_cube.blend'
2 | # www.blender.org
3 | mtllib dex_cube.mtl
4 | o Cube_Cube.002
5 | v -1.000000 -1.000000 1.000000
6 | v -1.000000 1.000000 1.000000
7 | v -1.000000 -1.000000 -1.000000
8 | v -1.000000 1.000000 -1.000000
9 | v 1.000000 -1.000000 1.000000
10 | v 1.000000 1.000000 1.000000
11 | v 1.000000 -1.000000 -1.000000
12 | v 1.000000 1.000000 -1.000000
13 | vt 1.000000 0.333333
14 | vt 1.000000 0.666667
15 | vt 0.500000 0.666667
16 | vt 0.500000 0.333333
17 | vt 0.500000 0.666667
18 | vt 0.500000 1.000000
19 | vt 0.000000 1.000000
20 | vt -0.000000 0.666667
21 | vt 0.500000 0.333333
22 | vt 0.500000 0.666667
23 | vt -0.000000 0.666667
24 | vt -0.000000 0.333333
25 | vt 1.000000 -0.000000
26 | vt 1.000000 0.333333
27 | vt 0.500000 0.333333
28 | vt 0.500000 0.000000
29 | vt 0.500000 0.000000
30 | vt 0.000000 0.000000
31 | vt 1.000000 0.666667
32 | vt 1.000000 1.000000
33 | vt 0.500000 1.000000
34 | vt 0.500000 0.666667
35 | vn -1.0000 0.0000 0.0000
36 | vn 0.0000 0.0000 -1.0000
37 | vn 1.0000 0.0000 0.0000
38 | vn 0.0000 0.0000 1.0000
39 | vn 0.0000 -1.0000 0.0000
40 | vn 0.0000 1.0000 0.0000
41 | usemtl Material.002
42 | s off
43 | f 1/1/1 2/2/1 4/3/1 3/4/1
44 | f 3/5/2 4/6/2 8/7/2 7/8/2
45 | f 7/9/3 8/10/3 6/11/3 5/12/3
46 | f 5/13/4 6/14/4 2/15/4 1/16/4
47 | f 3/17/5 7/9/5 5/12/5 1/18/5
48 | f 8/19/6 4/20/6 2/21/6 6/22/6
49 |
--------------------------------------------------------------------------------
/assets/dexhand/urdf/objects/meshes/dex_cube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/dexhand/urdf/objects/meshes/dex_cube.png
--------------------------------------------------------------------------------
/assets/mjcf/nv_ant.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/fetch/pick_and_place.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/fetch/push.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/fetch/reach.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/fetch/shared.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/fetch/slide.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/egg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/manipulate_block.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/manipulate_block_touch_sensors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/manipulate_egg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/manipulate_egg_touch_sensors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/manipulate_pen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/manipulate_pen_touch_sensors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/pen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/reach.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/shadow_hand.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/hand/shared_asset.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/.get:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/.get
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/base_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/base_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/bellows_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/bellows_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/elbow_flex_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/elbow_flex_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/estop_link.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/estop_link.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/forearm_roll_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/forearm_roll_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/gripper_link.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/gripper_link.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/head_pan_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/head_pan_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/head_tilt_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/head_tilt_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/l_wheel_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/l_wheel_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/laser_link.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/laser_link.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/r_wheel_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/r_wheel_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/shoulder_lift_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/shoulder_lift_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/shoulder_pan_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/shoulder_pan_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/torso_fixed_link.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/torso_fixed_link.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/torso_lift_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/torso_lift_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/upperarm_roll_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/upperarm_roll_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/wrist_flex_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/wrist_flex_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/fetch/wrist_roll_link_collision.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/fetch/wrist_roll_link_collision.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/F1.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/F1.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/F2.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/F2.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/F3.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/F3.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/TH1_z.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/TH1_z.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/TH2_z.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/TH2_z.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/TH3_z.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/TH3_z.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/forearm_electric.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/forearm_electric.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/forearm_electric_cvx.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/forearm_electric_cvx.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/knuckle.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/knuckle.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/lfmetacarpal.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/lfmetacarpal.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/palm.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/palm.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/stls/hand/wrist.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/stls/hand/wrist.stl
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/textures/block.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/textures/block.png
--------------------------------------------------------------------------------
/assets/mjcf/open_ai_assets/textures/block_hidden.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DexRobot/dexrobot_isaac/adeb649d7631b9513c7dd5be4062a3b8816ff5e6/assets/mjcf/open_ai_assets/textures/block_hidden.png
--------------------------------------------------------------------------------
/dataset/dataset.csv:
--------------------------------------------------------------------------------
1 | tag,base_ARTx,base_ARTy,base_ARTz,base_ARRx,base_ARRy,base_ARRz,r_f_joint1_1_pos,r_f_joint1_2_pos,r_f_joint1_3_pos,r_f_joint1_4_pos,r_f_joint2_1_pos,r_f_joint2_2_pos,r_f_joint2_3_pos,r_f_joint2_4_pos,r_f_joint3_1_pos,r_f_joint3_2_pos,r_f_joint3_3_pos,r_f_joint3_4_pos,r_f_joint4_1_pos,r_f_joint4_2_pos,r_f_joint4_3_pos,r_f_joint4_4_pos,r_f_joint5_1_pos,r_f_joint5_2_pos,r_f_joint5_3_pos,r_f_joint5_4_pos
2 | 20240902-163202,-0.1063467183124702,-0.0517529389215625,0.12116314542370649,0.7051092337090551,0.3684563772910424,-0.0055120468775294,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
--------------------------------------------------------------------------------
/dataset/generate_dataset.py:
--------------------------------------------------------------------------------
1 | import re
2 | import pandas as pd
3 | import numpy as np
4 | from pathlib import Path
5 |
6 |
7 | # Function to extract numbers from the string and convert them to a NumPy array
8 | def parse_array(array_str):
9 | # Use regular expression to find all floating-point numbers, including scientific notation
10 | numbers = re.findall(r"[-+]?\d*\.\d+(?:[eE][-+]?\d+)?|\d+", array_str)
11 |
12 | # Convert the extracted numbers to float and create a NumPy array
13 | return np.array(list(map(float, numbers)))
14 |
15 |
16 | def extract_pregrasp_from_csv(csv_path, tag, pos_offset=[0.0, 0.0, 1.2 - 0.85]):
17 | # Load csv file
18 | df = pd.read_csv(csv_path)
19 | # Extract joint positions and hand pose from last row
20 | pattern_joint = "r_f_joint\d_\d_pos"
21 | pattern_hand = "AR.._pos"
22 | pattern = f"({pattern_joint}|{pattern_hand})"
23 | data_entry = df.iloc[[-1]].filter(regex=pattern)
24 | data_entry["hand_pos_x"] = data_entry["ARTx_pos"] + pos_offset[0]
25 | data_entry["hand_pos_y"] = data_entry["ARTy_pos"] + pos_offset[1]
26 | data_entry["hand_pos_z"] = data_entry["ARTz_pos"] + pos_offset[2]
27 | data_entry["hand_euler_X"] = data_entry["ARRx_pos"]
28 | data_entry["hand_euler_Y"] = data_entry["ARRy_pos"]
29 | data_entry["hand_euler_Z"] = data_entry["ARRz_pos"]
30 | data_entry = data_entry.drop(columns=data_entry.filter(regex=pattern_hand).columns)
31 | data_entry.insert(0, "tag", [tag])
32 | return data_entry
33 |
34 |
35 | def make_dataset(parent_dir, patter_str=None):
36 | """Make dataset from all csv files matching parent_dir/dir_matching_pattern_str/tag/recorded_data.csv"""
37 | base_path = Path(parent_dir)
38 | if patter_str is not None:
39 | pattern = re.compile(patter_str)
40 | else:
41 | pattern = re.compile("^.*")
42 | experiment_dirs = [
43 | subdir
44 | for subdir in base_path.iterdir()
45 | if subdir.is_dir() and pattern.match(subdir.name)
46 | ]
47 | dfs = []
48 | for experiment in experiment_dirs:
49 | for tag in experiment.iterdir():
50 | if tag.is_dir():
51 | csv_path = tag / "recorded_data.csv"
52 | if csv_path.exists():
53 | data_entry = extract_pregrasp_from_csv(csv_path, tag.name)
54 | dfs.append(data_entry)
55 | return pd.concat(dfs, ignore_index=True)
56 |
57 |
58 | def filter_dataset(df, percentile=0.8):
59 | # Compute the average hand_pos_x, hand_pos_y, and hand_pos_z
60 | avg_x = df.filter(regex="hand_pos_x").mean(axis=1)
61 | avg_y = df.filter(regex="hand_pos_y").mean(axis=1)
62 | avg_z = df.filter(regex="hand_pos_z").mean(axis=1)
63 |
64 | # Compute distance from the average position
65 | distance = np.linalg.norm(
66 | df.filter(regex="hand_pos_.").values - np.array([avg_x, avg_y, avg_z]).T, axis=1
67 | )
68 | # Find the percentile of the distance
69 | threshold = np.percentile(distance, percentile * 100)
70 | # Eliminate the entries with distance greater than the threshold
71 | df_filtered = df[distance <= threshold]
72 | return df_filtered
73 |
74 |
75 | dataset = make_dataset("original")
76 | dataset = filter_dataset(dataset)
77 | dataset.to_csv("dataset.csv", index=False)
78 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | """Installation script for the 'DexHandEnv' python package."""
2 |
3 | from __future__ import absolute_import
4 | from __future__ import print_function
5 | from __future__ import division
6 |
7 | from setuptools import setup, find_packages
8 |
9 | import os
10 |
11 | root_dir = os.path.dirname(os.path.realpath(__file__))
12 |
13 |
14 | # Minimum dependencies required prior to installation
15 | INSTALL_REQUIRES = [
16 | # RL
17 | "gym==0.23.1",
18 | "torch",
19 | "omegaconf",
20 | "termcolor",
21 | "jinja2",
22 | "hydra-core>=1.2",
23 | "rl-games>=1.6.0",
24 | "pyvirtualdisplay",
25 | "urdfpy==0.0.22",
26 | "pysdf==0.1.9",
27 | "warp-lang==0.10.1",
28 | "trimesh==3.23.5",
29 | #add missing packages
30 | "loguru",
31 | "pandas",
32 | "matplotlib",
33 | "icecream",
34 | ]
35 |
36 |
37 | # Installation operation
38 | setup(
39 | name="DexHandEnv",
40 | author="NVIDIA",
41 | version="1.5.1",
42 | description="Benchmark environments for high-speed robot learning in NVIDIA IsaacGym.",
43 | keywords=["robotics", "rl"],
44 | include_package_data=True,
45 | python_requires=">=3.6",
46 | install_requires=INSTALL_REQUIRES,
47 | packages=find_packages("."),
48 | classifiers=[
49 | "Natural Language :: English",
50 | "Programming Language :: Python :: 3.6, 3.7, 3.8",
51 | ],
52 | zip_safe=False,
53 | )
54 |
55 | # EOF
56 |
--------------------------------------------------------------------------------