diff --git a/dial_mpc/core/dial_core.py b/dial_mpc/core/dial_core.py index 0a63689..d96b8e2 100644 --- a/dial_mpc/core/dial_core.py +++ b/dial_mpc/core/dial_core.py @@ -20,6 +20,7 @@ import dial_mpc.envs as dial_envs from dial_mpc.utils.io_utils import get_example_path, load_dataclass_from_dict +from dial_mpc.examples import examples plt.style.use("science") @@ -201,14 +202,6 @@ def reverse_scan(rng_Y0_state, factor): config_or_example.add_argument("--list-examples", action="store_true") args = parser.parse_args() - examples = [ - "unitree_h1_jog", - "unitree_h1_push_crate", - "unitree_go2_trot", - "unitree_go2_seq_jump", - "unitree_go2_crate_climb", - ] - if args.list_examples: print("Examples:") for example in examples: diff --git a/dial_mpc/envs/unitree_go2_env.py b/dial_mpc/envs/unitree_go2_env.py index 42f3638..d111718 100644 --- a/dial_mpc/envs/unitree_go2_env.py +++ b/dial_mpc/envs/unitree_go2_env.py @@ -778,7 +778,7 @@ def step( + reward_energy * 0.0000 + reward_pitch * 0.0 + reward_roll * 0.0 - + reward_contact * 0.2 + + reward_contact * 0.1 - penalty_contact * 0.0 ) # jax.debug.print("{geom}", geom=pipeline_state.contact.geom) diff --git a/dial_mpc/examples/__init__.py b/dial_mpc/examples/__init__.py new file mode 100644 index 0000000..96b6978 --- /dev/null +++ b/dial_mpc/examples/__init__.py @@ -0,0 +1,7 @@ +examples = [ + "unitree_h1_jog", + "unitree_h1_push_crate", + "unitree_go2_trot", + "unitree_go2_seq_jump", + "unitree_go2_crate_climb", +] diff --git a/dial_mpc/examples/unitree_go2_crate_climb.yaml b/dial_mpc/examples/unitree_go2_crate_climb.yaml new file mode 100644 index 0000000..b8b3e99 --- /dev/null +++ b/dial_mpc/examples/unitree_go2_crate_climb.yaml @@ -0,0 +1,21 @@ +# DIAL-MPC +seed: 0 +output_dir: unitree_go2_crate_climb +n_steps: 100 + +env_name: unitree_go2_crate_climb +Nsample: 2048 +Hsample: 25 +Hnode: 5 +Ndiffuse: 2 +Ndiffuse_init: 10 +temp_sample: 0.05 +horizon_diffuse_factor: 0.9 +traj_diffuse_factor: 0.5 +update_method: mppi + +# Base environment +dt: 0.02 +timestep: 0.02 +leg_control: torque +action_scale: 1.0 diff --git a/dial_mpc/examples/unitree_h1_push_crate.yaml b/dial_mpc/examples/unitree_h1_push_crate.yaml index 6d7ee90..a41a258 100644 --- a/dial_mpc/examples/unitree_h1_push_crate.yaml +++ b/dial_mpc/examples/unitree_h1_push_crate.yaml @@ -26,14 +26,3 @@ default_vy: 0.0 default_vyaw: 0.0 ramp_up_time: 2.0 gait: slow_walk - -# Sim -# sim_model_path: /home/haoru/research/dial/dial-mpc/dial_mpc/models/unitree_h1/scene_real_feet.xml -sim_model_path: /home/haoru/research/dial/dial-mpc/dial_mpc/models/unitree_h1/scene_position_real_feet.xml -# sim_leg_control: torque -sim_leg_control: position -plot: false -record: false -real_time_factor: 1.0 -sim_dt: 0.005 -sync_mode: false \ No newline at end of file